/* Layout: crisis strip → sticky header → night-sky hero band (home only) → single reading column, with an in-page index on wide screens for long pages. */
:root {
  /* Palette "새벽 호수": night-sky navy, calm teal as the working colour, dawn gold only as a point of light. */
  --paper: #f5f7f8;        /* page ground */
  --surface: #ffffff;      /* header, cards, forms */
  --ink: #1c2a3a;          /* body text */
  --ink-soft: #52606f;     /* secondary text */
  --line: #dce3e8;         /* borders */
  --night: #1b2b40;        /* hero + crisis strip */
  --night-ink: #e6ecf1;    /* text on night */
  --primary: #2e6e73;      /* calm teal: buttons, links, emphasis */
  --on-primary: #ffffff;
  --primary-bg: #e7f0f0;   /* notices, current menu */
  --dawn: #9a5f17;         /* small labels, list markers on paper */
  --dawn-bright: #e3b26a;  /* dawn point on night only */
  --calm: var(--primary);
  --calm-bg: var(--primary-bg);
  --focus: #2f6fd6;

  --f-display: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --f-body: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.1rem;
  --step-4: clamp(2.1rem, 5vw, 3.2rem);
  --measure: 68ch;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1620; --surface: #15202c; --ink: #e6ecf1; --ink-soft: #a3b0bd; --line: #263445;
    --night: #0a121c; --night-ink: #e6ecf1; --primary: #7dbdbf; --on-primary: #0e1620; --primary-bg: #132a2d;
    --dawn: #e3b26a; --dawn-bright: #e3b26a; --calm: var(--primary); --calm-bg: var(--primary-bg); --focus: #7fb0ff; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e1620; --surface: #15202c; --ink: #e6ecf1; --ink-soft: #a3b0bd; --line: #263445;
    --night: #0a121c; --night-ink: #e6ecf1; --primary: #7dbdbf; --on-primary: #0e1620; --primary-bg: #132a2d;
    --dawn: #e3b26a; --dawn-bright: #e3b26a; --calm: var(--primary); --calm-bg: var(--primary-bg); --focus: #7fb0ff; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--f-body); font-size: var(--step-0); line-height: 1.75;
  word-break: keep-all; overflow-wrap: anywhere;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
img { max-width: 100%; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.4; text-wrap: balance; font-weight: 700; letter-spacing: -0.01em; }

.wrap {
  width: 100%; max-width: 72rem; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 16px; z-index: 50; background: var(--surface); padding: .5rem 1rem; }

/* Crisis strip */
.crisis { background: var(--night); color: var(--night-ink); font-size: var(--step--1); line-height: 1.5; }
.crisis .wrap { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; padding-block: .55rem; }
.crisis strong { color: var(--dawn-bright); font-weight: 600; }
.crisis a { color: inherit; white-space: nowrap; }
.crisis .nums { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .7rem; }
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1.2; }
.brand b { font-family: var(--f-display); font-size: 1.35rem; letter-spacing: .01em; }
.brand span { font-size: .75rem; color: var(--ink-soft); }
.nav { display: flex; align-items: center; gap: .25rem; }
.nav a { text-decoration: none; padding: .45rem .7rem; border-radius: 6px; font-size: .95rem; color: var(--ink-soft); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--primary-bg); }
.nav a.cta { background: var(--primary); color: var(--on-primary); margin-left: .35rem; }
.nav a.cta:hover, .nav a.cta[aria-current="page"] { background: var(--primary); color: var(--on-primary); opacity: .9; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 6px; padding: .4rem .7rem; font: inherit; font-size: .9rem; }
@media (max-width: 760px) {
  .menu-btn { display: inline-block; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--line);
    padding: .5rem max(16px, env(safe-area-inset-right, 0px)) 1rem max(16px, env(safe-area-inset-left, 0px)); }
  .nav.open { display: flex; }
  .nav a { padding: .7rem .5rem; }
  .nav a.cta { margin: .5rem 0 0; text-align: center; }
}

