/* ============================================
   lwriter — marketing site
   Tokens mirror the app (DESIGN.md / write0 ramp):
   neutral grays, #3182ce / #60a5fa accent,
   Georgia display + JetBrains Mono accents +
   Segoe UI card copy, fadeInUp-only motion. Calm.
   ============================================ */

@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/JetBrainsMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/JetBrainsMono-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #fafafa;
  --bg-raised: #ffffff;
  --bg-inset: #f5f5f5;
  --text: #171717;
  --text-secondary: #737373;
  --text-muted: #a3a3a3;
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  /* Brand cream #FFECB8. Too light to read as text on a white page, so
     light mode pairs it with a honey of the same hue for text accents;
     the cream itself does fills, buttons and dark-mode accents. */
  --cream: #ffecb8;
  --cream-hover: #f5df9d;
  --cream-ink: #2c2410;
  --accent: #8a6b17;
  --accent-soft: rgba(255, 236, 184, 0.55);
  --hover: rgba(0, 0, 0, 0.05);
  --shadow-window:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 12px 32px rgba(0, 0, 0, 0.08),
    0 32px 80px rgba(0, 0, 0, 0.07);
  --serif: Georgia, 'Times New Roman', serif;
  --mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
  --sans: 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
}

.dark {
  --bg: #171717;
  --bg-raised: #1f1f1f;
  --bg-inset: #262626;
  --text: #f5f5f5;
  --text-secondary: #a3a3a3;
  --text-muted: #6f6f6f;
  --border: #2a2a2a;
  --border-strong: #404040;
  --accent: #ffecb8;
  --accent-soft: rgba(255, 236, 184, 0.12);
  --hover: rgba(255, 255, 255, 0.06);
  --shadow-window:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 32px 80px rgba(0, 0, 0, 0.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  transition: background 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #ffecb8; color: #171717; }
.dark ::selection { background: #4d3f16; color: #f5f5f5; }

img { max-width: 100%; }

/* ---------- shared type ---------- */
h1, h2 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); }
h2 { font-size: clamp(2rem, 4.5vw, 3rem); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.lede {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--text-secondary);
  max-width: 38em;
}

.fineprint {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.9;
}
.fineprint a { color: var(--text-secondary); }
.fineprint a:hover { color: var(--accent); }

code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

kbd {
  font-family: var(--mono);
  font-size: 0.72em;
  color: var(--text-secondary);
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.15em 0.5em;
  margin: 0 0.12em;
  white-space: nowrap;
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* The official lwriter wordmark is set in Georgia, regular weight */
.wordmark {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

@keyframes blink { 50% { opacity: 0; } }

.nav-links {
  display: flex;
  gap: 1.6rem;
  margin: 0 auto;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-moon { display: none; }
.dark .icon-moon { display: block; }
.dark .icon-sun { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.3;
  text-decoration: none;
  text-align: center;
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease,
              color 0.15s ease, transform 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--cream);
  color: var(--cream-ink);
}
.btn-primary:hover { background: var(--cream-hover); }

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover { background: var(--hover); }

.btn-disabled {
  border-color: var(--border);
  color: var(--text-muted);
  background: transparent;
  cursor: default;
}

.btn-small { padding: 0.4rem 0.9rem; font-size: 0.75rem; background: var(--cream); color: var(--cream-ink); }
.btn-small:hover { background: var(--cream-hover); }

.btn-sub {
  font-size: 0.68rem;
  opacity: 0.75;
  margin-top: 0.2rem;
  font-weight: 400;
}

/* ---------- hero ---------- */
.hero {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(4rem, 10vh, 7rem) 1.5rem 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero h1 { margin-bottom: 1.4rem; }
.hero .lede { margin-bottom: 2.2rem; }

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}

/* ---------- app window mockup ---------- */
.window {
  width: min(52rem, 100%);
  margin: clamp(3rem, 7vh, 5rem) auto 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-window);
  overflow: hidden;
  text-align: left;
}

.window-titlebar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 2.4rem;
  padding: 0 0.4rem 0 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  user-select: none;
}

.tb-title { text-align: center; }
.tb-edited { color: var(--text-muted); }

.tb-controls {
  display: flex;
  justify-content: flex-end;
  gap: 0.2rem;
  color: var(--text-muted);
  font-size: 0.62rem;
}
.tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 1.7rem;
  border-radius: 6px;
}

.window-editor {
  min-height: 21rem;
  padding: 1.8rem clamp(1.2rem, 6%, 3.5rem) 2rem;
}

.editor-column {
  max-width: 34rem;
  margin: 0 auto;
  font-family: var(--mono);
  font-size: 0.92rem;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

/* markdown live-styling, mirrored from the app */
.md-h { font-weight: 700; }
.md-syn { color: var(--text-muted); }
.md-b { font-weight: 700; }
.md-i { font-style: italic; }
.md-code {
  background: var(--bg-inset);
  border-radius: 4px;
}
.md-q { color: var(--text-secondary); font-style: italic; }
.md-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.md-mark { color: var(--accent); }

.type-caret {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  margin-left: 1px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1.1s step-end infinite;
}

.window-statusbar {
  display: flex;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  user-select: none;
}

/* ---------- sections ---------- */
.section {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(5rem, 12vh, 8.5rem) 1.5rem 0;
  scroll-margin-top: 4rem;
}

.section > h2 { margin-bottom: 1rem; }

/* ---------- feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 3rem;
}

.feature {
  padding: 1.6rem 1.5rem 1.7rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.feature:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}
.dark .feature:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 1rem;
}
.feature-icon svg { width: 1.15rem; height: 1.15rem; }

/* Cards drop the serif entirely: mono titles (the app's settings-label
   voice) over Segoe body — the same UI font the app's chrome uses. */
.feature h3 {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.feature p {
  font-family: var(--sans);
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.feature p strong { font-weight: 600; }

/* ---------- showcase rows ---------- */
.showcase-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  padding: clamp(3rem, 8vh, 5.5rem) 0;
}
.showcase-row + .showcase-row { border-top: 1px solid var(--border); }

.showcase-flip .showcase-copy { order: 2; }
.showcase-flip .showcase-visual { order: 1; }

.showcase-copy h2 { margin-bottom: 1.2rem; }
.showcase-copy p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  max-width: 34em;
}

/* mini demo windows */
.mini-window {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-window);
  padding: 2rem 2.2rem;
  overflow: hidden;
}

