/* NoteDrifter website: shared type, chrome and motion.
   Matches the desktop app: EB Garamond text, Poiret One display, a black and white interface, hairline glass,
   and the app's spring easing. Motion follows the app's theme: things drift and fall into place like notes. */

@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('assets/fonts/EBGaramond-latin.woff2') format('woff2'); }
@font-face { font-family: 'Poiret One'; font-style: normal; font-weight: 400; font-display: swap; src: url('assets/fonts/PoiretOne-latin.woff2') format('woff2'); }

:root {
  color-scheme: dark;
  interpolate-size: allow-keywords;
  --body: 'EB Garamond', Garamond, 'Times New Roman', serif;
  --display: 'Poiret One', 'Century Gothic', 'Avenir Next', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --ink: #fff;
  --text: rgba(255, 255, 255, .86);
  --muted: rgba(255, 255, 255, .68);
  --soft: rgba(255, 255, 255, .5);
  --hairline: rgba(255, 255, 255, .14);
  --line: rgba(255, 255, 255, .26);
  --line-strong: rgba(255, 255, 255, .55);
  --surface: rgba(255, 255, 255, .035);
  --surface-hover: rgba(255, 255, 255, .07);
  --surface-strong: rgba(255, 255, 255, .11);
  --glow: 0 0 24px rgba(255, 255, 255, .22);
  --r-card: 18px;
  --r-ctl: 12px;
  --header-h: 64px;
  /* the app's spring: a quick settle with one soft overshoot */
  --spring: linear(0, .009, .035 2.1%, .141, .281 6.7%, .723 12.9%, .938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, .991, .977 51%, .974 53.8%, .975 57.1%, .997 69.8%, 1.003 76.9%, 1);
  --out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: #000; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  margin: 0; min-height: 100vh; background: #000; color: var(--ink); overflow-x: clip;
  font: 400 19px/1.6 var(--body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-kerning: normal;
}
a { color: inherit; text-decoration: none; }
p { color: var(--muted); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a, label[for], summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
::selection { background: #fff; color: #000; }
img, svg, canvas { max-width: 100%; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Hidden until the fonts are in, so the page never re-flows mid-animation. */
html.font-loading:not(.docs-loading) body { visibility: hidden; }
/* With scripts on, content waits for the motion system to tag what drifts in (a timer in <head> lifts this if scripts fail). */
html.js:not(.motion-ready) :is(main, .docs-layout) { visibility: hidden; }

/* ------------------------------------------------------------------ glass */
.glass {
  background: rgba(8, 8, 10, .3);
  -webkit-backdrop-filter: blur(3px) saturate(1.2); backdrop-filter: blur(3px) saturate(1.2);
  box-shadow: inset 0 0 0 .5px rgba(130, 130, 130, .15), inset 1px 1px 2px rgba(0, 0, 0, .16), inset -1px -1px 2px rgba(0, 0, 0, .28), 0 8px 30px rgba(0, 0, 0, .28);
}
.lg-refraction .glass { -webkit-backdrop-filter: var(--lg-refract-filter, blur(3px) saturate(1.2)); backdrop-filter: var(--lg-refract-filter, blur(3px) saturate(1.2)); }

/* A hairline that carries a slow travelling light, like the app's menu divider. */
.flow-rule, .about-rule {
  height: 1px; border: 0;
  background-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, .9) 25%, transparent 50%, rgba(255, 255, 255, .9) 75%, transparent);
  background-size: 200% 100%; animation: div-flow 10.4s linear infinite;
}

/* -------------------------------------------------------------- particle sky */
.sky { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity 2.4s var(--out); }
.sky.on { opacity: 1; }

/* ----------------------------------------------------------------- header */
.site-header {
  position: fixed; z-index: 50; inset: 0 0 auto; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 clamp(16px, 3vw, 44px);
  background-color: rgba(0, 0, 0, .38); border-bottom: 1px solid transparent;
  transition: background-color .8s var(--out), border-color .8s var(--out);
  view-transition-name: site-header;
}
.site-header.is-scrolled { background-color: rgba(0, 0, 0, .62); border-bottom-color: var(--hairline); }
.site-header::after {
  content: ''; position: absolute; right: 0; bottom: 0; left: 0; height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,.15), rgba(255,255,255,.85));
  transform-origin: left center; transform: scaleX(var(--page-progress, 0));
  opacity: .7; pointer-events: none;
}

