/* Highwatch site. Tokens match the desktop app (src/styles.css in the app repo).
   Dark only, like the app. Radius scale: controls 6px, surfaces 10px, chips full. */
@font-face { font-family: 'Inter Variable'; src: url('/assets/fonts/inter-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/assets/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/assets/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #121113;
  --bg-raised: #171618;
  --panel: #1c1a1d;
  --panel-2: #211f22;
  --line: #2d2a2e;
  --line-strong: #3a363b;
  --text: #f4f1f0;
  --text-2: #d2cccf;
  --muted: #b8b1b7;
  --subtle: #9b949b;
  --accent: #ff9469;
  --accent-ink: #211f22;
  --accent-tint: #332a24;
  --warn: #f2c14e;
  --danger: #f26b5b;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --r-control: 6px;
  --r-surface: 10px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --wrap: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Inter Variable', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px; line-height: 1.6; font-synthesis: none; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
::selection { background: #5c565c; color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.icon { width: 1.1em; height: 1.1em; fill: currentColor; flex-shrink: 0; }
.mono { font-family: var(--mono); }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: var(--r-control); font-weight: 600; }
.skip:focus { top: 12px; }

/* Type */
h1 { font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.04; letter-spacing: -0.035em; font-weight: 650; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); line-height: 1.08; letter-spacing: -0.03em; font-weight: 640; max-width: 22ch; }
h3 { font-size: 1.05rem; line-height: 1.35; letter-spacing: -0.01em; font-weight: 600; }
.lede { font-size: 1.15rem; line-height: 1.6; color: var(--muted); max-width: 44ch; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 20px; }
.fine { font-size: .9rem; color: var(--subtle); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  height: 46px; padding: 0 20px; border-radius: var(--r-control);
  font-size: .95rem; font-weight: 600; letter-spacing: -0.005em;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .12s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #ffa784; }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: #5c565c; background: var(--panel-2); }
.btn-ghost .icon { color: var(--muted); }
.btn-sm { height: 38px; padding: 0 14px; font-size: .875rem; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(18, 17, 19, .82); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--line); }
.nav-inner { height: 68px; display: flex; align-items: center; gap: 40px; }
.nav-logo img { width: 150px; height: auto; }
.nav-links { display: flex; gap: 28px; margin-right: auto; font-size: .92rem; color: var(--muted); }
.nav-links a { transition: color .2s; }
.nav-links a:hover { color: var(--text); }

/* Hero */
.hero { position: relative; padding: 88px 0 96px; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 30% -10% auto -10%; height: 1100px; background: radial-gradient(closest-side, rgba(255, 148, 105, .10), transparent 70%); pointer-events: none; }
.hero-copy { position: relative; max-width: 760px; }
.hero h1 { max-width: 18ch; }
.hero .lede { margin-top: 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-shot { position: relative; margin-top: 64px; }
.window { border: 1px solid var(--line-strong); border-radius: var(--r-surface); overflow: hidden; background: var(--bg-raised); box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .02) inset; }
/* window */
.hero-shot .window { animation: rise 1s var(--ease) .1s both; }
@keyframes rise { from { opacity: 0; transform: translateY(28px) scale(.985); } to { opacity: 1; transform: none; } }

/* Sections */
section { padding: 104px 0; }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head p { margin-top: 18px; color: var(--muted); font-size: 1.08rem; max-width: 52ch; }

/* Flow */
.flow { padding-top: 40px; border-top: 1px solid var(--line); background: linear-gradient(180deg, var(--bg-raised), var(--bg) 60%); }
.flow h2 { padding-top: 72px; max-width: 18ch; }
.flow-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 48px; border: 1px solid var(--line-strong); border-radius: var(--r-surface); background: var(--panel); }
.flow-step { position: relative; padding: 32px 32px 36px; }
.flow-step + .flow-step { border-left: 1px solid var(--line-strong); }
.flow-step + .flow-step::before { content: ''; position: absolute; left: -9px; top: 46px; width: 16px; height: 16px; border-top: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong); background: var(--panel); transform: rotate(45deg); }
.flow-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r-control); background: var(--accent-tint); color: var(--accent); font-size: 22px; margin-bottom: 22px; }
.flow-step p { margin-top: 8px; color: var(--muted); font-size: .95rem; }

/* Map */
.wide-shot { border: 1px solid var(--line-strong); border-radius: var(--r-surface); overflow: hidden; background: var(--bg-raised); }
.map-points { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px; margin-top: 48px; }
.map-points .icon { color: var(--accent); font-size: 22px; margin-bottom: 14px; }
.map-points p { margin-top: 6px; color: var(--muted); font-size: .93rem; }

