/* thothec — renewal mockup
   Palette: Egyptian blue (the first synthetic pigment) + toki pink (the ibis) */
:root {
  --blue: #1E3FA6;
  --blue-2: #2C51BF;
  --lapis: #101C4C;
  --toki: #F2A0B5;
  --toki-deep: #D9435B;
  --alabaster: #F4F5F7;
  --ink: #17203D;
  --mist: #C9D3F2;
  --line: rgba(23, 32, 61, .16);

  --serif: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;

  --step--1: .875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 1.3rem + 2.6vw, 3.25rem);
  --step-4: clamp(3rem, 1rem + 7vw, 7.5rem);
  --papyrus: #E9DFC4;

  --wrap: 72rem;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --ease: cubic-bezier(.22, .9, .25, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.85;
  color: var(--ink);
  background: var(--alabaster);
  font-feature-settings: "palt" 1;
  letter-spacing: .02em;
}
img, svg { display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; }

.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: .5rem 1rem; background: var(--toki); color: var(--ink); border-radius: 999px; }
.skip:focus { top: 1rem; }
:focus-visible { outline: 3px solid var(--toki); outline-offset: 3px; border-radius: 4px; }
.institute :focus-visible, .papyrus :focus-visible { outline-color: var(--blue); }

section[id] { scroll-margin-top: 4.5rem; }
.h2, .h3, .hero-lead, .lead, .definition p, .era-name, .era-text, .name-turn, .layer-title { word-break: auto-phrase; text-wrap: pretty; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }

.h2 {
  font-family: var(--serif);
  font-weight: 800;
  font-size: var(--step-3);
  line-height: 1.35;
  letter-spacing: .04em;
  margin-bottom: 1.5rem;
}
.h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: var(--step-2);
  line-height: 1.4;
  margin: 5rem 0 1.25rem;
}
.lead { font-size: var(--step-1); line-height: 1.8; max-width: 38em; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .85em 1.5em;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
  transition: background-color .2s, color .2s, transform .2s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--toki); color: var(--ink); }