.brand { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; font: 400 26px/1 var(--display); }
.brand-mark { display: block; width: 35px; height: 30px; flex: none; overflow: visible; filter: drop-shadow(0 0 7px rgba(255, 255, 255, .85)); transition: filter .52s; }
.brand-mark rect { transform-box: fill-box; transform-origin: 50% 100%; translate: 0 0; transition: translate .55s var(--out); }
.brand-name { display: block; translate: 0 -1px; text-shadow: 0 0 6px rgba(255, 255, 255, .75); }
.brand:hover .brand-mark { filter: drop-shadow(0 0 12px #fff) drop-shadow(0 0 24px rgba(216, 215, 221, .6)); }
.brand:hover .brand-mark rect, .brand:focus-visible .brand-mark rect { translate: 0 -2px; }
.brand-mark rect:nth-child(2) { transition-delay: .035s; }
.brand-mark rect:nth-child(3) { transition-delay: .07s; }

.site-nav { display: flex; align-items: center; gap: clamp(2px, .8vw, 8px); }
.site-nav a {
  position: relative; padding: 8px 14px; border-radius: 999px;
  font-size: 19px; line-height: 1.1; color: rgba(255, 255, 255, .7);
  translate: 0 0; transition: color .35s, background-color .35s, translate .48s var(--out);
}
.site-nav a::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 1px; border-radius: 1px;
  background: #fff; box-shadow: 0 0 8px #fff, 0 0 16px rgba(255, 255, 255, .5);
  opacity: 0; scale: 0 1; transition: scale .36s var(--out), opacity .24s ease;
}
.site-nav a:hover { color: #fff; background-color: rgba(255, 255, 255, .06); translate: 0 -2px; }
.site-nav a:hover::after { opacity: .5; scale: .35 1; }
.site-nav a[aria-current=page] { color: #fff; }
.site-nav a[aria-current=page]::after { opacity: 1; scale: 1 1; }

/* ---------------------------------------------------------------- buttons */
/* Pill buttons, like the app's: dark glass, hairline border, a sheen that sweeps across on hover. */
.glass-button, .recommendation-button, .download-button, .pill-button, .quick-start-link {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 26px; border: 1px solid var(--line-strong); border-radius: 999px;
  background-color: rgba(10, 10, 12, .4); color: #fff;
  font: 400 20px/1.15 var(--display); letter-spacing: .01em; text-align: center;
  scale: 1; transition: border-color .42s, background-color .42s, color .42s, box-shadow .5s var(--out), scale .58s cubic-bezier(.22, 1, .36, 1);
}
:is(.glass-button, .recommendation-button, .download-button, .pill-button, .quick-start-link)::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, transparent 24%, rgba(255, 255, 255, .2) 50%, transparent 76%);
  opacity: 0; translate: -110% 0;
  transition: translate .95s cubic-bezier(.22, 1, .36, 1), opacity .4s ease;
}
:is(.glass-button, .recommendation-button, .download-button, .pill-button, .quick-start-link):hover {
  border-color: #fff; background-color: rgba(30, 30, 32, .62); box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), var(--glow); scale: 1.035;
}
:is(.glass-button, .recommendation-button, .download-button, .pill-button, .quick-start-link):hover::before,
:is(.glass-button, .recommendation-button, .download-button, .pill-button, .quick-start-link):focus-visible::before { opacity: .75; translate: 110% 0; }
:is(.glass-button, .recommendation-button, .download-button, .pill-button, .quick-start-link):active { scale: .985; transition-duration: .3s, .3s, .3s, .35s, .22s; }
/* the one action that matters most on a surface is solid white */
:is(.recommendation-button, .download-button.is-recommended, .pill-button.is-primary, .quick-start-link) { background-color: #fff; border-color: #fff; color: #000; }
:is(.recommendation-button, .download-button.is-recommended, .pill-button.is-primary, .quick-start-link):hover { background-color: #fff; color: #000; box-shadow: 0 0 0 1px #fff, 0 0 30px rgba(255, 255, 255, .45); }
:is(.recommendation-button, .download-button.is-recommended, .pill-button.is-primary, .quick-start-link)::before { background-image: linear-gradient(105deg, transparent 38%, rgba(0, 0, 0, .12) 50%, transparent 62%); }
.button-arrow { width: 16px; height: 16px; flex: none; transition: translate .7s var(--spring); }
:hover > .button-arrow { translate: 3px 0; }

/* ----------------------------------------------------------------- footer */
.site-footer {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 30px;
  min-height: 64px; padding: 20px 24px; background-color: rgba(0, 0, 0, .5);
  font-size: 16px; color: var(--soft); text-align: center;
}
.site-footer::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 1px; opacity: .5;
  background-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, .95) 25%, transparent 50%, rgba(255, 255, 255, .95) 75%, transparent);
  background-size: 200% 100%; animation: div-flow 10.4s linear infinite;
}
.site-footer a {
  color: var(--text); padding-bottom: 2px;
  background: linear-gradient(#fff, #fff) 50% 100% / 0 1px no-repeat; transition: color .4s, background-size .7s var(--out);
}
.site-footer a:hover { color: #fff; background-size: 100% 1px; }

/* ------------------------------------------------------- expanding details */
/* Opens and closes smoothly where the browser can animate to auto height; elsewhere it simply toggles. */
@supports (interpolate-size: allow-keywords) {
  details::details-content { block-size: 0; opacity: 0; overflow: clip; transition: block-size .38s var(--out), opacity .25s ease, content-visibility .38s allow-discrete; }
  details[open]::details-content { block-size: auto; opacity: 1; }
}
.chevron { width: 14px; height: 14px; flex: none; transition: rotate .8s var(--spring); }
details[open] > summary .chevron { rotate: 180deg; }

/* ---------------------------------------------------------- drift-in reveal */
/* motion.js tags elements with .rv and adds .in as they approach the viewport. */
.rv:not(.in):not(:focus-within) { opacity: 0; }
.rv.in:not(:focus-within) { animation: content-drift .66s var(--out) var(--reveal-delay, 0ms) backwards; }
/* letters that fall into place, as in the app's page titles */
.word { display: inline-block; white-space: nowrap; }
.ch { display: inline-block; white-space: pre; }
/* the hero's lines follow its falling title */
.hero .rv.in { animation-delay: calc(var(--reveal-delay, 0ms) + 200ms); }
.motion-ready .ch { animation: ch-fall .74s var(--out) calc(var(--i, 0) * 22ms + var(--ch-delay, 55ms)) backwards; }

/* ------------------------------------------------------ pointer-lit cards */
/* motion.js sets --rx/--ry and moves the highlight with the pointer. */
.tilt {
  --rx: 0deg; --ry: 0deg; --zoom: 1; position: relative;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) scale(var(--zoom));
  transition: transform .48s var(--out), border-color .28s, background-color .28s, box-shadow .36s var(--out);
}
.tilt.tilting { transition-duration: .19s, .28s, .28s, .36s; }
.tilt::after {
  content: ''; position: absolute; inset: 0; z-index: 1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .55s;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .16), transparent 58%);
}
.tilt:hover::after { opacity: 1; }

