/* Koiyo landing — tokens follow art/00-style-bible (palette day/night). */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/assets/fonts/manrope-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/assets/fonts/manrope-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Literata";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("/assets/fonts/literata-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Literata";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("/assets/fonts/literata-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --milk: #F6F1E7;
  --paper: #EEE6D6;
  --ink: #1F2A28;
  --jade: #5F9E8E;
  --jade-deep: #3F7366;
  --jade-hi: #9CC9BA;
  --coral: #E0897A;
  --coral-deep: #C9675B;

  --bg: var(--milk);
  --bg-alt: var(--paper);
  --surface: #FBF8F2;
  --text: var(--ink);
  --muted: #55615D;
  --line: rgba(31, 42, 40, 0.13);
  --panel: rgba(246, 241, 231, 0.88);
  --accent: var(--coral-deep);
  --focus: #B4523F;
  --btn-bg: var(--ink);
  --btn-fg: var(--milk);
  --water: var(--jade);

  --serif: "Literata", "Iowan Old Style", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

:root[data-mode="night"] {
  --bg: #141B3D;
  --bg-alt: #182051;
  --surface: #1A2248;
  --text: #E6E9F2;
  --muted: #B3BBD3;
  --line: rgba(230, 233, 242, 0.15);
  --panel: rgba(20, 27, 61, 0.82);
  --accent: #4FD8E0;
  --focus: #7FE9EE;
  --btn-bg: #E6E9F2;
  --btn-fg: #141B3D;
  --water: #141B3D;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
  overflow-x: hidden;
  transition: background-color 0.6s ease, color 0.6s ease;
  -webkit-font-smoothing: antialiased;
}

img, svg, canvas { display: block; }

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 1.25rem + 3.4vw, 3.6rem);
  line-height: 1.07;
  margin: 0.3em 0 0.35em;
}

h2 {
  font-size: clamp(1.8rem, 1.25rem + 2.2vw, 2.8rem);
  line-height: 1.12;
  margin: 0.25em 0 0.55em;
}

h3 {
  font-size: 1.2rem;
  line-height: 1.3;
  margin: 18px 0 8px;
}

p { margin: 0 0 1em; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 10;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 16px; }

.icon { width: 20px; height: 20px; flex: none; }

/* ---------- top bar ---------- */

.no-js .js-only { display: none !important; }

.topbar {
  position: absolute;
  z-index: 5;
  top: 0; left: 0; right: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

.controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-left: auto; }

#mode-toggle[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-fg); border-color: transparent; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font: 650 0.95rem/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background-color 0.6s ease, color 0.6s ease, transform 0.2s ease;
}
.pill:hover { transform: translateY(-1px); }

.brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  padding-left: 10px;
}
.brand-mark { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* Over the pond the background is busy water, so use a two-tone ring that reads on any colour. */
.topbar :focus-visible, .skip:focus-visible, .hero-panel :focus-visible {
  outline: 3px solid #1F2A28;
  outline-offset: 3px;
  box-shadow: 0 0 0 3px #F6F1E7, 0 0 0 9px #F6F1E7;
}
:root[data-mode="night"] .topbar :focus-visible,
:root[data-mode="night"] .skip:focus-visible,
:root[data-mode="night"] .hero-panel :focus-visible {
  outline-color: #7FE9EE;
  box-shadow: 0 0 0 3px #141B3D, 0 0 0 9px #141B3D;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 600px;
  min-height: max(600px, 100svh);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(84px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow: hidden;
  background: var(--water);
  transition: background-color 0.6s ease;
}

.pond {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
  cursor: pointer;
}

.hero-panel {
  position: relative;
  z-index: 2;
  max-width: 620px;
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: background-color 0.6s ease;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.status-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}

.lead { font-size: 1.05rem; margin-bottom: 18px; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 14px;
}

.hint { font-size: 0.92rem; color: var(--muted); }

.caption {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}

@media (min-width: 768px) {
  .topbar {
    padding: 24px 32px;
    padding-top: max(24px, env(safe-area-inset-top));
    padding-left: max(32px, env(safe-area-inset-left));
    padding-right: max(32px, env(safe-area-inset-right));
  }
  .hero {
    padding: calc(96px + env(safe-area-inset-top)) max(32px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(32px, env(safe-area-inset-left));
  }
  .hero-panel { padding: 34px 36px 24px; }
  .lead { font-size: 1.12rem; }
}

@media (max-width: 380px) {
  .hero { padding-top: calc(136px + env(safe-area-inset-top)); }
}

.btn-small { min-height: 44px; padding: 0 16px; font-size: 0.95rem; }
.icon-play { display: none; }
#motion-btn[aria-pressed="true"] .icon-play { display: block; }
#motion-btn[aria-pressed="true"] .icon-pause { display: none; }

.night-status:empty { display: none; }
.night-status { margin-top: 14px; }

@media (max-height: 700px) and (max-width: 767px) {
  .caption { display: none; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 700 1rem/1 var(--sans);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.6s ease, color 0.6s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: currentColor;
}

/* ---------- sections ---------- */

.section { padding: clamp(72px, 10vw, 136px) 0; }

.wrap {
  width: min(1120px, 100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right));
  margin-inline: auto;
}

@media (min-width: 768px) {
  .wrap { width: min(1120px, 100% - 64px - env(safe-area-inset-left) - env(safe-area-inset-right)); }
}

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 44px; align-items: center; }

h1, h2, h3, .eyebrow, .status, .portrait-label { overflow-wrap: break-word; hyphens: auto; }

@media (min-width: 920px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 72px; }
  .grid-2.reverse > .copy { order: 2; }
}

.copy > p:not(.eyebrow) { max-width: 34em; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: "";
  flex: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5.5px color-mix(in srgb, var(--accent) 45%, transparent);
}

.note { font-size: 0.95rem; color: var(--muted); }

.meet { background: var(--bg-alt); transition: background-color 0.6s ease; }

/* ---------- portraits ---------- */

.family-figure {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 14px;
}

.parents {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: min(100%, 440px);
}

.cross {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--muted);
  padding-bottom: 28px;
}

.branch { width: min(76%, 360px); height: 34px; color: var(--muted); opacity: 0.6; }

.fry {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 560px;
  transition: opacity 0.35s ease;
}
.fry.is-fading { opacity: 0; }

.portrait { margin: 0; display: grid; gap: 8px; justify-items: center; min-width: 0; }

.portrait canvas {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 20px;
  background: var(--water);
  transition: background-color 0.6s ease;
}

.portrait-label {
  margin: 0;
  min-height: 2.6em;
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  color: var(--muted);
}

#breed-btn { margin-top: 6px; }

/* ---------- phones ---------- */

.phones canvas {
  width: 100%;
  aspect-ratio: 1.08;
  max-width: 560px;
  margin-inline: auto;
  touch-action: manipulation;
  cursor: pointer;
}

/* ---------- calm ---------- */

.calm-list {
  list-style: none;
  margin: 44px 0 0;
  padding: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 640px) { .calm-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .calm-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.calm-item {
  padding: 26px 24px 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  transition: background-color 0.6s ease;
}
.calm-item p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.calm-icon { width: 44px; height: 44px; color: var(--accent); }

/* ---------- night band (always night) ---------- */

.night-band {
  --bg: #141B3D;
  --text: #E6E9F2;
  --muted: #B3BBD3;
  --line: rgba(230, 233, 242, 0.15);
  --accent: #4FD8E0;
  --focus: #7FE9EE;
  background: #141B3D;
  color: #E6E9F2;
}
:root[data-mode="night"] .night-band { background: #0F1530; --bg: #0F1530; }

.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 560px;
  justify-self: center;
}
.pair canvas[data-portrait="dayneon"] { background: #5F9E8E; }
.pair canvas[data-portrait="nightneon"] { background: #141B3D; box-shadow: inset 0 0 0 1px rgba(230, 233, 242, 0.12); }
.pair .portrait-label { min-height: 0; }

.btn-night {
  margin-top: 8px;
  background: #E6E9F2;
  color: #141B3D;
}

/* ---------- footer ---------- */

.footer {
  padding: 44px 0 calc(44px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
}
.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px 40px;
}
.footer-brand, .footer-meta { display: grid; gap: 4px; }
.footer-name { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; color: var(--text); }
@media (min-width: 768px) { .footer-meta { text-align: right; } }

.noscript { padding: 24px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .pill:hover, .btn:hover { transform: none; }
}
