/* SugarMount site styles.
   Generated pages come from tools/build.py; hand-written app and policy pages share these classes.
   Concept: a mountain of sugar cubes. One accent per app (body[data-accent] / --accent set inline). */

@font-face { font-family: "SugarSans"; font-weight: 400; font-display: swap;
  src: url(https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquareNeo/NanumSquareNeoTTF-bRg.woff2) format("woff2"); }
@font-face { font-family: "SugarSans"; font-weight: 700; font-display: swap;
  src: url(https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquareNeo/NanumSquareNeoTTF-cBd.woff2) format("woff2"); }
@font-face { font-family: "SugarSans"; font-weight: 800; font-display: swap;
  src: url(https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquareNeo/NanumSquareNeoTTF-dEb.woff2) format("woff2"); }

:root {
  --paper: #F6F8FB;
  --surface: #FFFFFF;
  --ink: #142033;
  --ink-2: #4B5668;
  --line: #DCE2EA;
  --line-strong: #C3CCD8;
  --accent: #0F766E;
  --accent-ink: #FFFFFF;
  --accent-soft: color-mix(in oklab, var(--accent) 10%, var(--surface));
  --accent-text: var(--accent);
  --radius-s: 8px;
  --radius-m: 14px;
  --icon-radius: 22%;
  --wide: 1120px;
  --read: 720px;
  --gutter: 20px;
  --font: "SugarSans", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F1622; --surface: #172131; --ink: #E8EDF4; --ink-2: #A7B1BF;
    --line: #2A3546; --line-strong: #3A4659;
    --accent-soft: color-mix(in oklab, var(--accent) 22%, var(--surface));
    --accent-text: color-mix(in oklab, var(--accent) 55%, white);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0F1622; --surface: #172131; --ink: #E8EDF4; --ink-2: #A7B1BF;
  --line: #2A3546; --line-strong: #3A4659;
  --accent-soft: color-mix(in oklab, var(--accent) 22%, var(--surface));
  --accent-text: color-mix(in oklab, var(--accent) 55%, white);
  color-scheme: dark;
}

/* derived accent colours must be recomputed wherever --accent is set (custom properties resolve where declared) */
:root, [style*="--accent"] {
  --accent-soft: color-mix(in oklab, var(--accent) 10%, var(--surface));
  --accent-text: var(--accent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]), :root:not([data-theme="light"]) [style*="--accent"] {
    --accent-soft: color-mix(in oklab, var(--accent) 22%, var(--surface));
    --accent-text: color-mix(in oklab, var(--accent) 55%, white);
  }
}
:root[data-theme="dark"], :root[data-theme="dark"] [style*="--accent"] {
  --accent-soft: color-mix(in oklab, var(--accent) 22%, var(--surface));
  --accent-text: color-mix(in oklab, var(--accent) 55%, white);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.75 var(--font); word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--accent-text) 60%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: .22em; }
a:hover { text-decoration-color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 14px; border-radius: var(--radius-s); }
.skip:focus { left: 12px; }

h1, h2, h3 { line-height: 1.3; letter-spacing: -0.015em; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(2rem, 5.2vw, 3.25rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); margin-top: 2.2em; }
h3 { font-size: 1.125rem; font-weight: 700; margin-top: 1.6em; }
p, ul, ol, table, dl { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li { margin: .3em 0; }
strong { font-weight: 700; }
small, .muted { color: var(--ink-2); font-size: .94rem; }
code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .86em; background: color-mix(in oklab, var(--ink) 6%, transparent); padding: .1em .4em; border-radius: 5px; word-break: break-all; }

.container { width: min(100% - 2 * var(--gutter), var(--wide)); margin-inline: auto; }
main.container { padding-bottom: 72px; }
/* reading pages (policies, hand-written app pages) keep a comfortable measure */
.page-read main.container > *:not(.crumbs) { max-width: var(--read); }

