/* ============================================================
   FLAME STUDIO — Studio design system
   Neutral, premium indie-studio look. Warm ember accent.
   Shared by: home-a, home-b, privacy, terms, support
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400..800&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --paper:   #FBFAF8;
  --paper-2: #F4F1EB;
  --card:    #FFFFFF;
  --ink:     #18120F;
  --ink-2:   #2A231E;
  --muted:   #756C64;
  --muted-2: #9A9189;
  --line:    #E9E3DA;
  --coal:    #15110E;
  --coal-2:  #1F1915;

  --ember:   #E8552D;
  --ember-2: #F59E0B;
  --ember-soft: #FBE9DF;

  --r-sm: 12px;
  --r:    18px;
  --r-lg: 26px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(24,18,15,.06), 0 1px 1px rgba(24,18,15,.04);
  --shadow:    0 2px 6px rgba(24,18,15,.06), 0 18px 40px -24px rgba(24,18,15,.30);
  --shadow-lg: 0 30px 70px -30px rgba(24,18,15,.40);

  --maxw: 1180px;
  --ease: cubic-bezier(.4, 0, .2, 1);

  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---- Typography ---- */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.02;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.kicker {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ember);
}
.lede { font-size: 19px; line-height: 1.55; color: var(--muted); }
.ember-text { color: var(--ember); }

/* underline mark behind a word */
.mark { position: relative; display: inline-block; white-space: nowrap; }
.mark::after {
  content: ""; position: absolute; left: -2px; right: -2px; bottom: 0.08em; height: 0.34em;
  background: linear-gradient(90deg, var(--ember), var(--ember-2));
  opacity: .22; border-radius: 4px; z-index: -1;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px; border-radius: var(--r-pill);
  font-weight: 700; font-size: 15.5px; letter-spacing: -0.01em;
  border: 1.5px solid transparent; transition: transform .14s var(--ease), box-shadow .2s var(--ease), background .2s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -14px rgba(24,18,15,.6); }
.btn-ember { background: linear-gradient(180deg, #F2683E, var(--ember)); color: #fff; box-shadow: 0 10px 22px -12px rgba(232,85,45,.8); }
.btn-ember:hover { transform: translateY(-2px); box-shadow: 0 18px 32px -14px rgba(232,85,45,.85); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--paper-2); border-color: var(--muted-2); }
.btn-lg { padding: 16px 28px; font-size: 16.5px; }

/* chips / badges */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 700; letter-spacing: .01em;
  background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line);
}
.badge-soon {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: var(--ember-soft); color: var(--ember); border: 1px solid #F6D3C2;
}
.badge-soon .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 4px rgba(232,85,45,.16); }

/* ============================================================
   NAVBAR  (sticky, translucent)
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(1.4) blur(14px);
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand .flame { width: 28px; height: 32px; }
.brand .name { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.brand .name b { color: var(--ember); font-weight: 700; }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link {
  position: relative; padding: 9px 14px; border-radius: 10px;
  font-weight: 600; font-size: 15px; color: var(--ink-2); transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--paper-2); }
.nav-cta { margin-left: 8px; }

/* dropdown */
.dd { position: relative; }
.dd-trigger { display: inline-flex; align-items: center; gap: 6px; }
.dd-trigger svg { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.dd.open .dd-trigger svg { transform: rotate(180deg); }
.dd-menu {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(-6px) scale(.98);
  width: 320px; padding: 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.dd.open .dd-menu { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0) scale(1); }
.dd-head { padding: 6px 10px 10px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); }
.dd-item { display: flex; align-items: center; gap: 13px; padding: 10px; border-radius: 13px; transition: background .14s; }
.dd-item:hover { background: var(--paper-2); }
.dd-item .ic { width: 44px; height: 44px; border-radius: 11px; object-fit: cover; border: 1px solid var(--line); flex: none; }
.dd-item .t { font-weight: 700; font-size: 15px; line-height: 1.2; }
.dd-item .s { font-size: 13px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.dd-empty { display: flex; align-items: center; gap: 12px; padding: 12px 10px; color: var(--muted-2); }
.dd-empty .ic { width: 44px; height: 44px; border-radius: 11px; border: 1.5px dashed var(--line); display: grid; place-items: center; flex: none; }

/* mobile nav button */
.nav-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); align-items: center; justify-content: center; }

/* ============================================================
   SECTION primitives
   ============================================================ */
.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }
.eyebrow-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.eyebrow-row .ln { height: 1px; flex: 1; background: var(--line); }

