/* Kanok Games studio site. Studio frame: black lacquer and gold leaf (Thai lai rot nam).
   The Hot Plates panel uses the game's own palette and font. */

@font-face {
  font-family: "Bodoni Moda";
  src: url("assets/fonts/bodoni-moda.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("assets/fonts/hanken-grotesk.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("assets/fonts/fredoka-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif Thai";
  src: url("assets/fonts/noto-serif-thai.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;
}

:root {
  /* studio */
  --ink: #110e0c;
  --ink-raised: #1a1512;
  --rule: #3b3129;
  --gold: #d4af6a;
  --gold-bright: #e6c78a;
  --text: #f3ede3;
  --muted: #b4a998;

  /* Hot Plates */
  --hp-cream: #fff8ee;
  --hp-brown: #2b1f18;
  --hp-brown-soft: #5c4a3e;
  --hp-orange: #ff8a3d;
  --hp-orange-deep: #e2661b;
  --hp-orange-text: #b84e0f;

  --serif: "Bodoni Moda", "Didot", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --thai: "Noto Serif Thai", "Bodoni Moda", serif;
  --game: "Fredoka", "Hanken Grotesk", system-ui, sans-serif;

  /* scale */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;
  --r-1: 8px; --r-2: 16px; --r-3: 24px; --r-4: 32px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-wipe: cubic-bezier(0.65, 0, 0.35, 1);
  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ol, ul, figure { margin: 0; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; color: var(--gold); }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: var(--s-4); top: -100px; z-index: 10;
  padding: var(--s-3) var(--s-4); background: var(--gold); color: var(--ink);
  font-weight: 600; text-decoration: none; border-radius: var(--r-1);
}
.skip:focus { top: var(--s-4); }

/* Header */
.site-header { position: relative; z-index: 2; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: var(--s-3); text-decoration: none; min-height: 44px; }
.brand-mark { width: 26px; height: 26px; fill: var(--gold); flex: none; }
.brand-name { font-family: var(--serif); font-size: 1.125rem; font-weight: 500; letter-spacing: 0.01em; white-space: nowrap; }
.nav { display: flex; gap: var(--s-1); list-style: none; padding: 0; margin-right: calc(var(--s-3) * -1); }
@media (max-width: 419px) { .nav-games { display: none; } }
@media (max-width: 359px) { .nav-studio { display: none; } }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-3);
  color: var(--muted); text-decoration: none; font-size: 0.9375rem; font-weight: 500;
  transition: color 0.2s ease;
}
.nav a:hover { color: var(--text); }

/* Hero */
.hero { position: relative; padding: var(--s-6) 0 var(--s-8); isolation: isolate; overflow-x: clip; }
.hero-art {
  position: absolute; z-index: -1;
  width: 340px; height: 340px; right: -128px; top: 8px;
  fill: none; stroke: var(--gold); stroke-width: 0.45; stroke-linejoin: round;
  opacity: 0.3;
}
.hero-art path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(4rem, 19vw, 9rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
}
.hero-title span { display: block; }
.hero-title span + span { color: var(--gold); padding-left: 0.5em; }
.hero-statement {
  margin-top: var(--s-6);
  max-width: 18ch;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 5.6vw, 2.25rem);
  font-weight: 450;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.hero-sub { margin-top: var(--s-3); color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4) var(--s-5); margin-top: var(--s-6); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-3);
  min-height: 52px; padding: 0 var(--s-5);
  border-radius: 999px; text-decoration: none; font-weight: 600;
  transition: transform 0.2s var(--ease-out), background-color 0.2s ease, box-shadow 0.2s ease;
}
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s var(--ease-out); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: var(--ink); font-size: 1.0625rem; }
.btn-gold:hover { background: var(--gold-bright); }
.link-quiet {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--text); font-weight: 500; text-decoration: underline;
  text-decoration-color: var(--rule); text-underline-offset: 6px; text-decoration-thickness: 1px;
  transition: text-decoration-color 0.2s ease;
}
.link-quiet:hover { text-decoration-color: var(--gold); }

/* Frieze: a band of kanok flames, like a lai border */
.frieze { opacity: 0.7; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: var(--s-2) 0; }
.frieze svg { width: 100%; height: 36px; }