/* ---------- header / footer ---------- */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in oklab, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em; text-decoration: none; }
.brand-mark { width: 26px; height: 26px; flex: none; display: block; }
.site-nav { display: flex; align-items: center; gap: 2px; font-size: .95rem; }
.site-nav a { padding: 7px 11px; border-radius: 999px; text-decoration: none; color: var(--ink-2); white-space: nowrap; }
.site-nav a:hover { color: var(--ink); background: color-mix(in oklab, var(--ink) 6%, transparent); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.site-nav a.lang { border: 1px solid var(--line-strong); margin-left: 6px; }
@media (max-width: 520px) { .site-nav .nav-apps { display: none; } .brand-name { font-size: 1rem; } }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 36px 0 44px; font-size: .94rem; color: var(--ink-2); }
.site-footer .container { display: grid; gap: 22px; grid-template-columns: 1fr; }
.site-footer h2 { font-size: .95rem; margin: 0 0 8px; color: var(--ink); }
.site-footer ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 24px; }
.site-footer li { margin: 0 0 6px; break-inside: avoid; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .legal { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 18px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
@media (min-width: 760px) { .site-footer .container { grid-template-columns: 1.3fr 1fr 1fr; } }

/* ---------- breadcrumbs ---------- */
.crumbs { margin: 22px 0 0; font-size: .9rem; color: var(--ink-2); }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "/"; margin-right: 4px; color: var(--line-strong); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ---------- buttons, badges ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: 1rem; text-decoration: none; border: 1.5px solid var(--accent); background: var(--accent); color: var(--accent-ink); line-height: 1.2; }
.button:hover { filter: brightness(1.08); }
.button--outline { background: transparent; color: var(--accent-text); border-color: color-mix(in oklab, var(--accent-text) 55%, transparent); }
.button--outline:hover { background: var(--accent-soft); filter: none; }
.button--quiet { background: transparent; border-color: transparent; color: var(--ink-2); padding-inline: 10px; }
.play-badge::before { content: ""; width: 0; height: 0; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent currentColor; }
.card-actions, .actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; vertical-align: .25em; letter-spacing: 0; line-height: 1.4; white-space: nowrap; background: var(--accent-soft); color: var(--accent-text); }
.badge--soon, .badge--review { background: color-mix(in oklab, var(--ink) 7%, transparent); color: var(--ink-2); }
.badge--live { background: var(--accent-soft); color: var(--accent-text); }

/* ---------- app icons ---------- */
.app-icon { display: block; width: 56px; height: 56px; border-radius: var(--icon-radius); background: var(--surface); box-shadow: 0 1px 2px rgba(20,32,51,.12), 0 4px 14px -6px rgba(20,32,51,.35); flex: none; }
.app-icon--lg { width: 88px; height: 88px; }

/* ---------- home hero: the sugar mountain ---------- */
.home-hero { display: grid; gap: 28px; align-items: center; padding: 44px 0 20px; }
.home-hero h1 { margin-bottom: .25em; }
.home-hero .lead { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--ink-2); max-width: 30em; margin-bottom: .9em; }
.home-hero .count { color: var(--ink-2); font-size: .98rem; }
.mountain { list-style: none; padding: 0; margin: 0 auto; display: grid; gap: 10px; justify-items: center; }
.mountain .row { display: flex; gap: 10px; }
.mountain a { display: block; border-radius: var(--icon-radius); transition: transform .18s ease; }
.mountain a:hover { transform: translateY(-4px); }
.mountain .app-icon { width: clamp(52px, 13vw, 84px); height: clamp(52px, 13vw, 84px); }
.mountain-base { width: 100%; max-width: 420px; height: 10px; margin: 2px auto 0; border-radius: 50%; background: radial-gradient(closest-side, rgba(20,32,51,.16), transparent); }
@media (min-width: 860px) {
  .home-hero { grid-template-columns: 1.05fr 1fr; padding: 72px 0 36px; }
}
@media (prefers-reduced-motion: no-preference) {
  .mountain .app-icon { animation: drop .5s cubic-bezier(.2,.8,.3,1.15) both; animation-delay: calc(var(--i) * 55ms + 120ms); }
  @keyframes drop { from { transform: translateY(-28px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* ---------- home app index ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.group { margin-top: 30px; }
.group h3 { font-size: 1rem; color: var(--ink-2); font-weight: 700; margin: 0 0 4px; }
.app-rows { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; column-gap: 40px; border-top: 1px solid var(--line); }
@media (min-width: 860px) { .app-rows { grid-template-columns: 1fr 1fr; } }
.app-row { margin: 0; padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; align-items: start; }
.app-row h4 { margin: 0; font-size: 1.1rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.4; }
.app-row h4 a { text-decoration: none; }
.app-row h4 a:hover { text-decoration: underline; text-decoration-color: var(--accent-text); }
.app-row .brandline { color: var(--ink-2); font-size: .9rem; margin: 0; }
.app-row .tagline { margin: 4px 0 0; }
.app-row .links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: .94rem; }
.app-row .links a { color: var(--accent-text); font-weight: 700; text-decoration: none; }
.app-row .links a:hover { text-decoration: underline; }
.app-row .links .muted-link { color: var(--ink-2); font-weight: 400; }

/* ---------- principles ---------- */
.principles { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .principles { grid-template-columns: repeat(3, 1fr); gap: 32px; } }
.principles li { margin: 0; padding-top: 14px; border-top: 3px solid var(--ink); }
.principles h3 { margin: 0 0 6px; font-size: 1.08rem; }
.principles p { margin: 0; color: var(--ink-2); }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); margin-top: 12px; max-width: var(--read); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 36px 16px 0; font-weight: 700; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: translateY(-70%) rotate(45deg); transition: transform .2s ease; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details > div { padding: 0 0 16px; color: var(--ink-2); }
.faq details > div p:last-child { margin-bottom: 0; }

/* ---------- generated app page ---------- */
.app-hero { display: grid; grid-template-columns: auto 1fr; gap: 6px 22px; align-items: center; padding: 28px 0 8px; }
.app-hero .app-icon { width: 96px; height: 96px; grid-row: span 2; }
.app-hero h1 { margin: 0; font-size: clamp(1.9rem, 4.4vw, 2.8rem); }
.app-hero .brandline { margin: 0; color: var(--ink-2); }
.app-hero .tagline { grid-column: 1 / -1; font-size: clamp(1.1rem, 2vw, 1.28rem); margin: 14px 0 0; max-width: 34em; }
.app-hero .actions { grid-column: 1 / -1; }
@media (max-width: 520px) { .app-hero .app-icon { width: 72px; height: 72px; } }
.app-layout { display: grid; gap: 8px 48px; grid-template-columns: 1fr; }
.app-layout > * { min-width: 0; }
@media (min-width: 960px) { .app-layout { grid-template-columns: minmax(0, 1fr) 340px; } .facts-box { position: sticky; top: 84px; } }
.facts-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px 22px; margin-top: 2.2em; align-self: start; }
.facts-box h2 { margin: 0 0 10px; font-size: 1.05rem; }
.facts-box dl { margin: 0; }
.facts-box dt { font-size: .86rem; color: var(--ink-2); margin-top: 12px; }
.facts-box dt:first-child { margin-top: 0; }
.facts-box dd { margin: 2px 0 0; font-size: .97rem; }
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px 32px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .features { grid-template-columns: 1fr 1fr; } }
.features li { margin: 0; padding: 14px 0; border-top: 1px solid var(--line); }
.features h3 { margin: 0 0 4px; font-size: 1.02rem; }
.features p { margin: 0; color: var(--ink-2); }
.related { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 18px; }
.related li { margin: 0; width: 84px; text-align: center; font-size: .86rem; line-height: 1.35; }
.related a { text-decoration: none; display: grid; justify-items: center; gap: 8px; }
.related a:hover span { text-decoration: underline; }

