/* ==========================================================================
   FolderDeck.com — Design System
   Base: DESIGN.md (Hero-Centric) + brand amber accent extracted from app icon
   Plain CSS + custom properties. Light/Dark via prefers-color-scheme.
   ========================================================================== */

/* ---- Fonts: Pretendard (KR) via CDN, system stack for Latin ---- */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

/* ---------- Design tokens ---------- */
:root {
  /* Brand (warm gold/amber, sampled from FolderDeck app icon) */
  --amber-300: #E4CC84;
  --amber-500: #B5852A;
  --amber-600: #8C6418;

  /* Neutrals — light theme */
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --surface-2: #F4F2EC;
  --text: #1A1A1C;          /* off-black, never #000 */
  --text-muted: #6B6B70;
  --border: #E7E3DA;

  /* Roles */
  --accent: var(--amber-500);
  --accent-strong: var(--amber-600);
  --cta-bg: #1A1A1C;
  --cta-fg: #FFFFFF;

  /* Typography scale (DESIGN.md §10) */
  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Apple SD Gothic Neo", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --fs-hero: clamp(2.5rem, 6vw, 4.5rem);
  --fs-h2: clamp(1.75rem, 3.5vw, 2.75rem);
  --fs-h3: 1.25rem;
  --fs-body: 1.0625rem;
  --fs-small: 0.875rem;

  /* Layout */
  --maxw: 1200px;
  --readable: 760px;
  --pad-x: 1.5rem;
  --section-gap: clamp(4rem, 9vw, 8rem);
  --radius: 0.75rem;
  --radius-sm: 0.5rem;

  /* Effects */
  --shadow-card: 0 2px 14px rgba(26, 22, 12, 0.07);
  --shadow-window: 0 24px 60px -16px rgba(26, 22, 12, 0.30);
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);

  /* z-index contract */
  --z-nav: 100;
  --z-overlay: 200;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F0F10;
    --surface: #18181B;
    --surface-2: #1F1F23;
    --text: #F2F2F2;
    --text-muted: #A1A1A8;
    --border: #2A2A2E;
    --accent: var(--amber-300);
    --accent-strong: var(--amber-300);
    --cta-bg: #F2F2F2;
    --cta-fg: #161616;
    --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.45);
    --shadow-window: 0 28px 64px -16px rgba(0, 0, 0, 0.65);
  }
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }

.container { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad-x); }
.section { padding-block: var(--section-gap); }
.eyebrow {
  font-size: var(--fs-small); font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--accent-strong); margin: 0 0 1rem;
}
.lead { font-size: 1.15rem; color: var(--text-muted); max-width: var(--readable); }
.muted { color: var(--text-muted); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.5rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 1rem; line-height: 1; cursor: pointer;
  border: 1.5px solid transparent; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--cta-bg); color: var(--cta-fg); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -8px rgba(0,0,0,.4); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

/* Beta version badge (pill) */
.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; line-height: 1;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--cta-fg);
  background: var(--accent-strong); padding: 0.32em 0.6em; border-radius: 999px;
  vertical-align: middle;
}
.version-note { font-size: var(--fs-small); color: var(--text-muted); margin-top: 1rem; }

