@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;700&display=swap');

:root {
  /* Task 1.4: Classical Pixel Font */
  --font-retro: 'Pixelify Sans', 'Courier New', monospace;

  /* Task 1.3: Dark Mode (Nightfall Grimoire) */
  --color-bg: #1a1a1d;
  --color-text: #c0b298;
  --color-text-highlight: #e0d2b8;
  --color-border-primary: #4a4a4d;
  --color-border-secondary: #2a2a2d;
  --color-shadow-inner: rgba(0, 0, 0, 0.8);
  --color-shadow-outer: rgba(0, 0, 0, 0.9);
  --color-accent: #a33b3b;

  /* Task 2.1: SVG Texture */
  --bg-pattern: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h40v40H0V0zm20 20h20v20H20V20z' fill='%23222' fill-opacity='0.4' fill-rule='evenodd'/%3E%3C/svg%3E");
}

[data-theme="light"] {
  /* Task 1.2: Light Mode (Daylight Scroll) */
  --color-bg: #e5d9c5;
  --color-text: #3c2f21;
  --color-text-highlight: #1c1005;
  --color-border-primary: #8a7b65;
  --color-border-secondary: #c5b9a5;
  --color-shadow-inner: rgba(0, 0, 0, 0.1);
  --color-shadow-outer: rgba(0, 0, 0, 0.2);
  --color-accent: #8b2b2b;

  --bg-pattern: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h40v40H0V0zm20 20h20v20H20V20z' fill='%23d5c9b5' fill-opacity='0.4' fill-rule='evenodd'/%3E%3C/svg%3E");
}

body {
  margin: 0;
  font-family: var(--font-retro);
  background-color: var(--color-bg);
  background-image: var(--bg-pattern);
  color: var(--color-text);
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

/* Base Headings */
h1, h2, h3 {
  color: var(--color-text-highlight);
  text-shadow: 2px 2px 0 var(--color-shadow-outer);
  text-align: center;
}

/* Task 2.2: Digital Woodcarving Box */
.wood-box {
  background: var(--color-bg);
  border: 4px solid var(--color-border-primary);
  border-radius: 4px;
  box-shadow: 
    inset 2px 2px 0 var(--color-border-secondary),
    inset -2px -2px 0 var(--color-shadow-inner),
    4px 4px 0 var(--color-shadow-outer);
  padding: 24px;
  color: var(--color-text);
  max-width: 800px;
  width: 100%;
}

/* Task 2.3: Stone Border Box */
.stone-box {
  background: var(--color-bg);
  border: 6px solid var(--color-border-primary);
  border-style: outset;
  box-shadow: 
    inset 4px 4px 0 rgba(255,255,255,0.05),
    inset -4px -4px 0 var(--color-shadow-inner),
    8px 8px 0 var(--color-shadow-outer);
  padding: 24px;
  color: var(--color-text);
  position: relative;
  max-width: 800px;
  width: 100%;
}

/* Stone SVG Texture Overlay */
.stone-box::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Cpath d='M0 0h1v1H0zm2 2h1v1H2z' fill='rgba(0,0,0,0.1)'/%3E%3C/svg%3E");
  z-index: 1;
}

/* Task 3.2: Big Box 3D Container */
.showcase-container {
  display: flex;
  gap: 40px;
  justify-content: center;
  perspective: 1200px;
  padding: 20px;
  flex-wrap: wrap;
}

/* Big Box 3D CSS */
.big-box {
  width: 220px;
  height: 300px;
  background: var(--color-bg);
  border: 4px solid var(--color-border-primary);
  border-left: 24px solid var(--color-border-secondary);
  box-shadow: 10px 10px 20px var(--color-shadow-outer);
  position: relative;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
  transform-style: preserve-3d;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  color: var(--color-text);
  padding: 20px;
}

.big-box:hover {
  transform: rotateX(15deg) rotateY(-20deg) translateZ(40px);
  box-shadow: 25px 25px 35px var(--color-shadow-outer);
  border-color: var(--color-text-highlight);
}

.big-box .box-cover {
  font-size: 24px;
  font-weight: bold;
  color: var(--color-text-highlight);
  text-shadow: 2px 2px 0 var(--color-shadow-inner);
  transform: translateZ(20px);
}

.big-box .box-sub {
  margin-top: 10px;
  font-size: 12px;
  color: var(--color-text);
  transform: translateZ(10px);
}

/* Fake Spine */
.big-box::before {
  content: "";
  position: absolute;
  left: -24px;
  top: -4px;
  bottom: -4px;
  width: 24px;
  background: var(--color-border-primary);
  transform-origin: right;
  transform: rotateY(-90deg);
  border-top: 4px solid var(--color-border-secondary);
  border-bottom: 4px solid var(--color-border-secondary);
}

/* Fake Top */
.big-box::after {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  top: -4px;
  height: 24px;
  background: var(--color-border-secondary);
  transform-origin: bottom;
  transform: rotateX(90deg) translateY(-24px);
  border-left: 24px solid var(--color-border-primary);
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--color-border-primary);
  color: var(--color-text-highlight);
  border: 4px solid var(--color-border-secondary);
  border-style: outset;
  box-shadow: 4px 4px 0 var(--color-shadow-outer);
  padding: 10px 20px;
  font-family: var(--font-retro);
  font-size: 16px;
  cursor: pointer;
  z-index: 100;
}
.theme-toggle:active {
  border-style: inset;
  box-shadow: 1px 1px 0 var(--color-shadow-outer);
  transform: translate(2px, 2px);
}