/* ---------- screenshots (shared) ---------- */
.shots { list-style: none; padding: 4px 2px 14px; margin: 22px 0 6px; display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: thin; }
.shots li { flex: 0 0 auto; margin: 0; scroll-snap-align: start; }
.shots img { display: block; width: auto; height: clamp(300px, 52vw, 460px); border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }

/* ---------- hand-written app and policy pages ---------- */
.hero { padding: 26px 0 6px; }
.hero > .app-icon { width: 88px; height: 88px; margin-bottom: 14px; }
.hero .lead, .hero p.lead { font-size: clamp(1.08rem, 2vw, 1.24rem); color: var(--ink-2); }
.eyebrow { display: block; font-size: .92rem; font-weight: 700; color: var(--accent-text); margin-bottom: 4px; }
.hero h1 .badge { font-size: .8rem; vertical-align: .55em; margin-left: 4px; }
.note { background: var(--accent-soft); border-radius: var(--radius-s); padding: 12px 16px; font-size: .97rem; }
.placeholder { color: var(--ink-2); font-style: italic; }
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
.table-wrap table { margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: .96rem; }
th, td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--line); }
tr:last-child > th, tr:last-child > td { border-bottom: 0; }
thead th { background: color-mix(in oklab, var(--ink) 4%, transparent); font-weight: 700; white-space: nowrap; }
tbody th { font-weight: 700; color: var(--ink-2); width: 32%; }
dl:not(.facts-box dl) dt { font-weight: 700; margin-top: .8em; }
dl:not(.facts-box dl) dd { margin: .2em 0 0; }
.steps { list-style: none; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-left: 42px; margin: 14px 0; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; display: grid; place-items: center; font-size: .9rem; }
.two-col { display: grid; gap: 16px; grid-template-columns: 1fr; margin-bottom: 1em; }
.two-col > * { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 20px; }
.two-col h3 { margin-top: 0; }
@media (min-width: 640px) { .two-col { grid-template-columns: 1fr 1fr; } }

/* policy list */
.card-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.card { margin: 0; padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; }
.card h2, .card h3 { margin: 0; font-size: 1.05rem; letter-spacing: -0.01em; }
.card .sub { margin: 0; color: var(--ink-2); font-size: .9rem; grid-column: 1; }
.card .card-actions { margin: 0; grid-column: 2; grid-row: 1 / span 2; }
.card .card-actions .button { min-height: 40px; padding: 8px 16px; font-size: .94rem; }
@media (max-width: 560px) { .card { grid-template-columns: 1fr; } .card .card-actions { grid-column: 1; grid-row: auto; margin-top: 8px; } }

/* 404 */
.notfound { padding: 80px 0; max-width: var(--read); }

@media print {
  .site-header, .site-footer, .crumbs, .actions, .card-actions { display: none; }
  body { background: #fff; color: #000; }
}
