/* Fastutle site styles. Mobile first; wider screens add to the base rules.
   Colors are tokens on :root, swapped for dark mode. App pages set --accent inline (base layout). */

:root {
  --bg: #ffffff;
  --fg: #16171b;
  --muted: #5d5f68;
  --line: #e4e5ea;
  --soft: #f4f5f7;
  --link: #0a5fc4;
  --hero-bg: #0f1014;
  --hero-fg: #f4f4f6;
  --pill-bg: #ececf0;
  --pill-fg: #4a4c55;
  --accent: #16171b;
  --brand: #1f3a35;
  --radius: 14px;
  --wrap: 960px;
  --gutter: 16px;
  --font: -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Hiragino Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1014;
    --fg: #ececf0;
    --muted: #a3a5ae;
    --line: #2a2c33;
    --soft: #181a1f;
    --link: #73b4ff;
    --brand: #e9f1ee;
    --hero-bg: #050608;
    --hero-fg: #f4f4f6;
    --pill-bg: #25272e;
    --pill-fg: #c4c6ce;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: normal;
}

:lang(ko) { word-break: keep-all; overflow-wrap: anywhere; }

img { max-width: 100%; height: auto; }

a { color: var(--link); text-underline-offset: 0.18em; }

h1, h2, h3 { line-height: 1.3; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; margin: 0 0 0.6em; }
h2 { font-size: 1.3rem; margin: 2em 0 0.6em; }
h3 { font-size: 1.1rem; margin: 1.6em 0 0.5em; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

main { display: block; min-height: 50vh; }

/* Horizontal strips (language switch, app tabs) scroll inside themselves, never the page. */
.lang-switch ul,
.app-tabs ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.lang-switch ul::-webkit-scrollbar,
.app-tabs ul::-webkit-scrollbar { display: none; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.site-header-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 12px;
  padding-bottom: 10px;
}
.brand {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  min-width: 0;
}
.brand a { color: var(--fg); text-decoration: none; }
.brand-home { display: inline-flex; align-items: center; gap: 0.4em; }
.brand-mark { flex: none; color: var(--brand); width: 1.3em; height: 1.4em; }
.brand-sep { color: var(--muted); margin: 0 0.35em; font-weight: 400; }
.brand-app { font-weight: 600; }

.lang-switch { min-width: 0; font-size: 0.85rem; }
.lang-switch a {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}
.lang-switch a:hover { color: var(--fg); background: var(--soft); }
.lang-switch a[aria-current="page"] { color: var(--fg); background: var(--soft); font-weight: 600; }

/* App tabs */
.app-tabs { border-bottom: 1px solid var(--line); }
.app-tabs ul { gap: 2px; }
.app-tabs a {
  display: inline-block;
  padding: 10px 10px 8px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}
.app-tabs a:hover { color: var(--fg); }
.app-tabs a[aria-current="page"] {
  color: var(--fg);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* Footer */
.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}
.site-footer .wrap { padding-top: 28px; padding-bottom: 36px; }
.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.footer-nav a { color: var(--fg); text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.legal-lang-notice { margin: 0 0 16px; }
.biz { margin: 0 0 12px; }
.biz div { display: flex; flex-wrap: wrap; gap: 0 0.5em; }
.biz dt { font-weight: 600; }
.biz dd { margin: 0; }
.biz a { color: inherit; }
.copyright { margin: 0; }

/* Pills and store badges */
.pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-fg);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.store-cta { display: inline-flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.store-badge { display: inline-block; line-height: 0; }
.store-badge img { height: 40px; width: auto; }

/* Single-column documents (about, support, legal) */
.doc { max-width: 720px; padding-top: 32px; }
.doc table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 0.95rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.doc th { width: 38%; color: var(--muted); font-weight: 600; }
.doc pre { overflow-x: auto; white-space: pre-wrap; background: var(--soft); padding: 12px; border-radius: 8px; font-size: 0.85rem; }
.doc code { font-size: 0.92em; }

/* Legal documents (privacy, terms): dates, summary box, history */
.legal-head h1 { margin-bottom: 0.3em; }
.legal-dates { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 1.4em; color: var(--muted); font-size: 0.95rem; }
.summary { margin: 0 0 2em; padding: 14px 16px; background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); }
.summary h2 { margin: 0 0 0.4em; font-size: 1rem; }
.summary ul { margin: 0; padding-left: 1.2em; }
.summary li { margin: 0 0 0.35em; }
.summary li:last-child { margin-bottom: 0; }
.legal-body h2 { margin-top: 1.8em; font-size: 1.25rem; }
.legal-body h3 { font-size: 1.05rem; }
.legal-body blockquote { margin: 1em 0; padding: 0.1em 0 0.1em 1em; border-left: 3px solid var(--line); }
.legal-foot { margin-top: 2.4em; padding-top: 1.2em; border-top: 1px solid var(--line); }
.original-prevails { margin: 0 0 1.2em; color: var(--muted); font-size: 0.95rem; }
.legal-history h2 { font-size: 1rem; margin: 0 0 0.4em; }
.history { margin: 0 0 1.2em; padding-left: 1.4em; font-size: 0.95rem; }
.history li { margin: 0 0 0.3em; }
.history time { font-variant-numeric: tabular-nums; color: var(--muted); margin-right: 0.4em; }
.legal-langs ul { display: flex; flex-wrap: wrap; gap: 8px 16px; list-style: none; margin: 0; padding: 0; }

/* Open source licences: one <details> per package */
.license-list { list-style: none; margin: 1.2em 0 0; padding: 0; }
.license-list li { margin: 0; border-bottom: 1px solid var(--line); }
.license-list details > summary, .license-ext { padding: 10px 2px; margin: 0; overflow-wrap: anywhere; }
.license-list details > summary { cursor: pointer; }
.license-list pre { margin: 0 0 12px; padding: 12px; max-height: 24rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--soft); border-radius: 8px; font-size: 0.8rem; line-height: 1.45; }

