:root {
  --paper: #fffaf0;
  --paper-soft: #f7f0df;
  --ink: #24312f;
  --muted: #6f7c75;
  --line: #d9cdb8;
  --blue: #93d8eb;
  --green: #bfe8b4;
  --yellow: #f6d978;
  --pink: #f3b7c4;
  --white: #fffdf8;
  --shadow: 0 18px 48px rgba(86, 74, 52, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(36, 49, 47, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 49, 47, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 42px 42px;
  font-family: "Trebuchet MS", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(18px, 5vw, 70px);
  background: rgba(255, 250, 240, 0.88);
  border-bottom: 2px solid rgba(217, 205, 184, 0.68);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  border-radius: 50% 48% 53% 45%;
  background:
    radial-gradient(circle at 50% 50%, var(--yellow) 0 18%, transparent 19%),
    conic-gradient(var(--blue), var(--green), var(--pink), var(--blue));
  box-shadow: 3px 4px 0 rgba(36, 49, 47, 0.12);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.language-toggle,
.menu-toggle {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 3px 4px 0 rgba(36, 49, 47, 0.12);
  cursor: pointer;
}

.language-toggle span {
  font-size: 12px;
  font-weight: 900;
}

.menu-toggle {
  gap: 4px;
  align-content: center;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 999px;
}

.nav-drawer,
.language-popover {
  position: fixed;
  top: 72px;
  right: clamp(18px, 5vw, 70px);
  display: grid;
  gap: 8px;
  width: min(280px, calc(100vw - 32px));
  padding: 16px;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 18px 16px 20px 15px;
  box-shadow: 8px 10px 0 rgba(36, 49, 47, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.language-popover {
  right: calc(clamp(18px, 5vw, 70px) + 56px);
  width: 172px;
}

.nav-drawer.open,
.language-popover.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-drawer a,
.lang-btn {
  padding: 11px 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  font-weight: 800;
}

.nav-drawer a:hover,
.lang-btn:hover,
.lang-btn.active {
  color: var(--ink);
  background: #f7efd8;
}

.hero,
.section,
.facts,
.question-strip,
.project-footer {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(340px, 0.92fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
  min-height: 760px;
  padding: 54px 0 72px;
}

.hero > *,
.split > *,
.screen-grid > *,
.flip-grid > * {
  min-width: 0;
}

.eyebrow,
.section-heading p,
.section-title p {
  margin: 0 0 12px;
  color: #9b6b12;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  overflow-wrap: anywhere;
}

h1 {
  max-width: 560px;
  margin-bottom: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(50px, 7vw, 88px);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: clamp(19px, 1.8vw, 23px);
  line-height: 1.2;
}

.hero-subtitle {
  margin-bottom: 14px;
  color: #2c4b50;
  font-size: clamp(23px, 2.8vw, 34px);
  font-weight: 900;
  line-height: 1.14;
}

.hero-text,
.long-copy,
.story-step p,
.screen-card figcaption,
.card-caption p,
.craft-list,
.facts span {
  color: var(--muted);
}

.hero-text {
  max-width: 470px;
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-link,
.ghost-link,
.flip-btn,
.footer-link strong {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-weight: 900;
  box-shadow: 4px 5px 0 rgba(36, 49, 47, 0.13);
}

.primary-link {
  padding: 0 20px;
  background: var(--green);
}

.ghost-link {
  padding: 0 18px;
  background: var(--white);
}

.hero-board {
  position: relative;
  padding: 16px;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 26px 20px 28px 22px;
  box-shadow: 12px 14px 0 rgba(36, 49, 47, 0.12);
  transform: rotate(1deg);
}

.hero-board img {
  border: 1px solid var(--line);
  border-radius: 16px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top center;
}

.sketch-note {
  position: absolute;
  padding: 8px 11px;
  background: #fff6cf;
  border: 2px solid var(--ink);
  border-radius: 14px 12px 15px 11px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 4px 5px 0 rgba(36, 49, 47, 0.1);
}

.note-one {
  left: -18px;
  bottom: 28px;
  transform: rotate(-5deg);
}

.note-two {
  top: -16px;
  right: 24px;
  background: #dff5fb;
  transform: rotate(4deg);
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding-bottom: 28px;
}

.facts div {
  min-height: 156px;
  padding: 22px;
  background: rgba(255, 253, 248, 0.82);
  border: 2px solid var(--line);
  border-radius: 18px 15px 20px 16px;
}

.facts span {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.facts strong {
  display: block;
  font-size: 17px;
  line-height: 1.35;
}

.section {
  padding: 86px 0;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.72fr);
  gap: clamp(30px, 6vw, 76px);
}

.long-copy {
  font-size: 18px;
}

.question-strip {
  display: grid;
  grid-template-columns: 0.9fr 1fr;
  gap: 14px;
  padding: 28px;
  background: #ecf7ed;
  border: 2px dashed #6b8f6a;
  border-radius: 24px 18px 28px 20px;
}

.question-strip span {
  display: flex;
  min-height: 128px;
  align-items: center;
  padding: 24px;
  border-radius: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.1;
}

.question-strip span:first-child {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
}

.question-strip span:last-child {
  background: var(--green);
  border: 2px solid var(--ink);
}

.section-heading {
  max-width: 680px;
  margin-bottom: 34px;
}

.story-line,
.flip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.story-step {
  position: relative;
  min-height: 310px;
  padding: 24px;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 24px 18px 28px 20px;
  box-shadow: var(--shadow);
}

.story-step img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  margin-bottom: 14px;
}

.story-step span {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #9b6b12;
  font-weight: 900;
}

.screen-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.screen-card {
  grid-column: span 3;
  margin: 0;
  padding: 14px;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 22px 18px 26px 20px;
  box-shadow: var(--shadow);
}

.screen-card.large {
  grid-column: span 4;
}

.screen-card.opening-screen {
  grid-column: 1 / -1;
}

.screen-card.wide {
  grid-column: span 6;
}

.screen-card img {
  width: 100%;
  height: 360px;
  object-fit: contain;
  object-position: top center;
  background: #fffaf2;
  border-radius: 14px;
  border: 1px solid #e5dbc8;
}

.screen-card.large img,
.screen-card.wide img {
  height: 430px;
}

.screen-card.opening-screen img {
  width: min(100%, 920px);
  height: 500px;
  margin: 0 auto;
}

.screen-card figcaption {
  padding: 12px 4px 0;
  font-size: 15px;
  font-weight: 800;
}

.code-section {
  padding-top: 70px;
}

.flip-card {
  min-height: 560px;
  perspective: 1200px;
}

.flip-card.is-flipped .flip-inner {
  transform: rotateY(180deg);
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 560px;
  transition: transform 0.7s ease;
  transform-style: preserve-3d;
}

.flip-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  overflow: hidden;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 24px 18px 28px 20px;
  box-shadow: 8px 10px 0 rgba(36, 49, 47, 0.12);
  backface-visibility: hidden;
}

.flip-face.front img {
  width: 100%;
  height: 270px;
  object-fit: contain;
  object-position: top center;
  background: #fffaf2;
  border: 1px solid var(--line);
  border-radius: 15px;
}

.card-caption {
  flex: 1;
}

.flip-btn {
  width: 100%;
  min-height: 42px;
  background: var(--yellow);
  cursor: pointer;
}

.flip-face.back {
  background: #23312e;
  color: #f9f1df;
  transform: rotateY(180deg);
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #d8eec6;
  font-size: 13px;
  font-weight: 900;
}

.code-head .flip-btn {
  width: auto;
  min-height: 36px;
  padding: 0 12px;
  color: var(--ink);
}

pre {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 16px;
  overflow: auto;
  color: #fdf7e8;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.55;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.craft-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 0.85fr);
  gap: clamp(28px, 6vw, 70px);
}

.craft-list {
  padding: 26px;
  background: #eef7f6;
  border: 2px solid #b6d2cf;
  border-radius: 24px 18px 28px 20px;
  font-size: 18px;
}

.craft-list p:last-child {
  margin-bottom: 0;
}

.project-footer {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(300px, 0.75fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 56px;
  padding: clamp(28px, 5vw, 46px);
  background: #dff4f4;
  border: 2px solid var(--ink);
  border-radius: 28px 20px 30px 22px;
  box-shadow: 10px 12px 0 rgba(36, 49, 47, 0.12);
}

.project-footer p {
  margin-bottom: 8px;
  color: #64716d;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-footer h2 {
  margin-bottom: 0;
}

.footer-link {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 20px 16px 22px 18px;
  box-shadow: 5px 6px 0 rgba(36, 49, 47, 0.12);
}

.footer-link span {
  color: #2e565b;
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.footer-link strong {
  background: var(--green);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .story-line,
  .flip-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .hero,
  .split,
  .craft-section,
  .project-footer {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .facts {
    grid-template-columns: repeat(2, 1fr);
  }

  .question-strip {
    grid-template-columns: 1fr;
  }

  .screen-card,
  .screen-card.large,
  .screen-card.opening-screen,
  .screen-card.wide {
    grid-column: span 6;
  }
}

@media (max-width: 620px) {
  .hero,
  .section,
  .facts,
  .question-strip,
  .project-footer {
    width: calc(100vw - 28px);
  }

  .site-header {
    padding-inline: 14px;
  }

  .brand span:last-child {
    max-width: 190px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  h1 {
    max-width: 320px;
    font-size: 42px;
  }

  h2 {
    font-size: 30px;
  }

  .hero-board {
    padding: 10px;
    transform: none;
  }

  .note-one,
  .note-two {
    display: none;
  }

  .facts,
  .story-line,
  .flip-grid {
    grid-template-columns: 1fr;
  }

  .screen-card img,
  .screen-card.large img,
  .screen-card.opening-screen img,
  .screen-card.wide img {
    height: 260px;
  }

  .flip-card,
  .flip-inner {
    min-height: 560px;
  }

  .project-footer {
    padding: 24px;
  }
}