/* Hero (home) */
.hero {
  background:
    radial-gradient(1px 1px at 12% 22%, rgba(255,255,255,.75) 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 64%, rgba(255,255,255,.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 47% 18%, rgba(255,255,255,.8) 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 42%, rgba(255,255,255,.55) 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 15%, rgba(255,255,255,.7) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 88% 58%, rgba(255,255,255,.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 36% 34%, rgba(255,255,255,.45) 50%, transparent 51%),
    radial-gradient(1px 1px at 93% 30%, rgba(255,255,255,.5) 50%, transparent 51%),
    linear-gradient(180deg, var(--night) 0%, var(--night) 55%, color-mix(in srgb, var(--night) 82%, var(--primary)) 100%);
  color: var(--night-ink);
}
.hero .wrap { padding-block: clamp(3.5rem, 9vw, 6.5rem) clamp(3rem, 7vw, 5rem); }
.hero .eyebrow { color: var(--dawn-bright); letter-spacing: .14em; font-size: .8rem; text-transform: uppercase; }
.hero h1 { font-size: var(--step-4); margin: .6rem 0 1rem; max-width: 18ch; font-weight: 500; }
.hero p { max-width: 40ch; color: color-mix(in srgb, var(--night-ink) 85%, transparent); font-size: var(--step-1); margin: 0; }
.hero .actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .75rem 1.25rem; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 1rem; border: 1px solid transparent; cursor: pointer; font-family: inherit; line-height: 1.3; }
.btn-primary { background: var(--dawn-bright); color: #1b2b40; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { border-color: color-mix(in srgb, var(--night-ink) 40%, transparent); color: var(--night-ink); }
.btn-ink { background: var(--primary); color: var(--on-primary); }
.btn-ink:hover { filter: brightness(1.08); }
.btn-line { border-color: var(--line); color: var(--ink); background: var(--surface); }

/* Sections */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section + .section { border-top: 1px solid var(--line); }
.section h2 { font-size: var(--step-3); margin: 0 0 1rem; }
.lede { font-size: var(--step-1); color: var(--ink-soft); max-width: var(--measure); }
.prose { max-width: var(--measure); min-width: 0; }

.questions { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: .6rem; max-width: 42rem; }
.questions li { font-family: var(--f-display); font-size: var(--step-1); padding-left: 1.2rem; border-left: 2px solid var(--primary); line-height: 1.5; }

.paths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.5rem; }
@media (max-width: 860px) { .paths { grid-template-columns: 1fr; } }
.path { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; display: flex; flex-direction: column; gap: .5rem; text-decoration: none; }
.path:hover { border-color: var(--primary); }
.path .go { color: var(--primary); }
.path .k { font-size: .78rem; letter-spacing: .1em; color: var(--dawn); font-weight: 600; }
.path h3 { margin: 0; font-size: var(--step-1); }
.path p { margin: 0; color: var(--ink-soft); font-size: .98rem; flex: 1; }
.path .go { font-weight: 600; font-size: .95rem; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; gap: 1.5rem; } }
.assure { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.assure li { padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* Content pages */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.page-head .wrap { padding-block: clamp(2rem, 5vw, 3.25rem); }
.page-head .eyebrow { color: var(--dawn); font-size: .8rem; letter-spacing: .12em; font-weight: 600; }
.page-head h1 { font-size: var(--step-4); margin: .35rem 0 .5rem; font-weight: 500; }
.page-head p { margin: 0; color: var(--ink-soft); max-width: 46rem; font-size: var(--step-1); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 3rem; padding-block: 2.5rem 4rem; align-items: start; }
.layout.single { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 960px) { .layout { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }
.toc { position: sticky; top: 6rem; font-size: .9rem; border-left: 1px solid var(--line); padding-left: 1rem; }
.toc p { margin: 0 0 .5rem; font-size: .75rem; letter-spacing: .1em; color: var(--ink-soft); font-weight: 600; }
.toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.toc a { text-decoration: none; color: var(--ink-soft); line-height: 1.45; display: block; }
.toc a:hover { color: var(--ink); }

.content { max-width: var(--measure); min-width: 0; }
.content h2 { font-size: var(--step-3); margin: 3rem 0 1rem; }
.content h3 { font-size: var(--step-2); margin: 2.75rem 0 .75rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.content > h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.content h4 { font-size: var(--step-1); margin: 1.75rem 0 .5rem; }
.content p, .content ul, .content ol { margin: 0 0 1rem; }
.content ul, .content ol { padding-left: 1.3rem; }
.content li { margin-bottom: .35rem; }
.content li::marker { color: var(--dawn); }
.content strong { font-weight: 600; }
.content blockquote { margin: 1.5rem 0; padding: 1rem 1.25rem; background: var(--calm-bg); border-radius: var(--radius); color: var(--ink); }
.content blockquote p:last-child { margin-bottom: 0; }
.content blockquote strong { color: var(--calm); }
.table-wrap { overflow-x: auto; margin: 1.25rem 0 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.content table { border-collapse: collapse; width: 100%; font-size: .95rem; line-height: 1.6; }
.content th, .content td { text-align: left; vertical-align: top; padding: .7rem .9rem; border-bottom: 1px solid var(--line); min-width: 9rem; }
.content th { font-weight: 600; background: color-mix(in srgb, var(--ink) 4%, transparent); }
.content tr:last-child td { border-bottom: 0; }

details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: .75rem 0; }
details > summary { cursor: pointer; padding: 1rem 1.25rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "+"; color: var(--dawn); font-size: 1.25rem; line-height: 1; }
details[open] > summary::after { content: "−"; }
details > .inner { padding: 0 1.25rem 1.25rem; }
details .table-wrap { background: var(--paper); }

.link-row { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.25rem 0 1.5rem; }
.link-row .btn { font-size: .95rem; }

/* Help form */
.form { display: grid; gap: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 4vw, 2rem); max-width: 44rem; }
.field { display: grid; gap: .4rem; }
.field label, .field legend { font-weight: 600; font-size: .98rem; }
.field .hint { font-size: .875rem; color: var(--ink-soft); margin: 0; }
.req { color: var(--dawn); font-weight: 600; margin-left: .2rem; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: .7rem .85rem;
}
textarea { min-height: 9rem; resize: vertical; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .95rem; }
.check input { margin-top: .4rem; width: 1.05rem; height: 1.05rem; flex: none; }
.consent { font-size: .875rem; color: var(--ink-soft); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: .85rem 1rem; line-height: 1.6; }
.consent dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; margin: 0; }
.consent dt { font-weight: 600; color: var(--ink); }
.consent dd { margin: 0; }
.status { padding: 1rem 1.25rem; border-radius: var(--radius); }
.status.ok { background: var(--calm-bg); }
.status.err { background: color-mix(in srgb, #c0392b 12%, var(--surface)); }
.hp { position: absolute; left: -5000px; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); font-size: .9rem; color: var(--ink-soft); }
.site-footer .wrap { padding-block: 2.5rem; display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }
.site-footer b { color: var(--ink); font-family: var(--f-display); font-size: 1.05rem; }
.site-footer p { margin: .35rem 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.site-footer .fine { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 1rem; font-size: .82rem; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media (max-width: 600px) {
  .content th, .content td { min-width: 6.5rem; padding: .6rem .7rem; font-size: .9rem; }
}

.content a:not(.btn), .prose a, .site-footer a { color: var(--primary); }

/* Logo: light artwork by default, recoloured artwork in dark theme */
.brand { flex-direction: row; align-items: center; }
.logo { display: block; height: 48px; width: auto; }
@media (max-width: 760px) { .logo { height: 40px; } }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-light { display: none; } :root:not([data-theme="light"]) .logo-dark { display: block; } }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

/* Photographs (Canva): hero and page heads sit under a night-navy veil so text stays readable */
.hero {
  background:
    linear-gradient(90deg, rgba(27,43,64,.92) 0%, rgba(27,43,64,.72) 45%, rgba(27,43,64,.25) 100%),
    url(hero.jpg) center 60% / cover no-repeat, var(--night);
  background-image: linear-gradient(90deg, rgba(27,43,64,.92) 0%, rgba(27,43,64,.72) 45%, rgba(27,43,64,.25) 100%), url(hero.jpg);
}
@media (max-width: 760px) {
  .hero { background-image: linear-gradient(180deg, rgba(27,43,64,.88) 0%, rgba(27,43,64,.78) 100%), url(hero-900.jpg); background-position: center; }
}
.hero .eyebrow { text-transform: none; letter-spacing: .08em; font-size: .9rem; }
.page-head.photo { background-color: var(--night); background-position: center; background-size: cover; background-repeat: no-repeat; color: var(--night-ink); border-bottom: 0; }
.page-head.photo .wrap { padding-block: clamp(3rem, 8vw, 5.5rem); }
.page-head.photo .eyebrow { color: var(--dawn-bright); }
.page-head.photo p { color: color-mix(in srgb, var(--night-ink) 88%, transparent); }

/* Organisation logos on the About page */
.org-logo { margin: 1.25rem 0 1.5rem; }
.org-logo img { display: block; height: auto; max-width: 100%; }
.org-logo .logo-light, .org-logo .logo-dark { width: 360px; }
.org-logo .isen { display: inline-block; background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.2rem; }
.org-logo .isen:hover { border-color: var(--primary); }
.org-logo .isen img { width: 240px; }

/* Hero: dawn horizon line + first-visit intro (only when <html class="intro">, set once per browser) */
.hero { position: relative; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--dawn-bright); transform-origin: left center; }
.hero h1 .ln { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .intro .hero::after { animation: dawn-line 1.8s cubic-bezier(.2,.7,.2,1) .1s both; }
  .intro .hero .eyebrow { animation: rise .9s ease-out .2s both; }
  .intro .hero h1 .ln:nth-child(1) { animation: rise 1.1s cubic-bezier(.2,.7,.2,1) .45s both; }
  .intro .hero h1 .ln:nth-child(2) { animation: rise 1.1s cubic-bezier(.2,.7,.2,1) .95s both; }
  .intro .hero .lead { animation: rise 1s ease-out 1.5s both; }
  .intro .hero .actions { animation: rise .9s ease-out 1.9s both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes dawn-line { from { transform: scaleX(0); opacity: .4; } to { transform: scaleX(1); opacity: 1; } }
.updated { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .85rem; color: var(--ink-soft); }
.content h4 { font-size: 1.1rem; }
