@font-face {
  font-family: "SG Kara";
  src: url("../fonts/SGKara-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "SG Kara";
  src: url("../fonts/SGKara-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "SG Kara";
  src: url("../fonts/SGKara-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1d1434;
  --night: #120c22;
  --night-2: #1b1433;
  --cyan: #16becf;
  --cyan-ink: #0b6770;
  --paper: #f3f0e8;
  --paper-2: #e7e2d6;
  --on-night: #f6f4ef;
  --on-night-soft: #d5ebee;
  --text: #1d1434;
  --text-soft: #3c345c;
  --line: #d9d3c6;
  --line-night: #3a3158;
  --shadow: 0 16px 36px rgba(18, 12, 34, 0.16);
  --radius: 14px;
  --header: 4.5rem;
  --measure: 68ch;
  --pad: clamp(1.1rem, 3vw, 2.5rem);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: "SG Kara", Tahoma, sans-serif;
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; height: auto; }
a { color: var(--cyan-ink); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.25;
  text-wrap: balance;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2rem, 5vw, 4.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-top: 1.4em; }
p { margin: 0 0 1rem; }
::selection { background: var(--cyan); color: var(--ink); }
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: #2a2348; border: 3px solid var(--paper); border-radius: 99px; }

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  top: -4rem;
  background: var(--cyan);
  color: var(--ink);
  padding: 0.5rem 0.8rem;
  z-index: 20;
}
.skip:focus { top: 0.6rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header);
  padding: 0.6rem var(--pad);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
}
.brand img { width: 42px; height: auto; }
.brand-name { display: flex; flex-direction: column; font-weight: 600; line-height: 1.1; }
.brand-name small { font-weight: 400; color: var(--cyan-ink); letter-spacing: 0.04em; }
.nav-toggle {
  min-height: 44px;
  min-width: 44px;
  border: 0;
  background: var(--ink);
  color: var(--on-night);
  border-radius: 999px;
  padding: 0 1rem;
  font: inherit;
}
.site-nav {
  display: none;
  position: absolute;
  inset-inline: 0;
  top: 100%;
  background: var(--night);
  color: var(--on-night);
  padding: 0.6rem var(--pad) 1.2rem;
  box-shadow: var(--shadow);
}
.site-nav[data-open="true"] { display: grid; }
.site-nav a, .nav-details summary {
  color: var(--on-night);
  text-decoration: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.site-nav a.is-current { color: var(--cyan); }
.nav-details summary { cursor: pointer; }
.nav-details div { display: grid; padding-inline-start: 0.8rem; }
.lang-link { color: var(--cyan) !important; }

.hero {
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(22, 190, 207, 0.18), transparent 60%),
    var(--night);
  color: var(--on-night);
  padding: clamp(2rem, 6vw, 5rem) var(--pad) 0;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  gap: 1.5rem;
  align-items: end;
  max-width: 1180px;
  margin: 0 auto;
}
.hero-mark { width: min(34vw, 168px); height: auto; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.35)); }
.hero-copy { max-width: 40rem; }
.hero h1 { color: var(--on-night); max-width: 16ch; }
.lede { font-size: 1.15rem; max-width: var(--measure); color: var(--on-night-soft); }
.band-paper .lede, .sheet .lede { color: var(--text-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.2rem; }
.hero-line {
  height: 3px;
  margin-top: 2.5rem;
  background: var(--cyan);
  transform-origin: inline-start;
  animation: draw 1.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.button, button.button, .nav-toggle {
  font-family: inherit;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: var(--cyan);
  color: var(--ink);
  text-decoration: none;
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(22, 190, 207, 0.18);
}
.button:hover { color: var(--ink); transform: scale(0.96); }
.button:active { transform: scale(0.96); }
.button-quiet {
  background: transparent;
  color: var(--on-night);
  box-shadow: inset 0 0 0 1px var(--line-night);
}
.band-paper .button-quiet, .sheet .button-quiet { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.text-link { font-weight: 600; }

.band { padding: clamp(2.5rem, 6vw, 5rem) var(--pad); }
.band-night { background: var(--night-2); color: var(--on-night); }
.band-night .lede, .band-night p { color: var(--on-night-soft); }
.band-paper { background: var(--paper-2); }
.band-inner { max-width: 1100px; margin: 0 auto; }
.narrow, .sheet.narrow { max-width: 720px; }
.video-frame {
  margin-top: 1rem;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.28);
  background: #000;
}
.video-frame video { display: block; width: 100%; }
.shot { margin: 1.4rem 0 0; }
.shot-frame {
  display: block;
  background: var(--night);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 36px rgba(18, 12, 34, 0.2);
}
.shot-frame img { display: block; width: 100%; height: auto; }
.shot figcaption { margin-top: 0.55rem; color: var(--text-soft); max-width: var(--measure); }
.shot figcaption strong { color: var(--ink); font-weight: 600; }
.band-night .shot figcaption,
.band-night .shot figcaption strong { color: var(--on-night-soft); }
.shot-pair { display: grid; gap: 1.2rem; }
.sheet-wide { max-width: 1080px; }

.service-list { margin: 1.5rem 0 0; }
.service-list div {
  display: grid;
  gap: 0.35rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
}
.band-night .service-list div { border-color: var(--line-night); }
.service-list dt { font-size: 1.35rem; font-weight: 600; }
.service-list dd { margin: 0; max-width: var(--measure); color: var(--text-soft); }
.band-night .service-list dd { color: var(--on-night-soft); }

.path-list, .step-list, .people, .essay-list, .sources, .chip-list { list-style: none; padding: 0; margin: 0; }
.path-list { display: grid; gap: 0; }
.path-list a, .essay-list a {
  display: grid;
  gap: 0.25rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  min-height: 44px;
}
.path-list a span, .essay-list a span { color: var(--text-soft); max-width: var(--measure); }
.step-list { display: grid; gap: 1.1rem; margin: 1.5rem 0 2rem; }
.step-list li {
  display: grid;
  gap: 0.2rem;
  padding-inline-start: 1rem;
  box-shadow: inset 1px 0 0 var(--cyan);
}
[dir="rtl"] .step-list li { box-shadow: inset -1px 0 0 var(--cyan); }
.people { display: grid; gap: 1.5rem; }
.people li { display: grid; gap: 0.25rem; align-content: start; }
.people img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius);
  filter: grayscale(1);
}
.people em { color: var(--cyan-ink); font-style: normal; }
.chip-list { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 1rem 0 2rem; }
.chip-list li {
  background: var(--paper-2);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  color: var(--text-soft);
}