/* Games */
.games { padding: var(--s-8) 0; }
.hp {
  display: grid;
  grid-template-areas: "head" "cta" "visual" "features";
  gap: var(--s-6);
  background: var(--hp-cream);
  color: var(--hp-brown);
  border-radius: var(--r-3);
  padding: var(--s-6) var(--s-5) var(--s-7);
  margin: 0 calc(var(--gutter) * -0.5);
  overflow: hidden;
}
.hp-head { grid-area: head; }
.hp-cta { grid-area: cta; }
.hp-visual { grid-area: visual; }
.hp-features { grid-area: features; }

.hp-title { font-family: var(--game); font-weight: 600; line-height: 1; }
.hp-name { display: block; font-size: clamp(3rem, 14vw, 4.5rem); letter-spacing: -0.01em; }
.hp-sub { display: block; margin-top: var(--s-2); font-size: 1.25rem; color: var(--hp-orange-text); }
.hp-pitch { margin-top: var(--s-4); font-size: 1.125rem; line-height: 1.5; color: var(--hp-brown); max-width: 34ch; }

.btn-play {
  width: 100%; min-height: 56px;
  font-family: var(--game); font-size: 1.5rem; font-weight: 600;
  background: var(--hp-orange); color: var(--hp-brown);
  box-shadow: 0 4px 0 var(--hp-orange-deep);
}
.btn-play svg { width: 24px; height: 24px; stroke-width: 2.4; }
.btn-play:hover { background: #ff9a55; }
.btn-play:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--hp-orange-deep); }
.btn-play:focus-visible { outline-color: var(--hp-brown); }
.hp-note { margin-top: var(--s-3); font-size: 0.9375rem; color: var(--hp-brown-soft); text-align: center; }

/* Phones */
.hp-visual {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); align-items: center;
  padding: var(--s-4) 0;
  margin: 0 calc(var(--s-5) * -1);
}
.phone {
  position: relative;
  border-radius: 22px;
  border: 5px solid var(--hp-brown);
  background: var(--hp-brown);
  overflow: hidden;
  box-shadow: 0 18px 36px -18px rgba(43, 31, 24, 0.55);
}
.phone img, .phone video { width: 100%; height: 100%; object-fit: cover; border-radius: 17px; background: var(--hp-brown); }
.phone-main { z-index: 1; aspect-ratio: 9 / 16; margin: 0 calc(var(--s-4) * -1); }
.phone-side { aspect-ratio: 1170 / 2532; }
.phone-left { transform: rotate(-6deg) translateX(10px); }
.phone-right { transform: rotate(6deg) translateX(-10px); }

.trailer-play {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: var(--s-2);
  width: 100%; padding: var(--s-4) var(--s-2) var(--s-5);
  border: 0; border-radius: 17px; cursor: pointer;
  background: linear-gradient(to top, rgba(43, 31, 24, 0.88) 0%, rgba(43, 31, 24, 0) 45%);
  color: var(--hp-cream);
  font-family: var(--game); font-size: 1rem; font-weight: 600; line-height: 1.2;
}
.trailer-play svg {
  width: 56px; height: 56px; padding: var(--s-4); border-radius: 50%;
  background: var(--hp-orange); fill: var(--hp-brown); flex: none;
  box-shadow: 0 3px 0 var(--hp-orange-deep);
  transition: transform 0.2s var(--ease-out), background-color 0.2s ease;
}
.trailer-play:hover svg { background: #ff9a55; transform: scale(1.05); }
.trailer-play:focus-visible { outline: 3px solid var(--hp-orange); outline-offset: -3px; }
.trailer-len { opacity: 0.75; }
.trailer-play[hidden] { display: none; }

/* Features */
.hp-features { list-style: none; padding: 0; display: grid; gap: var(--s-5); counter-reset: f; }
.hp-features li { position: relative; padding-left: 44px; counter-increment: f; }
.hp-features li::before {
  content: counter(f);
  position: absolute; left: 0; top: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--hp-brown); color: var(--hp-cream);
  font-family: var(--game); font-weight: 600; font-size: 0.9375rem;
}
.hp-features h3 { font-family: var(--game); font-weight: 600; font-size: 1.375rem; line-height: 1.25; }
.hp-features p { margin-top: var(--s-1); color: var(--hp-brown-soft); font-size: 1rem; line-height: 1.55; }

