/* Myrikos homepage — "The moon in the window" scrolling story (desktop first; the phone layout comes later). */
/* One look on purpose: the story is a night, so the page stays dark in either theme. */
:root {
  color-scheme: dark;
  --bg: #070b12;
  --ink: #eef0f3;
  --muted: #9aa5b3;
  --line: rgba(255, 255, 255, .12);
  --accent: #f2a98e;
  --caption: #f6f1e7;
  --serif: Fraunces, "Noto Serif SC", Georgia, "Times New Roman", serif;   /* Noto Serif SC carries only 月 */
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: auto; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.frame { width: min(1180px, 100% - 48px); margin: 0 auto; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Header (from the existing Myrikos draft, plus the motion switch) */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 40; padding-top: env(safe-area-inset-top, 0px);
  background: linear-gradient(180deg, rgba(7, 11, 18, .8) 0%, rgba(7, 11, 18, 0) 100%);
  pointer-events: none; transition: opacity .6s ease;
}
/* while the story plays the header steps back; pointing at it or tabbing into it brings it forward */
.in-story .site-header { opacity: .35; }
.in-story .site-header:hover, .in-story .site-header:focus-within { opacity: 1; }
.site-header .frame { padding: 24px 0 34px; display: flex; justify-content: space-between; align-items: center; }
.site-header a, .site-header button { pointer-events: auto; }
html:not(.motion) .site-header, .after-story .site-header { background: rgba(7, 11, 18, .92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
html:not(.motion) .site-header .frame, .after-story .site-header .frame { padding-bottom: 22px; }
.wordmark { font-family: var(--serif); font-weight: 300; font-size: 1.5rem; letter-spacing: .01em; line-height: 1; }
.wordmark span, .opening-mark span { color: var(--accent); }
nav { display: flex; align-items: center; gap: 26px; }
nav a { color: var(--muted); font-size: .92rem; transition: color .15s; }
nav a:hover { color: var(--ink); }
.mt {
  font: 500 .8rem/1 var(--sans); color: var(--muted); background: rgba(7, 11, 18, .35);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.mt:hover { color: var(--ink); border-color: rgba(255, 255, 255, .28); }
.mt[aria-pressed="false"] .mt-on, .mt[aria-pressed="true"] .mt-off { display: none; }
.no-js .mt { display: none; }

/* ---------------------------------------------------------------- the story, with motion */
.story { display: none; }
.motion .story { display: block; position: relative; height: 3400vh; /* set exactly by engine.js */ }
.motion .read { display: none; }

.stage {
  position: sticky; top: env(safe-area-inset-top, 0px); height: 100vh; height: 100lvh; overflow: hidden;
  background: var(--bg); contain: strict;
}
.scene { position: absolute; inset: 0; overflow: hidden; }
.set {
  position: absolute; left: 0; top: 0; width: 3840px; height: 2160px;
  transform-origin: 0 0; will-change: transform, opacity; visibility: hidden;
}
.set > .lay {
  position: absolute; left: 0; top: 0; width: 3840px; height: 2160px;
  display: block; user-select: none; -webkit-user-drag: none; pointer-events: none;
}
.set > svg.lay { overflow: visible; }
.paper { mix-blend-mode: multiply; }
.gly path { fill: #403c38; }
/* figures are added to each other, so a change of pose never lets the room show through where they overlap */
.set > .figs { isolation: isolate; }
.fig { position: absolute; left: 0; top: 0; width: 3840px; height: 2160px; mix-blend-mode: plus-lighter; }
.fig > img { position: absolute; left: 0; top: 0; width: 3840px; height: 2160px; display: block; user-select: none; -webkit-user-drag: none; }
.gly-over path { fill: none !important; stroke: #f6ecd2; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.dim { background: #04060c; }

.shade {
  position: absolute; inset: auto 0 0 0; height: 36vh; pointer-events: none; z-index: 30;
  background: linear-gradient(0deg, rgba(4, 7, 14, .72) 0%, rgba(4, 7, 14, .38) 46%, rgba(4, 7, 14, 0) 100%);
}
.captions { position: absolute; inset: 0; pointer-events: none; z-index: 31; }
.cap {
  --a: 0;
  position: absolute; left: 50%; bottom: 9.5vh; margin: 0;
  width: min(900px, 100% - 64px); text-align: center; text-wrap: balance;
  transform: translate(-50%, calc((1 - var(--a)) * 10px));
  opacity: var(--a); visibility: hidden;
  color: var(--caption); font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.25rem, 1.8vw, 1.95rem); line-height: 1.34; letter-spacing: 0;
  text-shadow: 0 1px 18px rgba(0, 0, 0, .6), 0 0 2px rgba(0, 0, 0, .35);
}
.cap.girl { font-style: italic; }

.opening, .closing {
  position: absolute; inset: 0; z-index: 32; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; pointer-events: none;
}
.opening { justify-content: flex-end; padding-bottom: 10vh; }
.opening-mark {
  margin: 0; font-family: var(--serif); font-weight: 300;
  font-size: clamp(3rem, 7vw, 6.4rem); letter-spacing: -.02em; line-height: 1;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .55);
}
.opening-tag {
  margin: 14px 0 0; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(1.1rem, 1.5vw, 1.4rem);
  color: #e3e6ea; text-shadow: 0 1px 16px rgba(0, 0, 0, .6);
}
/* the only invitation to scroll: a hairline that draws itself downward */
.scroll-cue { display: block; width: 1px; height: 44px; margin-top: 26px; background: linear-gradient(180deg, rgba(246, 241, 231, .7), rgba(246, 241, 231, 0)); transform-origin: top; }
@media (prefers-reduced-motion: no-preference) {
  .scroll-cue { animation: cue 2.4s ease-in-out infinite; }
  @keyframes cue { 0% { transform: scaleY(0); opacity: 0; } 30% { opacity: 1; } 70% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
}
.closing { gap: 22px; visibility: hidden; }
.tagline {
  margin: 0; font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.2rem, 4.6vw, 4.4rem); line-height: 1.08; letter-spacing: -.02em;
  text-shadow: 0 2px 34px rgba(0, 0, 0, .6);
}
.closing-sub {
  margin: 0; font-family: var(--serif); font-weight: 300; font-size: clamp(1.3rem, 2vw, 1.9rem); color: #d9dde3;
  text-shadow: 0 1px 18px rgba(0, 0, 0, .6);
}
/* until the opening pictures are decoded: a 64 x 36 copy of the opening frame, blurred */
.loading {
  position: absolute; inset: 0; z-index: 35; overflow: hidden; background: var(--bg);
  transition: opacity .7s ease, visibility 0s linear .7s;
}
.loading .ph { position: absolute; inset: -4%; width: 108%; height: 108%; max-width: none; object-fit: cover; filter: blur(18px); }
.loading.done { opacity: 0; visibility: hidden; }

/* ---------------------------------------------------------------- the same story, without motion */
.read { padding: 120px 0 24px; }
.read-head { margin-bottom: 48px; }
.read-tag { margin: 0 0 6px; color: var(--muted); font-size: .95rem; }
.read-head h2 { margin: 0; font-family: var(--serif); font-weight: 300; font-size: clamp(2.2rem, 4vw, 3.4rem); line-height: 1.1; letter-spacing: -.015em; }
.read-body { display: grid; gap: 56px; }
.rf { margin: 0; display: grid; gap: 18px; }
.rf .pics { display: grid; gap: 12px; }
.rf.two .pics { grid-template-columns: 1fr 1fr; }
.rf .pic { display: grid; border-radius: 6px; overflow: hidden; background: #0b1020; aspect-ratio: 16 / 10; }
.rf .pic img { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: cover; display: block; }
.rf figcaption { display: grid; gap: 6px; max-width: 46rem; }
.rf .line { margin: 0; font-family: var(--serif); font-weight: 300; font-size: 1.35rem; line-height: 1.4; color: var(--caption); }
.rf .line.girl { font-style: italic; }

.read-end { margin-top: 88px; font-family: var(--serif); font-weight: 300; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.1; letter-spacing: -.02em; text-align: center; }
.read-sub { margin-top: 20px; font-family: var(--serif); font-weight: 300; font-size: clamp(1.2rem, 1.8vw, 1.6rem); color: #c3cad4; text-align: center; }

/* ---------------------------------------------------------------- after the story */
.products { padding: 14vh 0 96px; }
.products h2 { font-family: var(--sans); font-weight: 500; font-size: .95rem; color: var(--muted); margin: 0 0 10px; }
/* one list, two equal rows: the picture in a panel on the left, the words beside it */
.works { list-style: none; margin: 0; padding: 0; }
.works li { border-top: 1px solid var(--line); padding: 28px 0; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px 44px; align-items: center; }
.prod-fig { height: 220px; display: grid; place-items: center; background: rgba(255, 255, 255, .025); border-radius: 4px; }
.prod-img { display: block; }
.prod-img.poster { height: 186px; width: auto; border-radius: 2px; box-shadow: 0 14px 36px rgba(0, 0, 0, .45); }
.prod-img.icon { width: 92px; height: 92px; border-radius: 22.5%; box-shadow: 0 10px 28px rgba(0, 0, 0, .45); }
.products h3 { margin: 0 0 6px; font-family: var(--serif); font-weight: 300; font-size: 1.9rem; letter-spacing: -.01em; line-height: 1.15; }
.products .status { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 14px; }
/* the product name is the link to its own site */
.products h3 a { color: inherit; text-decoration: none; }
.products h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.products p { margin: 0; color: #c3cad4; max-width: 46ch; }

footer {
  border-top: 1px solid var(--line); padding: 24px 0 40px; display: flex; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .86rem;
}
footer a:hover { color: var(--ink); }
/* narrow windows: the story keeps its desktop staging for now; the sections around it stack */
@media (max-width: 720px) {
  .site-header .frame { padding: 16px 0 24px; }
  nav { gap: 14px; }
  .wordmark { font-size: 1.3rem; }
  .rf.two .pics, .works li { grid-template-columns: 1fr; }
  .prod-fig { height: 260px; }
  .prod-img.poster { height: 220px; }
}

a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
.mt:focus-visible { border-radius: 999px; }
