/* Manoi Studios — site styles
   Look: "Paper Lantern Night" — cut-paper shapes with no outlines, hard paper shadows,
   a night-market palette. Fonts are self-hosted (no third-party requests). */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces.woff2") format("woff2-variations"), url("/fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --night: #20265a;      /* sky */
  --dusk: #1c2150;       /* page below the skyline */
  --hill: #2b3474;
  --paper: #f4e7cd;      /* warm paper */
  --paper-ink: #232850;  /* text on paper */
  --lantern: #f4b740;
  --glow: #ffe2a0;
  --persimmon: #e15a3c;
  --pine: #3f8f86;
  --muted: #c7c4dd;      /* secondary text on night */
  --shadow: #0c0f2e;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --text: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --glyphs: system-ui, "Noto Sans", "Leelawadee UI", "Nirmala UI", "Malgun Gothic", "Yu Gothic", "Microsoft YaHei", sans-serif;

  /* type scale, ratio 1.25 from 18px */
  --s-1: 0.9rem;
  --s0: 1.125rem;
  --s1: 1.406rem;
  --s2: 1.758rem;
  --s3: 2.197rem;
  --s4: 2.747rem;

  --measure: 64ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --paper-drop: 0 6px 0 var(--shadow);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--dusk);
  scroll-behavior: smooth;
  scroll-padding-top: env(safe-area-inset-top, 0px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--dusk);
  color: var(--paper);
  font-family: var(--text);
  font-size: var(--s0);
  line-height: 1.55;
}

img, svg { max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  line-height: 1.12;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h2 { font-size: var(--s4); }
h3 { font-size: var(--s2); }
h4 { font-size: var(--s1); }
p { margin: 0 0 1em; max-width: var(--measure); }

a { color: var(--glow); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { color: var(--paper); }
:focus-visible { outline: 3px solid var(--glow); outline-offset: 3px; border-radius: 4px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--paper); color: var(--paper-ink);
  padding: 0.6rem 1rem; border-radius: 6px; font-weight: 700;
}
.skip:focus { top: calc(1rem + env(safe-area-inset-top, 0px)); }

/* ---------- header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) var(--gutter) 0.5rem;
  background: var(--night);
}
.brand { display: inline-flex; align-items: center; gap: 0.65rem; color: var(--paper); text-decoration: none; }
.brand-mark { width: 30px; height: 36px; flex: none; }
.brand-name {
  font-family: var(--display); font-size: var(--s1); font-weight: 650;
  font-variation-settings: "SOFT" 100, "WONK" 1; letter-spacing: 0.005em;
}
.site-nav { display: flex; gap: 0.25rem 1.4rem; flex-wrap: wrap; }
.site-nav a { color: var(--paper); text-decoration: none; padding: 0.3rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--lantern); color: var(--paper); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  background: var(--night);
  padding: 0 var(--gutter);
  overflow: hidden;
}

.lantern-string {
  position: relative;
  display: flex; justify-content: space-around; align-items: flex-start;
  height: 216px;
  margin: 0 calc(var(--gutter) * -1);
  padding: 0 1%;
}
.string-line { position: absolute; inset: 0 0 auto 0; width: 100%; height: 90px; overflow: visible; }

.lantern {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  width: 84px; padding: 0; margin: 21px 0 0;
  background: none; border: 0; cursor: pointer; color: inherit; font: inherit;
  transform-origin: 50% 0;
  animation: sway 5.5s ease-in-out infinite alternate;
}
.lantern::before { /* the cord */
  content: ""; width: 2px; height: 24px; background: var(--paper);
}
.lantern-body {
  position: relative;
  display: grid; place-items: center;
  width: 70px; height: 78px;
  border-radius: 46% 46% 42% 42% / 50% 50% 44% 44%;
  background: var(--lantern);
  box-shadow: 0 0 0 0 transparent, 4px 6px 0 var(--shadow), 0 0 34px 6px rgba(244, 183, 64, 0.28);
}
.lantern-body::before, .lantern-body::after { /* paper caps */
  content: ""; position: absolute; left: 50%; width: 40px; height: 9px; margin-left: -20px;
  background: var(--persimmon); border-radius: 3px;
}
.lantern-body::before { top: -4px; }
.lantern-body::after { bottom: -4px; }
.glyph {
  font-family: var(--glyphs); font-size: 2.1rem; font-weight: 700; line-height: 1;
  color: var(--night);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.lantern.is-turning .glyph { transform: scaleX(0); opacity: 0; }
.tag {
  margin-top: 7px; padding: 0.05rem 0.45rem;
  font-size: 0.78rem; line-height: 1.4; color: var(--paper-ink); background: var(--paper);
  border-radius: 2px; box-shadow: 2px 3px 0 var(--shadow);
  white-space: nowrap;
}
.lantern:nth-child(odd) .lantern-body { background: var(--persimmon); box-shadow: 4px 6px 0 var(--shadow), 0 0 34px 6px rgba(225, 90, 60, 0.25); }
.lantern:nth-child(odd) .lantern-body::before,
.lantern:nth-child(odd) .lantern-body::after { background: var(--lantern); }
.lantern:nth-child(odd) .glyph { color: var(--paper); }
.lantern:hover .lantern-body { filter: brightness(1.08); }
.lantern:focus-visible { outline: none; }
.lantern:focus-visible .lantern-body { outline: 3px solid var(--glow); outline-offset: 5px; }

/* positions follow the string's curve: y = 10 + 120 t (1 - t), scaled 1.5 (svg is child 1) */
.lantern:nth-child(2), .lantern:nth-child(8) { margin-top: 21px; }
.lantern:nth-child(3), .lantern:nth-child(7) { margin-top: 39px; }
.lantern:nth-child(4), .lantern:nth-child(6) { margin-top: 50px; }
.lantern:nth-child(5) { margin-top: 54px; }
.lantern:nth-child(2) { animation-duration: 5.1s; }
.lantern:nth-child(3) { animation-duration: 6.3s; animation-delay: -2s; }
.lantern:nth-child(4) { animation-duration: 5.7s; animation-delay: -1s; }
.lantern:nth-child(5) { animation-duration: 6.8s; animation-delay: -3s; }
.lantern:nth-child(6) { animation-duration: 5.4s; animation-delay: -2.5s; }
.lantern:nth-child(7) { animation-duration: 6.1s; animation-delay: -0.5s; }
.lantern:nth-child(8) { animation-duration: 5.9s; animation-delay: -1.5s; }

@keyframes sway {
  from { transform: rotate(-2.5deg); }
  to   { transform: rotate(2.5deg); }
}

.hero-copy {
  position: relative; z-index: 1;
  max-width: 46rem;
  padding: 0.5rem 0 0;
}
.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.8rem);
  font-weight: 640;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  line-height: 1.02;
  letter-spacing: -0.012em;
  margin-bottom: 0.4em;
}
.lede { font-size: var(--s1); line-height: 1.5; color: var(--paper); max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.6rem; }