.btn-primary:hover { background: #fff; }
.btn-ghost { color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); }
.btn-ghost:hover { box-shadow: inset 0 0 0 2px #fff; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--blue); }
.btn-line { color: var(--ink); background: transparent; box-shadow: inset 0 0 0 2px var(--ink); }
.btn-line:hover { background: rgba(23,32,61,.08); }
.btn-small { padding: .55em 1.1em; font-size: var(--step--1); background: #fff; color: var(--blue); }
.btn-small:hover { background: var(--toki); color: var(--ink); }
.ext { width: .75em; height: .75em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 2rem;
  padding: .9rem var(--pad);
  color: #fff;
  transition: background-color .3s, box-shadow .3s;
}
.site-header.is-scrolled { background: rgba(16, 28, 76, .92); backdrop-filter: blur(8px); }
.brand, .footer-brand { text-decoration: none; display: inline-flex; align-items: center; gap: .55rem; color: inherit; }
.brand { margin-right: auto; }
.mark { width: 38px; height: 38px; flex: none; }
.footer-brand { color: #fff; justify-self: start; }
.footer-brand .mark { width: 44px; height: 44px; }
.footer-brand .brand-cartouche { font-size: 1.15rem; }

/* back to top */
.to-top {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 65;
  width: 52px; height: 52px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--lapis); color: #fff;
  box-shadow: 0 10px 24px rgba(8,14,40,.4), inset 0 0 0 2px var(--toki);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease), bottom .3s var(--ease), background-color .2s;
}
.to-top svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.to-top.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--blue); }
.ai-eye .to-top { bottom: 5rem; }
.brand-cartouche {
  display: inline-block;
  font-family: var(--serif); font-weight: 800; font-size: 1.05rem; letter-spacing: .08em;
  padding: .15em .9em .25em;
  border: 2px solid currentColor; border-radius: 999px;
  position: relative;
}
.brand-cartouche::after { /* the knot at the end of a cartouche */
  content: ""; position: absolute; right: -9px; top: 18%; bottom: 18%;
  width: 3px; background: currentColor; border-radius: 2px;
}
.site-nav { display: flex; gap: 1.5rem; font-size: var(--step--1); }
.site-nav a { text-decoration: none; opacity: .85; }
.site-nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 6px; }
.menu-btn { display: none; appearance: none; font: inherit; font-size: var(--step--1); font-weight: 700; color: #fff; background: transparent; border: 2px solid rgba(255,255,255,.6); border-radius: 999px; padding: .4em 1em; min-height: 40px; cursor: pointer; }
.btn, .menu-btn { white-space: nowrap; }
.lbl-short { display: none; }
@media (max-width: 420px) {
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  .site-header .brand-cartouche { font-size: .95rem; }
  .site-header .mark { width: 32px; height: 32px; }
  .brand { gap: .4rem; }
}
.menu-btn[aria-expanded="true"] { background: #fff; color: var(--blue); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  background: var(--blue);
  color: #fff;
  display: grid; align-items: center;
  overflow: hidden;
  padding: 7rem 0 6rem;
}
.hero-inner { position: relative; z-index: 2; width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }

.cartouche {
  display: inline-flex; align-items: center;
  gap: 0;
  padding: clamp(.6rem, 2vw, 1.6rem) clamp(1.6rem, 4.5vw, 4rem);
  border: clamp(3px, .5vw, 6px) solid #fff;
  border-radius: 999px;
  position: relative;
  margin-bottom: 2.25rem;
  perspective: 900px;
}
.cartouche::after {
  content: ""; position: absolute; right: calc(-1 * clamp(12px, 2vw, 26px)); top: 15%; bottom: 15%;
  width: clamp(4px, .6vw, 8px); background: #fff; border-radius: 4px;
}
.cartouche.is-done::after { animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.slot {
  position: relative;
  width: calc(var(--step-4) * .5);
  height: calc(var(--step-4) * 1.02);
  transform-style: preserve-3d;
  transition: transform .7s var(--ease);
  cursor: default;
}
.slot.is-letter { transform: rotateY(180deg); }
.slot-face { position: absolute; inset: 0; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.slot-glyph svg { width: auto; height: 62%; overflow: visible; fill: none; stroke: var(--toki); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.slot-glyph path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.is-drawn .slot-glyph path { stroke-dashoffset: 0; transition: stroke-dashoffset 1s var(--ease); transition-delay: var(--d, 0s); }
.slot-letter {
  transform: rotateY(180deg);
  font-family: var(--serif); font-weight: 800;
  font-size: var(--step-4); line-height: 1;
  padding-bottom: .12em;
}

.hero-title {
  font-family: var(--serif); font-weight: 800;
  font-size: clamp(1.8rem, .9rem + 4.2vw, 4.5rem);
  line-height: 1.3; letter-spacing: .04em;
  margin-bottom: 1.5rem;
}
.hero-title .line { display: block; }
.hero-title .line + .line { color: var(--toki); }
.hero-lead { font-size: var(--step-0); line-height: 1.9; max-width: 34em; color: #E6EBFA; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }

.is-loading .hero-title .line, .is-loading .hero-lead, .is-loading .hero-actions { opacity: 0; transform: translateY(14px); }
.hero-title .line, .hero-lead, .hero-actions { transition: opacity .8s var(--ease), transform .8s var(--ease); }
.hero-title .line:nth-child(3) { transition-delay: .14s; }
.hero-lead { transition-delay: .3s; }
.hero-actions { transition-delay: .42s; }

.hero-ibis {
  position: absolute; z-index: 3;
  right: clamp(-2rem, 4vw, 8rem); bottom: 3.2rem;
  width: clamp(150px, 24vw, 340px);
}
.eye-btn {
  position: absolute; left: calc(77.5% - 22px); top: calc(22.3% - 22px);
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: transparent; cursor: pointer; padding: 0;
}
.eye-btn:hover { background: rgba(255,255,255,.14); }
.ai-eye .eye-btn { box-shadow: 0 0 0 3px var(--toki); }
.nile { position: absolute; left: 0; right: 0; bottom: 2.2rem; width: 100%; height: 30px; fill: none; stroke: rgba(255,255,255,.35); stroke-width: 2; }

/* ---------- ibis ---------- */
.ibis { width: 100%; height: auto; overflow: visible; }
.ibis .ib-body, .ibis .ib-neck, .ibis .ib-headball { fill: #fff; }
.ibis .ib-neck { fill: none; stroke: #fff; stroke-width: 13; stroke-linecap: round; }
.ibis .ib-wing { fill: var(--toki); }
.ibis .ib-tail { fill: var(--toki); }
.ibis .ib-face { fill: var(--toki-deep); }
.ibis .ib-beak { fill: var(--ink); }
.ibis .ib-crest { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; }
.ibis .ib-eye { fill: var(--ink); }
.ibis .ib-glint { fill: #fff; }
.ibis .ib-leg { fill: none; stroke: var(--toki-deep); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.ibis .ib-head { transform-origin: 132px 112px; transition: transform .35s var(--ease); }
.ibis .ib-leg-a { transform-origin: 100px 158px; }
.ibis .ib-leg-b { transform-origin: 112px 158px; }
.ibis .ib-torso { transform-origin: 100px 158px; }
.ibis .ib-pupil { transition: transform .12s linear; }

.walking .ib-leg-a { animation: stepA .5s ease-in-out infinite; }
.walking .ib-leg-b { animation: stepB .5s ease-in-out infinite; }
.walking .ib-torso { animation: bob .25s ease-in-out infinite alternate; }
@keyframes stepA { 0%,100% { transform: rotate(-18deg); } 50% { transform: rotate(16deg); } }
@keyframes stepB { 0%,100% { transform: rotate(16deg); } 50% { transform: rotate(-18deg); } }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-3px); } }
.pecking .ib-head { animation: peck .9s var(--ease) infinite; }
@keyframes peck { 0%, 100% { transform: rotate(0); } 35% { transform: rotate(28deg); } 50% { transform: rotate(22deg); } 65% { transform: rotate(28deg); } }
.looking .ib-head { animation: look 3.2s ease-in-out infinite; }
@keyframes look { 0%,100% { transform: rotate(0); } 30% { transform: rotate(-10deg); } 60% { transform: rotate(8deg); } }

/* ---------- name ---------- */
.name { background: var(--blue); padding: clamp(3rem, 8vw, 6rem) 0 clamp(5rem, 10vw, 8rem); }
.name-sheet { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; padding: clamp(2rem, 5vw, 4.5rem); }
.name-glyph { background: var(--blue); border-radius: 50% 50% 50% 50% / 42% 42% 58% 58%; aspect-ratio: 3 / 4; display: grid; place-items: center; max-width: 300px; width: 100%; justify-self: center; }
.name-glyph svg { width: 58%; fill: none; stroke: var(--toki); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.name-text p { max-width: 34em; }
.name-turn { font-family: var(--serif); font-weight: 700; font-size: var(--step-1); margin: 2rem 0 0; padding-top: 1.5rem; border-top: 1px solid rgba(23,32,61,.25); }

/* ---------- papyrus: only on surfaces that carry writing ---------- */
.sheet { position: relative; color: var(--ink); border-radius: 3px; box-shadow: 0 18px 40px rgba(8, 14, 40, .35); }
.papyrus {
  background-color: var(--papyrus);
  background-image:
    /* top layer: horizontal strips of pith, uneven widths */
    repeating-linear-gradient(0deg, rgba(122, 96, 44, .07) 0 1px, transparent 1px 5px, rgba(122, 96, 44, .10) 5px 6px, transparent 6px 13px, rgba(255, 255, 255, .20) 13px 14px, transparent 14px 23px, rgba(122, 96, 44, .05) 23px 25px, transparent 25px 37px),
    /* bottom layer: wide vertical strips showing through faintly */
    repeating-linear-gradient(90deg, rgba(122, 96, 44, .045) 0 2px, transparent 2px 53px, rgba(122, 96, 44, .03) 53px 55px, transparent 55px 97px),
    linear-gradient(90deg, rgba(255,255,255,.10), rgba(122,96,44,.05) 23%, rgba(255,255,255,.06) 41%, rgba(122,96,44,.06) 67%, rgba(255,255,255,.08) 88%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .36 0 0 0 0 .18 0 0 0 .3 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.papyrus::before { /* soft darkened rim, like an old sheet */
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 40px rgba(122, 96, 44, .22);
}
.papyrus-faint {
  background-color: #F1EBDA;
  background-image:
    repeating-linear-gradient(0deg, rgba(122, 96, 44, .035) 0 1px, transparent 1px 7px, rgba(122, 96, 44, .025) 7px 9px, transparent 9px 19px);
}
.papyrus-faint::before { box-shadow: inset 0 0 30px rgba(122, 96, 44, .1); }

/* ---------- chronicle ---------- */
.chronicle { position: relative; height: 320vh; background: var(--lapis); color: #fff; }
.chronicle-sticky { position: sticky; top: 0; height: 100svh; overflow: hidden; display: flex; flex-direction: column; }
.chronicle-head { padding: 6rem var(--pad) 0; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; max-width: calc(var(--wrap) + 20rem); width: 100%; margin: 0 auto; }
.chronicle-head .h2 { margin: 0; }
.chronicle-hint { font-size: var(--step--1); color: var(--mist); margin: 0; }
.track {
  list-style: none; margin: 0; padding: 0 var(--pad);
  display: flex; gap: clamp(2rem, 6vw, 6rem);
  flex: 1; align-items: center;
  will-change: transform;
}
.era { flex: 0 0 clamp(260px, 34vw, 420px); position: relative; padding-top: 1rem; }
.era-year { font-family: var(--serif); font-weight: 700; color: var(--toki); font-size: var(--step-1); margin-bottom: .25rem; }
.era-name { font-family: var(--serif); font-weight: 800; font-size: var(--step-3); line-height: 1.25; margin-bottom: 1rem; }
.era-text { color: var(--mist); max-width: 22em; }
.era-glyph { width: 56px; height: 75px; fill: none; stroke: rgba(255,255,255,.5); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; margin-top: 1.25rem; }
.era-now { flex-basis: clamp(280px, 40vw, 520px); }
.era-now .era-name { color: var(--toki); }
.era-now .era-text { color: #fff; }
.era-now .btn { margin-top: .5rem; }
.ground { position: relative; height: 110px; border-top: 2px solid rgba(255,255,255,.25); margin-bottom: 0; flex: none; }
.ground-ibis { position: absolute; bottom: calc(100% - 4px); left: 0; width: 150px; will-change: transform; }

/* ---------- institute ---------- */
.institute { padding: clamp(5rem, 12vw, 9rem) 0; }
.definition { margin: 3rem 0 4rem; padding: 2rem 0 2rem 2rem; border-left: 4px solid var(--blue); }
.definition p { font-family: var(--serif); font-weight: 700; font-size: var(--step-2); line-height: 1.6; margin: 0 0 .75rem; }
.definition cite { font-style: normal; font-size: var(--step--1); color: rgba(23,32,61,.7); }

.layers { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.pyramid { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.block {
  appearance: none; border: 0; cursor: pointer;
  font: inherit; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: clamp(84px, 10vw, 112px);
  clip-path: polygon(9% 0, 91% 0, 100% 100%, 0 100%);
  background: var(--blue);
  transition: background-color .25s, transform .35s var(--ease), filter .25s;
  line-height: 1.3;
}
.block-3 .block-name { font-size: var(--step-0); }
.block-3 { width: 50%; background: var(--toki); color: var(--ink); clip-path: polygon(50% 0, 50% 0, 100% 100%, 0 100%); height: clamp(110px, 12vw, 140px); padding-top: 2.6rem; }
.block-2 { width: 73%; background: var(--blue-2); }
.block-1 { width: 100%; background: var(--blue); }
.block-no { font-size: var(--step--1); opacity: .85; }
.block-name { font-family: var(--serif); font-weight: 800; font-size: var(--step-1); letter-spacing: .06em; }
.block:hover { filter: brightness(1.08); }
.block[aria-selected="true"] { background: var(--lapis); color: #fff; }
.block-3[aria-selected="true"] { background: var(--toki-deep); }
.block:focus-visible { outline: none; filter: brightness(1.15); text-decoration: underline; text-underline-offset: 4px; }
.pyramid-note { font-size: var(--step--1); color: rgba(23,32,61,.7); margin-top: 1rem; text-align: center; }

.pyramid.is-pending .block { transform: translateY(-60px); opacity: 0; }
.pyramid.is-built .block { transform: none; opacity: 1; transition: transform .7s cubic-bezier(.3,1.5,.5,1), opacity .3s, background-color .25s, filter .25s; }
.pyramid.is-built .block-2 { transition-delay: .18s; }
.pyramid.is-built .block-3 { transition-delay: .36s; }

.layer-panel { animation: panelIn .45s var(--ease); }
@keyframes panelIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.layer-no { color: var(--blue); font-weight: 700; margin-bottom: .25rem; }
.ai-note { display: none; margin-top: 1.25rem; padding: .9rem 1.1rem; background: var(--lapis); color: #fff; border-radius: 4px; font-size: var(--step--1); position: relative; }
.ai-note::before { content: ""; display: inline-block; width: .6em; height: .6em; border-radius: 50%; background: var(--toki); margin-right: .6em; vertical-align: .05em; }
.ai-eye .ai-note { display: block; animation: panelIn .45s var(--ease); }
.layers { position: relative; }
.ai-eye .layers::before {
  content: ""; position: absolute; inset: -1.5rem; pointer-events: none; border-radius: 6px;
  background-image: linear-gradient(rgba(30,63,166,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(30,63,166,.07) 1px, transparent 1px);
  background-size: 24px 24px;
}
.pyramid { position: relative; }
.ai-eye .pyramid::after {
  content: ""; position: absolute; left: 0; right: 0; top: -1.5rem; height: 2px; pointer-events: none; opacity: .7;
  background: linear-gradient(90deg, transparent, var(--toki-deep), transparent);
  animation: scan 3.2s linear infinite;
}
@keyframes scan { from { top: 0; } to { top: 100%; } }
.layer-title { font-family: var(--serif); font-weight: 800; font-size: var(--step-2); line-height: 1.4; margin-bottom: 1rem; }

.links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.links li { border-bottom: 1px solid var(--line); }
.links a {
  display: grid; grid-template-columns: 14rem 1fr auto; gap: 1.5rem; align-items: baseline;
  padding: 1.25rem .5rem; text-decoration: none;
  transition: background-color .2s, padding .3s var(--ease);
}
.links a:hover { background: #fff; padding-left: 1.25rem; }
.links-name { font-family: var(--serif); font-weight: 700; font-size: var(--step-1); }
.links-desc { color: rgba(23,32,61,.78); }
.links .ext { width: .9rem; height: .9rem; color: var(--blue); align-self: center; }

/* ---------- door ---------- */
.door-section { background: var(--lapis); color: #fff; padding: clamp(5rem, 12vw, 8rem) 0; overflow: hidden; }
.door-wrap { text-align: center; }
.door-stage { position: relative; display: inline-block; margin-top: 1.5rem; }
.door {
  position: relative; display: grid; place-items: end center;
  width: min(78vw, 340px); aspect-ratio: 3 / 4;
  text-decoration: none; color: var(--ink);
  border: 10px solid #fff; border-top-width: 26px;
  background: var(--lapis);
  perspective: 900px;
  overflow: hidden;
}
.door::before { /* cornice */
  content: ""; position: absolute; left: -10px; right: -10px; top: -26px; height: 10px; background: var(--toki);
}
.door-light { position: absolute; inset: 0; background: radial-gradient(circle at 50% 70%, #fff 0, var(--toki) 45%, var(--lapis) 100%); opacity: 0; transition: opacity .6s var(--ease); }
.door-leaf {
  position: absolute; inset: 0; background: var(--blue);
  transform-origin: left center;
  transition: transform .8s var(--ease);
  box-shadow: inset -10px 0 0 rgba(0,0,0,.12);
}
.door-leaf::after { content: ""; position: absolute; right: 16%; top: 52%; width: 10px; height: 10px; border-radius: 50%; background: var(--toki); }
.door-label {
  position: relative; z-index: 2; margin-bottom: 1.5rem;
  background: #fff; color: var(--ink);
  padding: .7em 1.3em; border-radius: 999px; font-weight: 700;
}
.door:hover .door-leaf, .door:focus-visible .door-leaf, .door.is-open .door-leaf { transform: rotateY(-72deg); }
.door:hover .door-light, .door:focus-visible .door-light, .door.is-open .door-light { opacity: 1; }
.door-stage::after { content: ""; position: absolute; left: -40vw; right: -40vw; bottom: -2px; height: 2px; background: rgba(255,255,255,.35); }
.door-ibis { position: absolute; left: calc(100% - 20px); bottom: -4px; width: clamp(110px, 18vw, 170px); }

/* ---------- company ---------- */
.company { background: var(--blue); color: #fff; padding: clamp(5rem, 12vw, 8rem) 0; }
.company .sheet { padding: .5rem clamp(1.25rem, 3vw, 2.5rem); }
.company-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 3rem; }
.facts { margin: 0; position: relative; }
.facts div { display: grid; grid-template-columns: 8rem 1fr; gap: 1.5rem; padding: 1.25rem 0; border-bottom: 1px solid rgba(23,32,61,.18); }
.facts div:last-child { border-bottom: 0; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; }
.text-link { color: var(--blue); text-underline-offset: 4px; font-weight: 500; }
.text-link:hover { color: var(--ink); }

/* ---------- footer ---------- */
.site-footer { background: var(--lapis); color: var(--mist); padding: 3rem 0; font-size: var(--step--1); }
.footer-grid { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem 2.5rem; align-items: center; }

.footer-egg { margin: 0; }
.footer-nav { display: flex; gap: 1.5rem; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 5px; }
.copy { grid-column: 1 / -1; margin: 1rem 0 0; opacity: .7; }

/* ---------- easter egg ---------- */
.egg-layer { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.egg-ibis { position: absolute; bottom: 24px; left: -160px; width: 140px; animation: dash 3.6s linear forwards; }
@keyframes dash { to { transform: translateX(calc(100vw + 320px)); } }
.egg-print { position: absolute; bottom: 20px; width: 34px; height: 46px; fill: none; stroke: var(--toki-deep); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; animation: printFade 2.6s ease-out forwards; }
@keyframes printFade { 0% { opacity: 0; transform: translateY(6px) scale(.6); } 15% { opacity: 1; transform: none; } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-40px); } }

/* ---------- check (quiz) ---------- */
.check { background: var(--blue); color: #fff; padding: clamp(5rem, 12vw, 8rem) 0; }
.check-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.check-intro > p { color: #E6EBFA; }
.check-intro .h2 { font-size: clamp(1.9rem, 1.1rem + 2vw, 2.75rem); }
.nw { white-space: nowrap; }
.check-quote { margin: 0 0 2rem; padding-left: 1.25rem; border-left: 3px solid var(--toki); }
.check-quote blockquote { margin: 0; }
.check-quote p { font-family: var(--serif); font-weight: 700; font-size: var(--step-1); line-height: 1.6; margin: 0 0 .5rem; }
.check-quote figcaption { font-size: var(--step--1); color: var(--mist); }
.quiz { padding: clamp(1.75rem, 4vw, 3rem); min-height: 27rem; display: flex; flex-direction: column; }
.quiz-progress { list-style: none; margin: 0 0 1.75rem; padding: 0; display: flex; gap: 6px; position: relative; }
.quiz-progress li { flex: 1; height: 6px; border-radius: 3px; background: rgba(23,32,61,.15); overflow: hidden; position: relative; }
.quiz-progress li::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.quiz-progress li.is-done::after { transform: scaleX(1); }
.quiz-body, .quiz-result { position: relative; }
.q-layer { color: var(--blue); font-weight: 700; margin-bottom: .5rem; }
.q-text { font-family: var(--serif); font-weight: 800; font-size: var(--step-1); line-height: 1.6; margin-bottom: 1.25rem; outline: none; }
.q-opts { display: grid; gap: .6rem; }
.q-opt {
  appearance: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: .9rem;
  padding: .85rem 1rem; border-radius: 4px;
  background: rgba(255, 255, 255, .35); border: 1px solid rgba(23,32,61,.22);
  transition: background-color .2s, border-color .2s;
  position: relative;
}
.q-opt:hover:not(:disabled) { background: rgba(255,255,255,.65); border-color: var(--ink); }
.q-opt:disabled { cursor: default; }
.q-mark { flex: none; width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid var(--ink); position: relative; transition: background-color .25s, border-color .25s; }
.q-label { position: relative; }
.q-label::after { /* the strike-through drawn on a wrong pick */
  content: ""; position: absolute; left: -2px; right: -2px; top: 55%; height: 2px; background: var(--toki-deep);
  transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease);
}
.q-opt.is-wrong .q-label::after { transform: scaleX(1); }
.q-opt.is-wrong .q-mark { border-color: var(--toki-deep); }
.q-opt.is-correct { border-color: var(--ink); background: rgba(255,255,255,.7); font-weight: 700; }
.q-opt.is-correct .q-mark { background: var(--ink); }
.q-opt.is-correct .q-mark::after { content: ""; position: absolute; left: 32%; top: 14%; width: 30%; height: 55%; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.q-opt.is-dim { opacity: .55; }
.q-why { margin-top: 1.25rem; }
.q-why:empty { display: none; }
.q-why strong { display: block; font-family: var(--serif); font-size: var(--step-1); margin-bottom: .25rem; }
.q-why p { margin: 0; }
.q-next { margin-top: 1.5rem; }
.quiz-result { margin: auto 0; outline: none; }
.score { font-family: var(--serif); font-weight: 800; font-size: clamp(3.5rem, 8vw, 5rem); line-height: 1; margin-bottom: 1rem; }
.score small { font-size: .4em; }
.result-msg { font-family: var(--serif); font-weight: 700; font-size: var(--step-1); line-height: 1.6; }
.result-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* ---------- AI eye pill ---------- */
.eye-pill {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 70;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: center;
  max-width: calc(100vw - 2rem);
  background: var(--lapis); color: #fff; padding: .7rem 1rem .7rem 1.25rem; border-radius: 999px;
  box-shadow: 0 12px 30px rgba(8,14,40,.45), inset 0 0 0 2px var(--toki);
  font-size: var(--step--1);
}
.eye-pill[hidden] { display: none; }
.eye-pill a { color: var(--toki); font-weight: 700; }
.eye-pill button { appearance: none; border: 0; font: inherit; font-weight: 700; cursor: pointer; background: #fff; color: var(--ink); border-radius: 999px; padding: .35em .9em; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .menu-btn { display: inline-block; }
  .site-nav { display: none; }
  .site-nav.is-open {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--lapis); padding: .5rem var(--pad) 1rem;
    box-shadow: 0 12px 24px rgba(8,14,40,.35);
  }
  .site-nav.is-open a { font-size: var(--step-0); padding: .85rem 0; border-bottom: 1px solid rgba(255,255,255,.12); opacity: 1; }
  .site-header { gap: .75rem; }
  .name-sheet, .layers, .company-grid, .check-grid { grid-template-columns: 1fr; }
  .name-glyph { max-width: 150px; }
  .eye-pill { border-radius: 16px; left: 1rem; right: 5rem; transform: none; }
  .ai-eye .to-top { bottom: 1rem; }
  .block-3 { width: 62%; }
  .links a { grid-template-columns: 1fr auto; gap: .25rem 1rem; }
  .links-desc { grid-column: 1; grid-row: 2; }
  .links .ext { grid-row: 1 / 3; grid-column: 2; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-ibis { right: .5rem; bottom: 2.8rem; width: 130px; }
  .hero-lead { font-size: var(--step-0); }
  .hero { align-items: start; padding-top: 8rem; }
  .door { width: min(60vw, 300px); }
  .door-ibis { left: calc(100% - 24px); width: 96px; }
  .chronicle { height: 360vh; }
  .ground { height: 96px; }
  .ground-ibis { width: 90px; }
  .chronicle-head { padding-top: 5rem; }
}
@media (max-width: 520px) {
  .facts div { grid-template-columns: 1fr; gap: .25rem; }
  .definition { padding-left: 1.25rem; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero { padding-bottom: 4rem; }
  .hero-ibis { position: relative; right: auto; bottom: auto; justify-self: end; margin: 1.25rem var(--pad) 0 0; width: 110px; }
  .btn-small { padding: .5em .9em; }
  .door-label { white-space: nowrap; font-size: var(--step--1); padding: .6em 1em; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .chronicle { height: auto; }
  .chronicle-sticky { position: static; height: auto; }
  .chronicle-hint { display: none; }
  .track { flex-direction: column; align-items: stretch; transform: none !important; padding-top: 3rem; padding-bottom: 3rem; }
  .era { flex-basis: auto; }
  .ground { display: none; }
  .pyramid.is-pending .block { transform: none; opacity: 1; }
}