/* Split sections */
.split { background: var(--bg-raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.split-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: 56px; align-items: center; }
.split-reverse { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.split-copy > p { margin-top: 22px; color: var(--muted); font-size: 1.05rem; }
.split-shot { border: 1px solid var(--line-strong); border-radius: var(--r-surface); overflow: hidden; background: var(--bg-raised); box-shadow: 0 30px 90px -40px rgba(0, 0, 0, .8); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 22px; }
.chips li { font-size: .82rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text-2); background: var(--panel); }

/* Feature rows: each row's columns are sized by its screenshots' aspect ratios (set inline),
   so both images show whole, uncropped, at the same height. */
.feature-rows { display: grid; gap: 20px; }
.feature-row { display: grid; gap: 20px; align-items: start; }
.feature { display: flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: var(--r-surface); background: var(--panel); overflow: hidden; transition: border-color .25s var(--ease); }
.feature:hover { border-color: #4a4549; }
.feature-shot { border-bottom: 1px solid var(--line-strong); background: var(--bg); }
.feature-copy { display: flex; gap: 14px; padding: 22px 24px 24px; }
.feature-copy .icon { color: var(--accent); font-size: 22px; margin-top: 1px; }
.feature-copy p { margin-top: 6px; color: var(--muted); font-size: .93rem; max-width: 60ch; }
.feature-more { display: flex; align-items: center; gap: 12px; margin-top: 28px; color: var(--muted); font-size: .95rem; }
.feature-more .icon { color: var(--accent); font-size: 20px; }
code { font-family: var(--mono); font-size: .88em; padding: 2px 6px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); }

/* Click to enlarge */
.zoom { display: block; position: relative; cursor: zoom-in; }
.zoom img { width: 100%; height: auto; }
.zoom::after { content: ''; position: absolute; inset: 0; background: rgba(255, 148, 105, 0); transition: background .2s var(--ease); }
.zoom:hover::after { background: rgba(255, 148, 105, .04); }
.lightbox { padding: 0; border: 0; background: transparent; max-width: min(96vw, 2000px); max-height: 94dvh; }
.lightbox::backdrop { background: rgba(10, 9, 11, .88); backdrop-filter: blur(4px); }
.lightbox img { display: block; max-width: min(96vw, 2000px); max-height: 94dvh; width: auto; height: auto; border-radius: var(--r-surface); border: 1px solid var(--line-strong); }
.lightbox button { position: fixed; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); font-size: 20px; cursor: pointer; display: grid; place-items: center; }