/* ---- App showcase card (portfolio) ---- */
.app-card {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 44px; box-shadow: var(--shadow); overflow: hidden; position: relative;
}
.app-card .meta { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.app-card .app-icon { width: 66px; height: 66px; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.app-card h3 { font-size: 34px; }
.app-card .cat { font-size: 14px; font-weight: 600; color: var(--muted); margin-top: 3px; }
.app-card p { color: var(--muted); font-size: 17px; margin: 0 0 26px; max-width: 44ch; }
.app-card .actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.app-card .stage {
  position: relative; align-self: stretch; min-height: 340px;
  border-radius: var(--r); display: flex; align-items: center; justify-content: center;
}

/* placeholder "coming" card */
.app-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 12px; padding: 54px; border: 1.5px dashed var(--line); border-radius: var(--r-lg);
  color: var(--muted-2); background: linear-gradient(180deg, var(--card), var(--paper));
}
.app-empty .pl-icon { width: 56px; height: 56px; border-radius: 15px; border: 1.5px dashed var(--muted-2); display: grid; place-items: center; }

/* ---- Principles ---- */
.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.principle .pi { width: 46px; height: 46px; border-radius: 13px; background: var(--ember-soft); display: grid; place-items: center; margin-bottom: 16px; }
.principle h4 { font-family: var(--font-display); font-size: 19px; margin: 0 0 7px; letter-spacing: -0.01em; }
.principle p { color: var(--muted); font-size: 15px; margin: 0; line-height: 1.55; }

/* ============================================================
   FOOTER
   ============================================================ */
.foot { background: var(--coal); color: #E7E1DA; padding: 70px 0 34px; margin-top: 40px; }
.foot a { color: #C9C2BA; transition: color .15s; }
.foot a:hover { color: #fff; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,.1); }
.foot .brand .name { color: #fff; }
.foot-bio { color: #9C958D; font-size: 15px; max-width: 34ch; margin: 18px 0 0; }
.foot-col h5 { font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: #8B847C; font-weight: 700; margin: 0 0 16px; font-family: var(--font-body); }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.foot-col li a { font-size: 15px; }
.foot-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 26px; gap: 16px; flex-wrap: wrap; }
.foot-bottom .legal { color: #847D75; font-size: 13.5px; line-height: 1.6; }

/* ============================================================
   DOC pages (privacy / terms / support)
   ============================================================ */
.doc-hero { padding: 64px 0 40px; border-bottom: 1px solid var(--line); }
.doc-layout { display: grid; grid-template-columns: 240px 1fr; gap: 56px; padding: 56px 0 90px; align-items: start; }
.doc-toc { position: sticky; top: 92px; }
.doc-toc h6 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); margin: 0 0 14px; font-weight: 700; }
.doc-toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.doc-toc a { display: block; padding: 7px 12px; border-radius: 9px; font-size: 14.5px; color: var(--muted); border-left: 2px solid transparent; transition: all .14s; }
.doc-toc a:hover { color: var(--ink); background: var(--paper-2); }
.doc-toc a.active { color: var(--ember); border-left-color: var(--ember); font-weight: 600; }

.doc-body { max-width: 720px; }
.doc-body h2 { font-size: 27px; margin: 46px 0 14px; scroll-margin-top: 92px; }
.doc-body h2:first-child { margin-top: 0; }
.doc-body h3 { font-size: 19px; margin: 28px 0 8px; font-family: var(--font-display); }
.doc-body p, .doc-body li { color: var(--ink-2); font-size: 16.5px; line-height: 1.72; }
.doc-body ul { padding-left: 22px; margin: 12px 0; }
.doc-body li { margin: 7px 0; }
.doc-body a.inline { color: var(--ember); font-weight: 600; border-bottom: 1px solid rgba(232,85,45,.35); }
.doc-body strong { color: var(--ink); font-weight: 700; }
.updated { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin-top: 16px; }

/* per-app callout block inside docs */
.app-note {
  border: 1px solid var(--line); border-left: 3px solid var(--ember);
  background: var(--card); border-radius: 0 14px 14px 0; padding: 18px 22px; margin: 16px 0;
}
.app-note .an-head { display: flex; align-items: center; gap: 11px; margin-bottom: 8px; }
.app-note .an-head img { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); }
.app-note .an-head b { font-family: var(--font-display); font-size: 16px; }
.app-note p { margin: 6px 0 0 !important; font-size: 15.5px !important; color: var(--muted) !important; }

/* tables in docs */
.doc-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; }
.doc-table th, .doc-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc-table th { font-weight: 700; color: var(--ink); background: var(--paper-2); }
.doc-table td { color: var(--muted); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
  .principles { grid-template-columns: repeat(2, 1fr); }
  .app-card { grid-template-columns: 1fr; gap: 30px; padding: 30px; }
  .app-card .stage { min-height: 300px; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .doc-layout { grid-template-columns: 1fr; gap: 24px; }
  .doc-toc { position: static; display: none; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .section { padding: 64px 0; }
  .wrap { padding: 0 20px; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-links.mobile-open {
    display: flex; position: absolute; top: 70px; left: 0; right: 0; flex-direction: column;
    align-items: stretch; gap: 4px; padding: 14px 20px 20px; background: var(--paper);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .nav-links.mobile-open .dd-menu { position: static; width: 100%; transform: none; opacity: 1; pointer-events: auto; box-shadow: none; border: 1px solid var(--line); margin-top: 6px; }
  .nav-links.mobile-open .dd:not(.open) .dd-menu { display: none; }
  .foot-grid { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