/* -------------------------------------------------------- page transitions */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .28s ease-out both; }
::view-transition-new(root) { animation: vt-in .42s var(--out) both; }
::view-transition-old(site-header), ::view-transition-new(site-header) { animation: none; }

/* ---------------------------------------------------------------- keyframes */
@keyframes div-flow { to { background-position: -200% 0; } }
@keyframes sheen { from { background-position: 160% 0; } to { background-position: -60% 0; } }
@keyframes key-strike { 0% { scale: 1 .05; opacity: 0; } 45% { opacity: 1; } 65% { scale: 1 1.12; } 82% { scale: 1 .96; } }
@keyframes key-idle { 0%, 84%, 100% { scale: 1 1; } 88% { scale: 1 .82; } 93% { scale: 1 1.04; } }
@keyframes ch-fall { from { opacity: 0; translate: 0 -.42em; } }
@keyframes content-drift { from { opacity: 0; translate: 0 15px; } }
@keyframes float-y { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
@keyframes pop-in { from { opacity: 0; scale: .92; } }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(5px); } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .25s !important; transition-delay: 0s !important; }
  details::details-content { transition: none !important; }
  :is(.glass-button, .recommendation-button, .download-button, .pill-button, .quick-start-link, .icon-button, .platform-icon, .demo-setting input[type=color]):is(:hover, :active) { scale: 1 !important; }
  .platform-card:hover .platform-icon { scale: 1 !important; }
  .platform-card:hover .platform-icon svg, .download-button:hover::after,
  .guide-card:hover .guide-card-cta::after, .docs-pagination a:hover span::before,
  .docs-pagination a:hover span::after, :hover > .button-arrow { translate: 0 0 !important; }
  :is(.glass-button, .recommendation-button, .download-button, .pill-button, .quick-start-link):is(:hover, :focus-visible)::before { opacity: 0; translate: -110% 0; }
  .demo input[type=range]:is(:hover, :active)::-webkit-slider-thumb { scale: 1 !important; }
  .preset-card:hover canvas { scale: 1; }
  .site-nav a:hover, .brand:hover .brand-mark rect, .brand:focus-visible .brand-mark rect { translate: 0 0; }
  .site-header::after { display: none; }
  .rv:not(.in):not(:focus-within) { opacity: 1; }
  .tilt { transform: none; }
  .shard, .hero-backdrop { translate: none; }
  .sky { display: none; }
}

/* ------------------------------------------------------------------ narrow */
@media (max-width: 640px) {
  :root { --header-h: 58px; }
  body { font-size: 18px; }
  .site-header { padding: 0 12px; }
  .brand { gap: 8px; font-size: 21px; }
  .brand-mark { width: 29px; height: 25px; }
  .site-nav { gap: 0; }
  .site-nav a { padding: 7px 8px; font-size: 15.5px; }
  .site-nav a::after { left: 8px; right: 8px; }
  .site-footer { gap: 8px 20px; font-size: 15px; }
}
@media (max-width: 380px) {
  .brand { font-size: 18px; gap: 6px; }
  .brand-mark { width: 25px; height: 22px; }
  .site-nav a { padding: 6px 6px; font-size: 14px; }
}