/* focus/typewriter demo */
#focus-demo { padding: 2.6rem 2.2rem; }

.mini-lines {
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 2;
  transition: transform 0.7s cubic-bezier(0.3, 0, 0.2, 1);
}

.mini-lines p {
  opacity: 0.22;
  transition: opacity 0.45s ease;
}
.mini-lines p.fd-active { opacity: 1; }

/* vault tree demo */
.mini-sidebar { padding: 1.4rem 1.2rem 1.6rem; max-width: 21rem; margin-inline: auto; }

.ms-header {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 0 0.6rem 0.7rem;
}
.ms-count { font-weight: 400; color: var(--text-muted); letter-spacing: 0; }

.ms-tree { display: flex; flex-direction: column; }

.ms-dir {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  text-align: left;
  padding: 0.42rem 0.6rem;
  border-radius: 8px;
  cursor: default;
  transition: background 0.15s ease, color 0.15s ease;
}
.ms-dir:hover { background: var(--hover); color: var(--text); }

.ms-chev {
  display: inline-block;
  color: var(--text-muted);
  transition: transform 0.25s ease;
  transform: translateY(-1px);
}
.ms-dir.open .ms-chev { transform: rotate(90deg) translateX(-1px); }

.ms-children {
  max-height: 0;
  overflow: hidden;
  margin-left: 1.1rem;
  transition: max-height 0.45s ease;
}
.ms-children.open { max-height: 14rem; }

.ms-note {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.42rem 0.6rem;
  border-radius: 8px;
  transition: background 0.2s ease;
}
.ms-note.ms-current { background: var(--hover); }

.ms-note-name {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
}
.ms-note-date {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--text-muted);
}

/* image demo */
#image-demo { display: flex; flex-direction: column; gap: 1.3rem; }

.id-source {
  font-family: var(--mono);
  font-size: 0.88rem;
}

.id-preview {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}

.id-photo {
  height: 11rem;
  background:
    radial-gradient(120% 90% at 20% 100%, rgba(23, 23, 23, 0.35), transparent 55%),
    radial-gradient(80% 80% at 78% 30%, rgba(255, 244, 214, 0.9), transparent 60%),
    linear-gradient(180deg, #aac4de 0%, #e8c8a0 55%, #b57f56 100%);
}

.id-caption {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  padding: 0.6rem 0.9rem;
}

/* ---------- shortcuts ---------- */
.kbd-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 3rem;
  margin-top: 2.6rem;
  max-width: 56rem;
}

.kbd-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 0.2rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.kbd-row kbd { font-size: 0.68rem; }

/* ---------- philosophy ---------- */
.philosophy-inner {
  max-width: 46rem;
  margin: 0 auto;
  text-align: center;
}

.philosophy blockquote {
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  line-height: 1.6;
  color: var(--text);
  font-style: italic;
}
.philosophy blockquote em { color: var(--accent); font-style: italic; }

.philosophy-attr {
  margin-top: 1.6rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- download ---------- */
.download {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: clamp(5rem, 12vh, 8rem);
}
.download .lede { margin: 0.8rem 0 0; }
.download .fineprint { margin-top: 1.8rem; }

/* three platforms, in the same card language as the features */
.dl-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 16.5rem));
  justify-content: center;
  gap: 1rem;
  margin-top: 2.6rem;
  width: 100%;
}

.dl-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 1.9rem 1.5rem 1.7rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.dl-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}
.dark .dl-card:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }

.dl-os {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
}

.dl-glyph { width: 1.05rem; height: 1.05rem; color: var(--accent); }

.dl-req {
  font-family: var(--sans);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-secondary);
  flex: 1;
}

.dl-card .btn { align-self: stretch; }

.dl-soon .dl-os,
.dl-soon .dl-glyph,
.dl-soon .dl-req { color: var(--text-muted); }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 3.5rem 1.5rem 2.5rem;
}

.footer-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  flex-wrap: wrap;
}

.footer .wordmark { font-size: 1.1rem; }
.footer-tag {
  font-family: var(--serif);
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.4rem;
}

.footer-cols { display: flex; gap: 4rem; }

.footer-h {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.footer-cols a {
  display: block;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.22rem 0;
  transition: color 0.15s ease;
}
.footer-cols a:hover { color: var(--text); }

.footer-legal {
  max-width: 72rem;
  margin: 2.8rem auto 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.9;
}

/* ---------- reveal animation (fadeInUp, the app's one vocabulary) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ---------- responsive ---------- */
@media (max-width: 56rem) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .showcase-row { grid-template-columns: 1fr; }
  .showcase-flip .showcase-copy { order: 1; }
  .showcase-flip .showcase-visual { order: 2; }
  .kbd-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .dl-grid { grid-template-columns: minmax(0, 22rem); }
}

@media (max-width: 36rem) {
  .feature-grid { grid-template-columns: 1fr; }
  .window-editor { min-height: 17rem; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .caret-tick, .type-caret { animation: none; }
  .mini-lines, .ms-chev, .ms-children { transition: none; }
}