.skyline { display: block; max-width: none; width: calc(100% + var(--gutter) * 2); height: clamp(150px, 20vw, 260px); margin: -1rem calc(var(--gutter) * -1) 0; }

/* ---------- buttons ---------- */
.button {
  display: inline-block;
  padding: 0.75rem 1.35rem;
  border-radius: 8px;
  font-weight: 700; text-decoration: none; line-height: 1.2;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.button:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--shadow); }
.button-gold { background: var(--lantern); color: var(--paper-ink); box-shadow: var(--paper-drop); }
.button-gold:hover { background: var(--glow); color: var(--paper-ink); }
.button-quiet { color: var(--paper); box-shadow: inset 0 0 0 2px var(--paper); }
.button-quiet:hover { background: rgba(244, 231, 205, 0.1); color: var(--paper); }
.button-ink { background: var(--night); color: var(--paper); box-shadow: 0 5px 0 var(--shadow); }
.button-ink:hover { background: #2b3474; color: var(--paper); }

/* ---------- promises ---------- */
.promises {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem var(--gutter);
  padding: 2.5rem var(--gutter) 3.5rem;
  max-width: 76rem; margin: 0 auto;
}
.promise h3 { font-size: var(--s2); color: var(--lantern); margin-bottom: 0.3em; }
.promise p { color: var(--muted); margin: 0; }

/* ---------- sections ---------- */
.games, .beyond, .about, .contact { padding: 3.5rem var(--gutter); max-width: 76rem; margin: 0 auto; }
.games > h2, .beyond > h2 { margin-bottom: 1.2em; }

/* the Script Fall sheet: the one big piece of paper */
.feature {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 2.5rem; align-items: center;
  background: var(--paper); color: var(--paper-ink);
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: 3px;
  box-shadow: 10px 12px 0 var(--shadow);
  transform: rotate(-0.6deg);
}
.feature h3 { font-size: var(--s4); margin-bottom: 0.25em; }
.feature-lede { font-family: var(--display); font-size: var(--s1); font-variation-settings: "SOFT" 100; line-height: 1.35; }
.feature a:not(.button) { color: var(--paper-ink); }
.feature-art { width: 100%; height: auto; border-radius: 4px; box-shadow: 6px 8px 0 rgba(12, 15, 46, 0.35); transform: rotate(1.6deg); }
.stamp {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.2rem 0.7rem;
  color: var(--persimmon);
  font-family: var(--display); font-weight: 700; font-size: var(--s0);
  box-shadow: inset 0 0 0 3px var(--persimmon);
  border-radius: 4px;
  transform: rotate(-3deg);
}

.lineup { margin-top: 4.5rem; }
.lineup-title { font-size: var(--s3); margin-bottom: 1.1em; }
.tags {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.2rem 2rem;
}
.tag-card {
  position: relative;
  padding: 2.4rem 1.6rem 1.5rem;
  color: var(--paper-ink);
  clip-path: polygon(22px 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%, 0 22px);
  filter: drop-shadow(5px 7px 0 var(--shadow));
}
.tag-card::before { /* punched hole */
  content: ""; position: absolute; top: 12px; left: 50%; width: 14px; height: 14px; margin-left: -7px;
  border-radius: 50%; background: var(--dusk);
}
.tag-card h4 { margin-bottom: 0.4em; }
.tag-card p { margin: 0; }
.tag-card .tag-status {
  font-weight: 700; font-size: var(--s-1); margin-bottom: 0.5rem;
}
.tbd { font-family: var(--text); font-size: var(--s-1); font-weight: 400; }
.tag-pine { background: var(--pine); color: #fff8ea; }
.tag-persimmon { background: var(--persimmon); color: #fff8ea; }
.tag-gold { background: var(--lantern); }
.tag-paper { background: var(--paper); }
.tags li:nth-child(odd) { transform: rotate(-0.8deg); }
.tags li:nth-child(even) { transform: rotate(0.9deg) translateY(10px); }

/* ---------- beyond the screen ---------- */
.beyond-sheet {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--hill);
  border-radius: 3px;
  box-shadow: var(--paper-drop);
}
.beyond-item { padding: 2rem clamp(1.25rem, 3vw, 2.5rem); }
.beyond-item + .beyond-item { box-shadow: inset 3px 0 0 var(--dusk); }
.beyond-item h3 { font-size: var(--s2); }
.beyond-item p { color: var(--muted); }
.beyond-item .beyond-status { color: var(--lantern); font-weight: 700; margin: 0; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 1rem var(--gutter); align-items: start; }
.about h2 { font-size: var(--s4); }
.about-text p { font-size: var(--s1); line-height: 1.5; }
.about-text .aside { font-size: var(--s0); color: var(--muted); }

/* ---------- contact ---------- */
.contact { text-align: left; padding-bottom: 5rem; }
.contact .email {
  font-family: var(--display); font-weight: 600;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: clamp(1.7rem, 5vw, 3.4rem);
  color: var(--lantern);
  text-decoration-thickness: 0.06em;
  overflow-wrap: anywhere;
}
.contact .email:hover { color: var(--glow); }
.contact-note { color: var(--muted); }

/* ---------- footer ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; justify-content: space-between; align-items: center;
  padding: 1.5rem var(--gutter) calc(1.5rem + env(safe-area-inset-bottom, 0px));
  background: var(--shadow); color: var(--muted); font-size: var(--s-1);
}
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.site-footer a { color: var(--paper); }

/* ---------- simple pages (privacy, 404) ---------- */
.page {
  max-width: 46rem; margin: 0 auto;
  padding: 3rem var(--gutter) 5rem;
}
.page h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; }
.page h2 { font-size: var(--s2); margin-top: 1.8em; }
.page .updated { color: var(--muted); }
.page ul { padding-left: 1.2rem; max-width: var(--measure); }
.page li { margin-bottom: 0.5rem; }

.lost { text-align: left; }
.lost .lantern-solo { width: 90px; height: 120px; margin-bottom: 1.5rem; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; transform: none; }
  .feature-art { max-width: 300px; justify-self: center; }
  .about { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .promises { grid-template-columns: 1fr; gap: 1.5rem; }
  .tags { grid-template-columns: 1fr; }
  .tags li:nth-child(even) { transform: rotate(0.8deg); }
  .beyond-sheet { grid-template-columns: 1fr; }
  .beyond-item + .beyond-item { box-shadow: inset 0 3px 0 var(--dusk); }
  h2, .about h2 { font-size: var(--s3); }
}

@media (max-width: 640px) {
  .lantern-string { height: 190px; }
  .lantern { width: 64px; }
  .lantern-body { width: 54px; height: 62px; }
  .lantern-body::before, .lantern-body::after { width: 30px; margin-left: -15px; }
  .glyph { font-size: 1.6rem; }
  .tag { font-size: 0.7rem; }
  .lantern:nth-child(n+7) { display: none; }
  /* five lanterns: t = 0.1, 0.3, 0.5 */
  .lantern:nth-child(2), .lantern:nth-child(6) { margin-top: 25px; }
  .lantern:nth-child(3), .lantern:nth-child(5) { margin-top: 47px; }
  .lantern:nth-child(4) { margin-top: 54px; }
  .site-nav { gap: 0.25rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lantern { animation: none; }
  .glyph, .button { transition: none; }
}