/* Studio */
.studio { padding: var(--s-8) 0; border-top: 1px solid var(--rule); }
.studio-grid { display: grid; gap: var(--s-6); }
.lexeme { display: flex; align-items: baseline; gap: var(--s-4); }
.lexeme-thai { font-family: var(--thai); font-size: clamp(4.5rem, 22vw, 8rem); line-height: 1.1; color: var(--gold); }
.lexeme-roman { font-family: var(--serif); font-size: 1.25rem; color: var(--muted); letter-spacing: 0.04em; }
.studio-copy h2 { font-family: var(--serif); font-weight: 450; font-size: clamp(2rem, 7.5vw, 3rem); line-height: 1.1; letter-spacing: -0.01em; }
.studio-copy p { margin-top: var(--s-4); max-width: 56ch; color: var(--muted); }
.studio-copy p:first-of-type { margin-top: var(--s-5); color: var(--text); }
.studio-copy [lang="th"] { font-family: var(--thai); }

/* Contact */
.contact { padding: var(--s-8) 0; border-top: 1px solid var(--rule); }
.contact-grid { display: grid; }
.contact h2 { font-family: var(--serif); font-weight: 450; font-size: clamp(2rem, 7.5vw, 3rem); line-height: 1.1; }
.contact p { margin-top: var(--s-3); color: var(--muted); max-width: 40ch; }
.mail {
  display: inline-block; margin-top: var(--s-5);
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.5rem, 4.6vw, 2.75rem); line-height: 1.2;
  color: var(--gold); text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 0.18em; text-decoration-color: rgba(212, 175, 106, 0.45);
  overflow-wrap: anywhere;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}
.mail:hover { color: var(--gold-bright); text-decoration-color: var(--gold-bright); }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: var(--s-6) 0 calc(var(--s-6) + env(safe-area-inset-bottom)); color: var(--muted); font-size: 0.9375rem; }
.footer-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-3) var(--s-5); }
.footer-mark { width: 22px; height: 22px; fill: var(--gold); }
.footer-row p:last-child { margin-left: auto; }
.footer-row a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 4px; text-decoration-color: var(--rule); }
.footer-row a:hover { color: var(--text); text-decoration-color: var(--gold); }

/* The one authored motion: the hero flame draws itself in. */
@media (prefers-reduced-motion: no-preference) {
  .hero-art path { stroke-dashoffset: 1; animation: draw 2.4s var(--ease-wipe) 0.2s forwards; }
  .hero-art path:nth-child(2) { animation-delay: 0.9s; }
  .hero-art path:nth-child(3) { animation-delay: 1.4s; animation-duration: 1.6s; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .btn svg { transition: none; }
}

/* Tablet and up */
@media (min-width: 768px) {
  :root { --gutter: 40px; }
  .header-row { min-height: 88px; }
  .hero { padding: var(--s-8) 0 var(--s-9); }
  .hero-art { width: 560px; height: 560px; right: -80px; top: 0; }
  .hero-art { opacity: 0.42; }
  .hero-statement { margin-top: var(--s-7); }
  .hp { margin: 0; padding: var(--s-7); border-radius: var(--r-4); }
  .hp-visual { margin: 0; max-width: 560px; justify-self: center; width: 100%; }
  .btn-play { width: auto; min-width: 260px; padding: 0 var(--s-7); }
  .hp-note { text-align: left; }
  .hp-features { grid-template-columns: repeat(3, 1fr); gap: var(--s-6); }
  .studio-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-7); align-items: start; }
  .lexeme { flex-direction: column; gap: var(--s-1); }
}

/* Desktop */
@media (min-width: 1024px) {
  .hero-art { width: 620px; height: 620px; right: 4%; top: -40px; }
  .hp {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    grid-template-areas:
      "visual head"
      "visual cta"
      "visual features";
    grid-template-rows: auto auto 1fr;
    column-gap: var(--s-8);
    row-gap: var(--s-6);
    padding: var(--s-8);
  }
  .hp-visual { max-width: none; align-self: center; }
  .hp-features { grid-template-columns: 1fr; gap: var(--s-5); align-self: start; }
  .contact-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-7); align-items: end; }
  .contact-grid .mail { margin-top: 0; }
  .mail { white-space: nowrap; }
  .hero { min-height: calc(100dvh - 88px - 54px); display: flex; flex-direction: column; justify-content: center; padding: var(--s-7) 0; }
}

@media (min-width: 1440px) {
  .wrap { max-width: 1280px; }
}

/* 404 page */
.notfound { min-height: 100dvh; display: flex; align-items: center; padding: var(--s-8) 0; }
.notfound-mark { width: 48px; height: 48px; fill: var(--gold); }
.notfound h1 { margin-top: var(--s-6); font-family: var(--serif); font-weight: 450; font-size: clamp(2rem, 7.5vw, 3rem); line-height: 1.1; }
.notfound p { margin-top: var(--s-3); color: var(--muted); }