@media print {
  .licenses pre { max-height: none; overflow: visible; font-size: 8pt; }
  .licenses details > summary { font-weight: 600; break-after: avoid; }
  .licenses details { break-inside: auto; }
}

/* 404 */
.notfound { padding-top: 48px; }
.notfound h1 { margin-bottom: 0.2em; }
.notfound-en { margin: 0 0 1.6em; color: var(--muted); font-size: 1.15rem; }
.notfound ul { list-style: none; margin: 0 0 1.6em; padding: 0; }
.notfound li { margin: 0 0 10px; }
.notfound-apps a { text-decoration: none; }
.notfound-apps img { width: 40px; height: 40px; border-radius: 10px; vertical-align: middle; margin-right: 8px; }

@media (min-width: 720px) {
  :root { --gutter: 24px; }
  h1 { font-size: 2.2rem; }
  .site-header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  .lang-switch ul { flex-wrap: wrap; justify-content: flex-end; white-space: normal; }
  .app-tabs a { padding: 12px 14px 10px; }
  .doc { padding-top: 48px; }
}

@media print {
  .site-header,
  .app-tabs,
  .site-footer nav {
    display: none !important;
  }
  :root { --bg: #fff; --fg: #000; --muted: #333; --line: #bbb; --soft: #fff; --link: #000; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: inherit; text-decoration: none; }
  .site-footer { margin-top: 24pt; background: #fff; }
  .wrap { max-width: none; padding: 0; }
  .legal-langs { display: none; }
  .summary { border-color: #999; }
}

/* Landing hero */
.hero { background: var(--hero-bg); color: var(--hero-fg); padding: 56px 0 48px; }
.hero-label {
  margin: 0 0 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8fb8ff;
}
.hero-title { margin: 0 0 16px; font-size: 1.9rem; line-height: 1.3; }
.hero-lead { margin: 0; max-width: 34em; font-size: 1.02rem; color: #c4c6ce; }

/* App rows (landing, about) */
.apps { padding-top: 32px; }
.apps-title { margin-top: 0; font-size: 1.1rem; color: var(--muted); }
.app-list { list-style: none; margin: 0; padding: 0; }
.app-row {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 4px 14px;
  align-items: center;
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.app-row:hover { background: var(--soft); }
.app-row-icon { width: 56px; height: 56px; border-radius: 13px; grid-row: span 2; align-self: start; }
.app-row-text { min-width: 0; }
.app-row-name { margin: 0; font-size: 1.1rem; }
.app-row-name a { color: var(--fg); text-decoration: none; }
.app-row-name a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.app-row-name a:focus-visible::after { outline: 2px solid var(--link); outline-offset: 2px; }
.app-row-tagline { margin: 2px 0 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.app-row-cta { position: relative; z-index: 1; grid-column: 2; justify-self: start; margin-top: 6px; }
.app-row.is-upcoming .app-row-icon,
.app-row.is-upcoming .app-row-name,
.app-row.is-upcoming .app-row-tagline { opacity: 0.6; }

.doc .app-list { margin-top: 1em; }
.doc h1 { margin-top: 0; }

@media (min-width: 720px) {
  .hero { padding: 88px 0 72px; }
  .hero-title { font-size: 2.8rem; max-width: 16em; }
  .hero-lead { font-size: 1.15rem; }
  .apps { padding-top: 48px; }
  .app-row { grid-template-columns: 64px minmax(0, 1fr) auto; padding: 16px 20px; }
  .app-row-icon { width: 64px; height: 64px; grid-row: auto; align-self: center; }
  .app-row-cta { grid-column: 3; margin-top: 0; justify-self: end; }
}

/* App overview (_layouts/app.html): hero, zigzag features, trust block, download repeat.
   --accent is the app color (set on <body> by the base layout); per the design it is used
   only for the hero gradient and the current tab. */
.app-overview { --shot-w: 232px; }

.shot {
  display: block;
  width: var(--shot-w);
  max-width: 100%;
  height: auto;
  /* Proportional corners (about a tenth of the width) so the rounding matches a phone screen
     at every size. */
  border-radius: 10% / 4.6%;
  background: var(--soft);
  box-shadow: 0 0 0 1px var(--line), 0 12px 32px -8px rgba(16, 17, 22, 0.22);
}
.shot--wide { width: 100%; max-width: 560px; border-radius: 4.6% / 10%; }

.app-hero {
  background: var(--soft);
  background: linear-gradient(170deg,
    color-mix(in srgb, var(--accent) 16%, var(--bg)) 0%,
    color-mix(in srgb, var(--accent) 5%, var(--bg)) 55%,
    var(--bg) 100%);
  padding: 32px 0 40px;
}
.app-hero-inner { display: grid; gap: 28px; }
.app-hero-name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-weight: 700;
  font-size: 1rem;
}
.app-hero-name img { width: 40px; height: 40px; border-radius: 10px; }
.app-hero-title { margin: 0 0 14px; font-size: 1.9rem; line-height: 1.25; letter-spacing: -0.02em; }
.app-hero-lead { margin: 0 0 20px; color: var(--muted); font-size: 1.02rem; max-width: 34em; }
.app-hero-cta { margin: 0; }
.app-hero-media { display: flex; justify-content: center; }
.app-hero-icon { width: 160px; height: 160px; border-radius: 36px; box-shadow: 0 12px 32px -8px rgba(16, 17, 22, 0.25); }

.features { padding-top: 24px; }
.feature {
  display: grid;
  gap: 20px;
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
}
.feature:last-of-type { border-bottom: 0; }
.feature-media { display: flex; justify-content: center; }
.feature-text h2 { margin: 0 0 10px; font-size: 1.35rem; }
.feature-text p { margin: 0; color: var(--muted); max-width: 34em; }
/* Mobile: text first, then the screenshot. */
.feature-media { order: 2; }
.feature--text .feature-text {
  padding: 20px 20px 22px;
  border-radius: var(--radius);
  background: var(--soft);
}

.app-credits {
  margin: 8px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.trust {
  margin-top: 24px;
  padding: 40px 0 44px;
  background: var(--soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.trust-title { margin: 0 0 20px; font-size: 1.4rem; }
.trust-cols { display: grid; gap: 16px; }
.trust-col {
  padding: 18px 20px 20px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--line);
}
.trust-col h3 { margin: 0 0 10px; font-size: 1rem; }
.trust-on h3::before,
.trust-leaves h3::before {
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-right: 0.5em;
  border-radius: 50%;
  vertical-align: 0.08em;
  content: "";
}
.trust-on h3::before { background: #2e9d63; }
.trust-leaves h3::before { background: var(--muted); }
.trust-col ul { margin: 0; padding-left: 1.15em; }
.trust-col li { margin: 0 0 8px; font-size: 0.94rem; line-height: 1.6; }
.trust-col li:last-child { margin-bottom: 0; }

.download { padding: 48px 0 8px; text-align: center; }
.download-icon { width: 64px; height: 64px; border-radius: 15px; display: block; margin: 0 auto 12px; }
.download h2 { margin: 0 0 2px; font-size: 1.4rem; }
.download-name { margin: 0 0 14px; color: var(--muted); }

@media (min-width: 720px) {
  .app-overview { --shot-w: 260px; }
  .app-hero { padding: 56px 0 64px; }
  .app-hero-inner { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 48px; }
  .app-hero-title { font-size: 2.6rem; }
  .app-hero-lead { font-size: 1.12rem; }
  .app-hero-media .shot { --shot-w: 280px; }

  .feature {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: center;
    gap: 48px;
    padding: 56px 0;
  }
  .feature--media-start .feature-media { order: 0; }
  .feature--media-end { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .feature--media-end .feature-media { order: 2; }
  .feature--text { grid-template-columns: minmax(0, 1fr); padding: 40px 0; }
  .feature--text .feature-text { max-width: 640px; margin: 0 auto; width: 100%; }
  .feature-text h2 { font-size: 1.6rem; }
  .feature-text p { font-size: 1.05rem; }

  .trust { padding: 56px 0 60px; }
  .trust-cols { grid-template-columns: 1fr 1fr; gap: 20px; }
  .download { padding-top: 64px; }
}

@media print {
  .app-hero { background: none; padding: 0 0 12pt; }
  .shot { box-shadow: none; width: 120px; }
  .trust { background: none; }
}