.sheet { max-width: 980px; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3.5rem) var(--pad) 4rem; }
.prose { max-width: calc(var(--measure) + 3rem); }
.prose p { max-width: var(--measure); }
.meta { color: var(--text-soft); }
.chapter-nav { display: flex; flex-wrap: wrap; gap: 0.7rem 1rem; margin: 1rem 0 2rem; }
.chapter-nav a { font-weight: 600; }
.slogan { font-size: 1.4rem; font-weight: 600; color: var(--cyan-ink); }
table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
th, td { text-align: start; padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
caption, .note, figcaption { color: var(--text-soft); text-align: start; margin-bottom: 0.6rem; }
.bar-chart { display: grid; gap: 0.7rem; margin: 0.6rem 0 0.4rem; }
.bar-row { display: grid; grid-template-columns: minmax(7rem, 0.7fr) 1fr auto; gap: 0.6rem; align-items: center; }
.bar-track { display: block; background: var(--paper-2); border-radius: 999px; height: 12px; }
.bar-fill { display: block; height: 12px; background: var(--cyan-ink); border-radius: 999px; }
.w10 { inline-size: 10%; } .w20 { inline-size: 20%; } .w30 { inline-size: 30%; }
.w40 { inline-size: 40%; } .w50 { inline-size: 50%; } .w60 { inline-size: 60%; }
.w70 { inline-size: 70%; } .w80 { inline-size: 80%; } .w90 { inline-size: 90%; }
.w100 { inline-size: 100%; }
.bar-num { font-variant-numeric: tabular-nums; }

.stack-form, .search-form { display: grid; gap: 0.9rem; margin-top: 1rem; }
label span { display: block; font-weight: 600; margin-bottom: 0.25rem; }
input, textarea, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(29, 20, 52, 0.06);
  padding: 0.75rem 0.85rem;
  min-height: 44px;
}
textarea { min-height: 8rem; resize: vertical; }
.step { display: none; border: 0; padding: 0; margin: 0; }
.step.is-on { display: grid; gap: 0.9rem; }
.step legend { font-size: 1.3rem; font-weight: 600; padding: 0; margin-bottom: 0.4rem; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.flash { margin: 1rem var(--pad) 0; padding: 0.8rem 1rem; border-radius: 12px; background: var(--paper-2); }
.flash-bad { background: #f3d6d2; color: #4a1d24; }
.flash-ok { background: #d7f3f1; color: #08383c; }
.code { font-size: 1.8rem; font-weight: 600; letter-spacing: 0.04em; }
.empty { color: var(--text-soft); }

.board { display: grid; gap: 0.8rem; }
.board-col { display: flex; flex-direction: column; background: var(--night); color: var(--on-night); border-radius: 16px; padding: 0.9rem; min-height: 16rem; }
.board-col span { font-weight: 600; }
.board-col textarea { flex: 1; background: transparent; color: var(--on-night); box-shadow: none; }
.board-foot { display: grid; gap: 0.8rem; }

.chat-shell {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: calc(100vh - var(--header));
  background: var(--night);
  color: var(--on-night);
}
.chat-log { padding: 1rem var(--pad); display: grid; gap: 0.8rem; align-content: end; }
.bubble { display: flex; gap: 0.6rem; max-width: 70ch; }
.bubble p { margin: 0; }
.bubble-user { justify-self: end; background: #241b3e; border-radius: 16px; padding: 0.7rem 0.9rem; }
.bubble-bot img { width: 28px; height: 28px; }
.dossier { display: none; }
.composer { padding: 0.8rem var(--pad) 1rem; background: #0d0918; }
.composer textarea { background: #1b1433; color: var(--on-night); box-shadow: none; }
.composer-tools { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 0.6rem; }
.composer-tools label { font-size: 0.95rem; }
.thinking { color: var(--cyan); min-height: 1.4rem; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.contact-sheet { display: grid; gap: 1rem; }
.map { width: 100%; min-height: 280px; border: 0; border-radius: var(--radius); background: var(--paper-2); }
.qr-card {
  min-height: 100vh;
  max-width: 640px;
  margin: 0 auto;
  padding: 2.5rem var(--pad) 3rem;
  display: grid;
  align-content: start;
  gap: 0.4rem;
}
.qr-card ul { padding-inline-start: 1.1rem; }

.site-footer { background: var(--ink); color: var(--on-night-soft); padding: 2.5rem var(--pad) 3rem; }
.footer-grid { display: grid; gap: 1.5rem; max-width: 1100px; margin: 0 auto; }
.site-footer a { color: var(--on-night); display: inline-flex; min-height: 36px; align-items: center; margin-inline-end: 0.8rem; }
.footer-label { color: var(--cyan); font-weight: 600; }

.admin-shell { display: grid; min-height: 100vh; }
.admin-nav { background: var(--night); color: var(--on-night); padding: 1rem; display: grid; align-content: start; gap: 0.2rem; }
.admin-nav a { color: var(--on-night); text-decoration: none; min-height: 40px; display: flex; align-items: center; }
.admin-main { padding: 1.2rem var(--pad) 3rem; }
.stat-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.8rem; }
.stat-list div { background: #fff; border-radius: 14px; padding: 0.8rem; box-shadow: var(--shadow); }
.stat-list dd { margin: 0; font-size: 1.8rem; font-weight: 600; }
.table-wrap { overflow-x: auto; }
.detail div { padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.detail dt { font-weight: 600; }
.admin-chat { padding: 1rem 0; border-top: 1px solid var(--line); }

@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    position: static;
    background: transparent;
    color: inherit;
    box-shadow: none;
    padding: 0;
    gap: 0.15rem 0.75rem;
    align-items: center;
    max-inline-size: 72%;
  }
  .site-nav a, .nav-details summary { color: var(--ink); min-height: 44px; }
  .nav-details { position: relative; }
  .nav-details div {
    display: none;
    position: absolute;
    inset-inline-start: 0;
    top: 100%;
    background: var(--night);
    min-width: 14rem;
    padding: 0.4rem 0.8rem 0.7rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
  }
  .nav-details[open] div, .nav-details:hover div, .nav-details:focus-within div { display: grid; }
  .nav-details div a { color: var(--on-night); }
  .hero-grid { grid-template-columns: 220px 1fr; }
  .people { grid-template-columns: repeat(3, 1fr); }
  .people li:first-child { grid-column: span 1; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .contact-sheet { grid-template-columns: 1fr 1fr; align-items: start; }
  .shot-pair { grid-template-columns: 1fr 1fr; align-items: start; }
  .board { grid-template-columns: 1fr 1fr 1fr; }
  .board-foot { grid-column: 1 / -1; grid-template-columns: 1fr 1fr 1fr; }
  .chat-shell { grid-template-columns: 1fr 280px; grid-template-rows: 1fr auto; }
  .dossier {
    display: block;
    grid-row: 1 / span 2;
    grid-column: 2;
    padding: 1rem;
    background: #0d0918;
    border-inline-start: 1px solid var(--line-night);
  }
  .dossier dt { color: var(--on-night-soft); }
  .dossier a { color: var(--cyan); }
  .chat-log { grid-column: 1; }
  .composer { grid-column: 1; }
  .admin-shell { grid-template-columns: 220px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-line { animation: none; }
  .button:hover { transform: none; }
  html { scroll-behavior: auto; }
}