/* Discord */
.discord { border-top: 1px solid var(--line); }
.feature-list { display: grid; gap: 22px; margin-top: 34px; }
.feature-list dt { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.feature-list dt .icon { color: var(--accent); font-size: 19px; }
.feature-list dd { margin: 4px 0 0 29px; color: var(--muted); font-size: .95rem; }
.embed-stack { display: grid; gap: 14px; padding: 28px; border-radius: var(--r-surface); background: #1a1a1e; border: 1px solid var(--line-strong); }
.embed { display: flex; border-radius: 4px; background: #232227; overflow: hidden; }
.embed-bar { width: 4px; background: var(--accent); flex-shrink: 0; }
.embed-danger .embed-bar { background: var(--danger); }
.embed-warn .embed-bar { background: var(--warn); }
.embed-body { padding: 12px 16px 14px; min-width: 0; }
.embed-author { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; margin-bottom: 6px; }
.embed-author img { width: 20px; height: 20px; border-radius: 50%; }
.embed-title { font-weight: 650; font-size: .95rem; }
.embed-desc { font-size: .88rem; color: var(--text-2); margin-top: 2px; }
.embed-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; margin-top: 12px; font-size: .88rem; }
.embed-fields span { display: block; font-size: .78rem; font-weight: 650; color: var(--text); }
.embed-fields div { color: var(--text-2); }
.embed-foot { margin-top: 12px; font-size: .74rem; color: var(--subtle); }
.embed-caption { font-size: .8rem; color: var(--subtle); }

/* Principles */
.principles { background: var(--bg-raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.principle-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 48px; margin-top: 56px; }
.principle-grid > div { padding-top: 24px; border-top: 1px solid var(--line-strong); }
.principle-grid .icon { color: var(--accent); font-size: 22px; margin-bottom: 14px; }
.principle-grid p { margin-top: 8px; color: var(--muted); font-size: .93rem; }

/* Releases teaser */
.releases-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 36px; }
.release-grid { display: grid; border-top: 1px solid var(--line-strong); }
.release-card { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: 8px 40px; align-items: baseline; padding: 28px 4px; border-bottom: 1px solid var(--line); transition: background .2s var(--ease); }
.release-card:hover { background: rgba(255, 255, 255, .015); }
.release-card:hover .release-link { color: var(--accent); }
.release-meta { grid-row: 1 / span 2; display: flex; flex-direction: column; gap: 2px; font-size: .85rem; color: var(--subtle); }
.release-meta .mono { color: var(--accent); font-size: .95rem; }
.release-card h3 { grid-column: 2; }
.release-card p { grid-column: 2; color: var(--muted); font-size: .93rem; max-width: 70ch; }
.release-link { grid-column: 3; grid-row: 1 / span 2; align-self: center; display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--muted); transition: color .2s; }

/* CTA */
.cta { padding: 120px 0; border-top: 1px solid var(--line); background: radial-gradient(60% 90% at 50% 0%, rgba(255, 148, 105, .09), transparent 70%); }
.cta-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cta-mark { width: 64px; margin-bottom: 28px; }
.cta h2 { max-width: 24ch; }
.cta p { margin: 18px 0 32px; color: var(--muted); font-size: 1.08rem; max-width: 48ch; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 48px 0 56px; }
.footer-inner { display: grid; grid-template-columns: auto 1fr; gap: 24px 48px; align-items: start; }
.footer-brand p { margin-top: 10px; font-size: .88rem; color: var(--subtle); }
.footer-links { display: flex; gap: 28px; justify-content: flex-end; font-size: .9rem; color: var(--muted); }
.footer-links a:hover { color: var(--text); }
.footer-legal { grid-column: 1 / -1; font-size: .78rem; color: #807a80; max-width: 90ch; line-height: 1.6; }

/* Changelog page */
.changelog-hero { padding: 96px 0 40px; }
.changelog-hero .lede { margin-top: 20px; max-width: 56ch; }
.changelog-list { padding-top: 24px; }
.release { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; padding: 48px 0; border-top: 1px solid var(--line); }
.release-head { position: sticky; top: 100px; align-self: start; }
.release-version { display: flex; flex-direction: column; gap: 4px; }
.release-version a { font-size: 1.15rem; color: var(--accent); font-weight: 500; }
.release-version time { font-size: .88rem; color: var(--subtle); }
.release-reqs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.req { font-family: var(--mono); font-size: .75rem; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text-2); }
.req span { color: var(--subtle); }
.release-body h2 { font-size: 1.6rem; max-width: none; }
.release-summary { margin-top: 10px; color: var(--muted); font-size: 1.02rem; max-width: 68ch; }
.release-section { margin-top: 30px; font-family: var(--mono); font-size: .76rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--subtle); }
.release-new { color: var(--accent); }
.release-body ul { margin-top: 12px; display: grid; gap: 10px; max-width: 74ch; }
.release-body li { position: relative; padding-left: 20px; color: var(--text-2); font-size: .96rem; }
.release-body li::before { content: ''; position: absolute; left: 2px; top: .7em; width: 7px; height: 1px; background: var(--subtle); }

.notfound { padding: 160px 0; min-height: 60dvh; }
.notfound .lede { margin: 20px 0 32px; }

/* Reveal motion. Only active when JS opted in and motion is allowed. */
.js-reveal .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js-reveal .reveal.in { opacity: 1; transform: none; }
.js-reveal .map-points .reveal:nth-child(2), .js-reveal .principle-grid .reveal:nth-child(2), .js-reveal .flow-step:nth-child(2) { transition-delay: .08s; }
.js-reveal .map-points .reveal:nth-child(3), .js-reveal .principle-grid .reveal:nth-child(3), .js-reveal .flow-step:nth-child(3) { transition-delay: .16s; }
.js-reveal .map-points .reveal:nth-child(4), .js-reveal .principle-grid .reveal:nth-child(4) { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* window */
.hero-shot .window { animation: none; }
  .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
}

/* Tablet */
@media (max-width: 1080px) {
  .split-grid, .split-reverse { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .map-points, .principle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Phone */
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  section { padding: 72px 0; }
  .nav-inner { gap: 16px; height: 60px; }
  .nav-links { display: none; }
  .nav-logo { margin-right: auto; }
  .nav-logo img { width: 124px; }
  .hero { padding: 56px 0 64px; }
  .flow h2 { padding-top: 40px; }
  .flow-steps { grid-template-columns: minmax(0, 1fr); }
  .flow-step + .flow-step { border-left: 0; border-top: 1px solid var(--line-strong); }
  .flow-step + .flow-step::before { left: 34px; top: -9px; transform: rotate(135deg); }
  .map-points, .principle-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .feature-row { grid-template-columns: minmax(0, 1fr) !important; }
  .hero-shot { margin-top: 40px; }
  .feature-more { align-items: flex-start; }
  .embed-stack { padding: 16px; }
  .embed-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .releases-head { flex-direction: column; align-items: flex-start; }
  .release-card { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .release-meta, .release-card h3, .release-card p, .release-link { grid-column: 1; grid-row: auto; }
  .release-link { margin-top: 6px; }
  .release { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 36px 0; }
  .release-head { position: static; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .footer-links { justify-content: flex-start; }
}
