/* ==========================================================================
   BriefEasy — briefeasy.app
   Design system mirrors the app: paper/ink light, warm charcoal dark,
   coral signal accent, Inter + IBM Plex Mono (self-hosted), sharp edges,
   1px borders, flat (no shadows).
   ========================================================================== */

:root {
  /* Light — paper */
  --bg: #F7F7F4;
  --surface: #FFFFFF;
  --well: #EDEDE8;
  --ink: #161614;
  --text: #1E1E1B;
  --muted: #6B6B64;
  --hairline: #E2E2DB;
  --accent: #ff8663;
  --accent-text: #d95a38;          /* readable coral on paper */
  --on-accent: #161410;
  --accent-soft: rgba(255, 134, 99, 0.14);
  --paper-doc: #FFFFFF;            /* the letter artifact */
  --paper-doc-line: #C9C9C2;
  --ink-block: #161614;            /* stays ink in both modes (app rule) */
  --on-ink: #F7F7F4;
  --on-ink-muted: rgba(247, 247, 244, 0.64);
  --btn-dark: #3a3a38;             /* secondary button, same in both modes */
  --on-btn-dark: #F7F7F4;
}

[data-theme="dark"] {
  /* Dark — warm charcoal */
  --bg: #20201f;
  --surface: #2c2c2a;
  --well: #383836;
  --ink: #F4F4F1;
  --text: #E9E9E4;
  --muted: #A3A39B;
  --hairline: #3d3d3a;
  --accent: #ff8663;
  --accent-text: #ff8663;
  --on-accent: #161410;
  --accent-soft: rgba(255, 134, 99, 0.12);
  --paper-doc: #383836;
  --paper-doc-line: #55554f;
  --ink-block: #161614;
  --on-ink: #F7F7F4;
  --on-ink-muted: rgba(247, 247, 244, 0.64);
  --btn-dark: #3a3a38;
  --on-btn-dark: #F7F7F4;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

.mono {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* --------------------------------------------------------------------------
   Brand mark — faithful port of the app's BrandMark.tsx:
   a coral letter peeks from behind an ink brief; on the front sheet the top
   line is highlighted in coral (the one action the app extracts), the rest
   stays muted. Same proportions as the app (82% sheets, 20% pad).
   -------------------------------------------------------------------------- */
.brandmark {
  position: relative;
  width: 30px; height: 30px;
  flex: none;
}
.brandmark::before {             /* coral letter peeking from behind (top-right) */
  content: "";
  position: absolute; top: 0; right: 0;
  width: 82%; height: 82%;
  background: var(--accent);
}
.brandmark .sheet {              /* ink brief on top (bottom-left) */
  position: absolute; bottom: 0; left: 0;
  width: 82%; height: 82%;
  background: var(--ink);
  overflow: hidden;
}
.brandmark .sheet i { position: absolute; background: var(--bg); opacity: 0.75; }
.brandmark .sheet i:nth-child(1) {   /* the surfaced action — coral */
  top: 20%; left: 20%; width: 49%; height: 15%;
  background: var(--accent); opacity: 1;
}
.brandmark .sheet i:nth-child(2) { top: 46%; left: 20%; width: 55%; height: 9%; }
.brandmark .sheet i:nth-child(3) { top: 63%; left: 20%; width: 40%; height: 9%; }

/* --------------------------------------------------------------------------
   Nav
   -------------------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--hairline);
  transition: background 0.25s ease;
}
.nav-inner {
  display: flex; align-items: center; gap: 24px;
  height: 68px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); font-weight: 700; font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.nav-logo:hover { text-decoration: none; }
.nav-logo .dot { color: var(--accent); }
.nav-links { display: flex; gap: 24px; margin-left: 12px; }
.nav-links a {
  color: var(--muted); font-size: 0.9rem; font-weight: 500;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-spacer { flex: 1; }

.lang-switch { display: flex; border: 1px solid var(--hairline); }
.lang-switch a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.08em;
  padding: 6px 10px;
  color: var(--muted);
}
.lang-switch a:hover { text-decoration: none; color: var(--ink); }
.lang-switch a[aria-current="true"] {
  background: var(--ink); color: var(--bg);
  pointer-events: none;
}

/* Sun / moon segmented theme switch */
.theme-switch { display: flex; border: 1px solid var(--hairline); }
.theme-switch button {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 30px;
  background: none; border: 0; cursor: pointer;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.theme-switch button svg {
  width: 15px; height: 15px;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.theme-switch button[aria-pressed="true"] {
  background: var(--ink); color: var(--bg);
  cursor: default;
}
.theme-switch button:not([aria-pressed="true"]):hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 600; font-size: 0.92rem;
  padding: 12px 22px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.btn:hover { text-decoration: none; opacity: 0.9; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-secondary { background: var(--btn-dark); color: var(--on-btn-dark); }
.btn-sm { padding: 9px 16px; font-size: 0.85rem; }

/* --------------------------------------------------------------------------
   Hero (entrance choreography on load)
   -------------------------------------------------------------------------- */
.hero { padding: 88px 0 104px; overflow: hidden; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: 64px; align-items: center;
}
.eyebrow { color: var(--accent-text); margin-bottom: 20px; display: block; }
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700; line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.hero p.lede {
  margin-top: 22px; font-size: 1.08rem; color: var(--muted);
  max-width: 34rem;
}
.hero-ctas { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }
.store-note {
  margin-top: 18px; display: flex; gap: 10px; align-items: center;
  color: var(--muted);
}
.store-note .mono { letter-spacing: 0.08em; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}
.hero .eyebrow, .hero h1, .hero .lede, .hero-ctas, .store-note {
  opacity: 0;
  animation: fadeUp 0.7s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
}
.hero .eyebrow  { animation-delay: 0.05s; }
.hero h1        { animation-delay: 0.14s; }
.hero .lede     { animation-delay: 0.24s; }
.hero-ctas      { animation-delay: 0.34s; }
.store-note     { animation-delay: 0.44s; }
.artifact {
  opacity: 0;
  animation: fadeUp 0.8s cubic-bezier(0.2, 0.6, 0.2, 1) 0.3s forwards;
}

/* --- The letter artifact (signature element) --- */
.artifact { position: relative; display: flex; justify-content: center; }
.letter {
  position: relative;
  width: min(330px, 78vw);
  aspect-ratio: 0.72;
  background: var(--paper-doc);
  border: 1px solid var(--hairline);
  padding: 26px 24px;
  overflow: hidden;
}
.letter::after {                 /* coral folded corner */
  content: "";
  position: absolute; top: 0; right: 0;
  border-top: 40px solid var(--accent);
  border-left: 40px solid transparent;
}
.letter .sender { color: var(--muted); margin-bottom: 4px; }
.letter .az { color: var(--muted); margin-bottom: 18px; }
.letter .subject {
  font-weight: 600; font-size: 0.85rem; color: var(--ink);
  margin-bottom: 14px;
}
.letter .line {
  height: 7px; background: var(--paper-doc-line);
  margin-bottom: 9px;
}
.letter .line.w60 { width: 60%; } .letter .line.w85 { width: 85%; }
.letter .line.w75 { width: 75%; } .letter .line.w90 { width: 90%; }
.letter .line.w50 { width: 50%; } .letter .line.w80 { width: 80%; }
.letter .line.gap { margin-top: 18px; }

.beam {
  position: absolute; left: 0; right: 0; top: 0;
  height: 3px; background: var(--accent);
  animation: sweep 3.4s ease-in-out infinite;
}
@keyframes sweep {
  0%   { top: 6%;  opacity: 0; }
  8%   { opacity: 1; }
  46%  { top: 92%; opacity: 1; }
  54%  { top: 92%; opacity: 1; }
  92%  { top: 6%;  opacity: 1; }
  100% { top: 6%;  opacity: 0; }
}

/* Result card resolving out of the letter */
.result-card {
  position: absolute; right: -8%; bottom: -34px;
  width: min(300px, 84vw);
  background: var(--surface);
  border: 1px solid var(--hairline);
  padding: 18px 20px;
}
.result-card .rc-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.result-card .rc-title { font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.stamp {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-text);
  border: 1px solid var(--accent);
  padding: 3px 7px;
  flex: none;
}
.result-card ul { list-style: none; }
.result-card li {
  font-size: 0.82rem; color: var(--muted);
  padding-left: 16px; position: relative; margin-bottom: 7px;
  opacity: 0; animation: rise 0.5s ease forwards;
}
.result-card li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 7px; height: 7px; background: var(--accent);
}
.result-card li:nth-child(1) { animation-delay: 0.9s; }
.result-card li:nth-child(2) { animation-delay: 1.3s; }
.result-card li:nth-child(3) { animation-delay: 1.7s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Sections — no separator lines; rhythm comes from spacing and motion
   -------------------------------------------------------------------------- */
.section { padding: 84px 0; }
.section-head { max-width: 40rem; margin-bottom: 52px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.15;
  color: var(--ink);
  margin-top: 14px;
}
.section-head p { margin-top: 14px; color: var(--muted); }

/* Language marquee — a continuous band of the 11 app languages */
.lang-section { padding: 36px 0 40px; }
.lang-section .section-head { margin-bottom: 34px; }
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex; gap: 0;
  width: max-content;
  animation: marquee 36s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.35rem;
  color: var(--ink);
  white-space: nowrap;
  padding-right: 18px;
}
.marquee-track span::after {
  content: "·";
  color: var(--accent);
  padding-left: 18px;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Steps — a real sequence, numbers earn their place */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); }
.step { background: var(--surface); padding: 34px 28px; transition: background 0.25s ease; }
.step:hover { background: var(--well); }
.step .num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.12em;
  color: var(--accent-text);
}
.step h3 { margin-top: 14px; font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.step p { margin-top: 8px; font-size: 0.92rem; color: var(--muted); }

/* Feature grid */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.feature {
  background: var(--surface);
  border: 1px solid var(--hairline);
  padding: 30px 28px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.feature:hover { border-color: var(--accent); transform: translateY(-3px); }
.feature .icon {
  width: 40px; height: 40px;
  border: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.feature .icon svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; stroke-width: 1.6; }
.feature h3 { font-size: 1.02rem; font-weight: 600; color: var(--ink); }
.feature p { margin-top: 8px; font-size: 0.92rem; color: var(--muted); }

/* Privacy — ink block, same in both modes (app rule) */
.privacy-block {
  background: var(--ink-block);
  border: 1px solid var(--ink-block);
  padding: 60px 56px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
}
.privacy-block h2 {
  color: var(--on-ink);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.15;
  margin-top: 14px;
}
.privacy-block .eyebrow { color: var(--accent); }
.privacy-block p { color: var(--on-ink-muted); margin-top: 14px; font-size: 0.95rem; }
.privacy-list { list-style: none; display: grid; gap: 16px; align-content: center; }
.privacy-list li {
  color: var(--on-ink);
  font-size: 0.95rem;
  padding: 14px 16px;
  border: 1px solid rgba(247, 247, 244, 0.18);
  display: flex; gap: 12px; align-items: baseline;
  transition: border-color 0.25s ease;
}
.privacy-list li:hover { border-color: var(--accent); }
.privacy-list li::before {
  content: "→"; color: var(--accent);
  font-family: 'IBM Plex Mono', monospace;
}

/* Pricing — centered */
.plans {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
  max-width: 820px; margin: 0 auto;
}
.plan {
  background: var(--surface); border: 1px solid var(--hairline); padding: 34px 30px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.plan:hover { transform: translateY(-3px); }
.plan.featured { border-color: var(--accent); border-width: 2px; }
.plan:not(.featured):hover { border-color: var(--muted); }
.plan .plan-name { font-weight: 600; font-size: 1.05rem; color: var(--ink); }
.plan .plan-price {
  margin-top: 6px; color: var(--muted); font-size: 0.88rem;
}
.plan ul { list-style: none; margin-top: 22px; display: grid; gap: 10px; }
.plan li {
  font-size: 0.92rem; color: var(--muted);
  padding-left: 18px; position: relative;
}
.plan li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 8px; height: 8px; background: var(--accent);
}
.plan .btn { margin-top: 26px; width: 100%; }

/* FAQ — centered */
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  border: 1px solid var(--hairline); background: var(--surface); margin-bottom: 12px;
  transition: border-color 0.25s ease;
}
.faq details:hover { border-color: var(--muted); }
.faq details[open] { border-color: var(--accent); }
.faq summary {
  cursor: pointer; list-style: none;
  padding: 18px 22px;
  font-weight: 600; font-size: 0.96rem; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: 'IBM Plex Mono', monospace;
  color: var(--accent-text);
  font-size: 1rem;
  flex: none;
}
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 22px 20px; color: var(--muted); font-size: 0.92rem; }

/* Download band */
.download-band { text-align: center; padding: 96px 0 104px; }
.download-band h2 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700; letter-spacing: -0.025em; color: var(--ink);
  margin-top: 18px;
}
.download-band p { margin-top: 14px; color: var(--muted); }
.badges { margin-top: 34px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.badge {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  padding: 12px 20px;
  color: var(--ink);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.badge:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.badge svg { width: 20px; height: 20px; fill: var(--ink); }
.badge .b-label { text-align: left; line-height: 1.2; }
.badge .b-label .mono { display: block; color: var(--muted); font-size: 0.6rem; }
.badge .b-label b { font-size: 0.92rem; font-weight: 600; }
.contact-line { margin-top: 30px; color: var(--muted); font-size: 0.9rem; }

/* Footer */
.footer { border-top: 1px solid var(--hairline); padding: 44px 0; }
.footer-inner {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.footer .nav-logo { font-size: 0.95rem; }
.footer .brandmark { width: 24px; height: 24px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; margin-left: auto; }
.footer-links a { color: var(--muted); font-size: 0.85rem; }
.footer-links a:hover { color: var(--ink); }
.footer .copyright {
  width: 100%; margin-top: 18px;
  color: var(--muted); font-size: 0.78rem;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Legal pages (document layout — fitting for an app about documents)
   -------------------------------------------------------------------------- */
.doc { max-width: 720px; margin: 0 auto; padding: 72px 24px 110px; }
.doc-head { border-bottom: 1px solid var(--hairline); padding-bottom: 28px; margin-bottom: 40px; }
.doc-head h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 700;
  letter-spacing: -0.02em; color: var(--ink); margin-top: 12px;
}
.doc-head .updated { margin-top: 10px; color: var(--muted); }
.doc h2 {
  font-size: 1.15rem; font-weight: 600; color: var(--ink);
  margin: 40px 0 12px;
  display: flex; gap: 12px; align-items: baseline;
}
.doc h2 .no {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem; color: var(--accent-text); letter-spacing: 0.1em;
}
.doc p, .doc li { color: var(--text); font-size: 0.95rem; }
.doc p { margin-bottom: 12px; }
.doc ul { margin: 0 0 12px 20px; }
.doc li { margin-bottom: 6px; }
.doc .placeholder {
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  padding: 2px 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
}
.doc .note {
  border: 1px solid var(--hairline);
  background: var(--surface);
  padding: 16px 18px;
  color: var(--muted); font-size: 0.88rem;
  margin: 28px 0;
}

/* --------------------------------------------------------------------------
   Reveal on scroll (containers and staggered children, driven by main.js)
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.2, 0.6, 0.2, 1),
              transform 0.65s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .beam, .result-card li, .marquee-track,
  .hero .eyebrow, .hero h1, .hero .lede, .hero-ctas, .store-note, .artifact {
    animation: none;
  }
  .result-card li,
  .hero .eyebrow, .hero h1, .hero .lede, .hero-ctas, .store-note, .artifact {
    opacity: 1;
  }
  .marquee-track { flex-wrap: wrap; width: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .feature:hover, .plan:hover, .badge:hover { transform: none; }
}

/* Focus visibility */
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .hero { padding-top: 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 72px; }
  .artifact { margin-top: 8px; }
  .result-card { right: 0; }
  .steps { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .privacy-block { grid-template-columns: 1fr; padding: 40px 28px; }
  .plans { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .marquee-track span { font-size: 1.1rem; }
}

@media (max-width: 560px) {
  /* The hero CTA sits right below; the nav button doesn't fit and is redundant. */
  .nav-inner { gap: 14px; }
  .nav-inner > .btn { display: none; }
}