/* App Store badge (inline SVG link) */
.appstore-badge { display: inline-block; line-height: 0; }
.appstore-badge svg { height: 52px; width: auto; }
.appstore-badge:hover { text-decoration: none; opacity: .9; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: var(--z-nav);
  height: 56px; display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s, background .2s;
}
.nav.scrolled { border-bottom-color: var(--border); background: color-mix(in srgb, var(--bg) 90%, transparent); }
.nav .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.nav-brand { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; color: var(--text); }
.nav-brand:hover { text-decoration: none; }
.nav-brand img { width: 26px; height: 26px; border-radius: 6px; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: var(--text-muted); font-size: 0.95rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.lang-switch { font-variant: small-caps; }
@media (max-width: 640px) {
  .nav-links { gap: 1rem; }
  .nav-links .nav-hide-sm { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding-top: clamp(3rem, 7vw, 5.5rem); }
.hero-grid {
  display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center;
  grid-template-columns: 1.05fr 1fr;
}
.hero h1 { font-size: var(--fs-hero); font-weight: 800; }
.hero h1 .en { display: block; font-size: 0.42em; font-weight: 600; color: var(--text-muted); letter-spacing: 0.01em; margin-top: 0.6rem; }
.hero .sub { font-size: 1.2rem; color: var(--text-muted); max-width: 34ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 1.75rem; align-items: center; }
.hero-support { margin-top: 1.25rem; font-size: var(--fs-small); color: var(--text-muted); }
.hero-visual { position: relative; }
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero .sub { max-width: none; }
}

/* macOS-style window mock */
.window {
  border-radius: var(--radius); overflow: hidden; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-window);
}
.window-bar { display: flex; gap: 0.5rem; padding: 0.7rem 0.85rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.window-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--border); }
.window-bar i:nth-child(1) { background: #FF5F57; }
.window-bar i:nth-child(2) { background: #FEBC2E; }
.window-bar i:nth-child(3) { background: #28C840; }
.window .ph { display: block; width: 100%; }

/* hero floating menubar popover overlap */
.hero-popover {
  position: absolute; top: -22px; right: -14px; width: 42%; max-width: 230px;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-window);
}
@media (max-width: 880px) { .hero-popover { display: none; } }

/* ---------- Promise cards (3) ---------- */
.promise { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 820px) { .promise { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow-card);
  transition: transform .2s ease, box-shadow .2s ease;
}
.promise .card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px -12px rgba(26,22,12,.22); }
@media (prefers-reduced-motion: reduce) { .promise .card:hover { transform: none; } }
.card .icon { width: 40px; height: 40px; color: var(--accent); margin-bottom: 1rem; }
.card h3 { font-size: 1.5rem; }
.card .word-en { color: var(--text-muted); font-weight: 600; font-size: 0.9rem; }
.card a.more { display: inline-flex; align-items: center; gap: .3rem; margin-top: 1rem; font-weight: 600; font-size: .95rem; }

/* ---------- Feature rows (zig-zag) ---------- */
.feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.feature + .feature { margin-top: var(--section-gap); }
.feature.reverse .feature-visual { order: -1; }
.feature h2 { font-size: var(--fs-h2); font-weight: 800; }
.feature ul { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.feature li { position: relative; padding-left: 1.6rem; margin-bottom: 0.7rem; color: var(--text); }
.feature li::before {
  content: ""; position: absolute; left: 0; top: 0.55em; width: 8px; height: 8px;
  border-radius: 2px; background: var(--accent);
}
.feature li b { font-weight: 600; }
.feature .pull { margin-top: 1.5rem; font-size: 1.2rem; font-weight: 600; color: var(--accent-strong); }
@media (max-width: 880px) {
  .feature { grid-template-columns: 1fr; }
  .feature.reverse .feature-visual { order: 0; }
}

/* ---------- Theme gallery (Brighter) ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 2rem; }
@media (max-width: 820px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .gallery { grid-template-columns: 1fr; } }
.gallery figure {
  margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow-card); transition: transform .2s ease, box-shadow .2s ease;
}
.gallery figure:hover { transform: scale(1.02); box-shadow: 0 12px 30px -12px rgba(26,22,12,.25); }
@media (prefers-reduced-motion: reduce) { .gallery figure:hover { transform: none; } }
.gallery figcaption { padding: 0.6rem 0.85rem; font-size: var(--fs-small); font-weight: 500; background: var(--surface); }

/* ---------- Feature grid (others) ---------- */
.grid-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-top: 2.5rem; }
@media (max-width: 980px) { .grid-features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-features { grid-template-columns: 1fr; } }
.grid-features .item .icon { width: 28px; height: 28px; color: var(--accent); margin-bottom: 0.6rem; }
.grid-features .item h3 { font-size: 1.05rem; margin-bottom: 0.25rem; }
.grid-features .item p { font-size: var(--fs-small); color: var(--text-muted); margin: 0; }

/* ---------- Download ---------- */
.download { text-align: center; background: var(--surface-2); }
.download .reqs {
  display: inline-grid; gap: 0.4rem; text-align: left; margin: 1.75rem auto 0;
  font-size: var(--fs-small); color: var(--text-muted);
}
.download .reqs b { color: var(--text); font-weight: 600; }
.download .privacy-note { margin-top: 1.5rem; font-size: var(--fs-small); color: var(--text-muted); max-width: 46ch; margin-inline: auto; }
.download .cta-row { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* email signup (pre-launch fallback) */
.signup { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.signup input[type="email"] {
  padding: 0.85rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 1rem; min-width: 260px;
}

/* ---------- Feedback / diagnostic section ---------- */
.feedback .lead { margin-inline: auto; }
.steps {
  list-style: none; counter-reset: step; padding: 0;
  max-width: 560px; margin: 1.75rem auto 0; text-align: left;
}
.steps li { counter-increment: step; position: relative; padding-left: 2.4rem; margin-bottom: 0.85rem; color: var(--text); }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -0.1em;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--accent); color: var(--cta-fg);
  font-size: 0.85rem; font-weight: 700; display: grid; place-items: center;
}
.codebox {
  display: flex; align-items: center; gap: 0.75rem; justify-content: space-between;
  max-width: 640px; margin: 1.25rem auto 0; padding: 0.7rem 0.7rem 0.7rem 1rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); text-align: left; overflow-x: auto;
}
.codebox code { font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.5; color: var(--text); white-space: pre; }
.btn-copy {
  flex: none; cursor: pointer; font-size: 0.78rem; font-weight: 600;
  color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.4rem 0.7rem; transition: background .15s ease;
}
.btn-copy:hover { background: var(--bg); }
.feedback .send { margin-top: 1.5rem; }
.feedback .reassure { margin-top: 1.25rem; font-size: var(--fs-small); color: var(--text-muted); max-width: 46ch; margin-inline: auto; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer .container { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2rem; padding-block: 3rem; }
.footer h4 { font-size: var(--fs-small); text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 0 0 1rem; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 0.5rem; }
.footer a { color: var(--text); font-weight: 500; }
.footer a:hover { color: var(--accent-strong); }
.footer .brand-col img { width: 30px; height: 30px; border-radius: 7px; margin-bottom: 0.6rem; }
.footer .copyright { font-size: var(--fs-small); color: var(--text-muted); }
@media (max-width: 720px) { .footer .container { grid-template-columns: 1fr; gap: 1.5rem; } }

/* ---------- Placeholder visual (labeled) ---------- */
.ph {
  aspect-ratio: 16 / 10; width: 100%;
  background:
    repeating-linear-gradient(45deg, var(--surface-2) 0 12px, transparent 12px 24px),
    linear-gradient(135deg, var(--amber-300) 0%, var(--surface-2) 70%);
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--text-muted); font-size: var(--fs-small); font-weight: 500; padding: 1rem;
}
.ph.tall { aspect-ratio: 4 / 5; }
.ph.wide { aspect-ratio: 21 / 9; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .54s ease-out, transform .54s ease-out; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Legal / prose pages ---------- */
.prose { max-width: var(--readable); margin-inline: auto; padding-block: 3rem; }
.prose h1 { font-size: var(--fs-h2); }
.prose h2 { font-size: 1.4rem; margin-top: 2rem; }
.prose h3 { font-size: 1.1rem; margin-top: 1.5rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: var(--fs-small); }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.5rem 0.7rem; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); }
.prose code { font-family: var(--font-mono); background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.9em; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose .back { font-weight: 600; font-size: var(--fs-small); }
