/* Desktop layout built on the 1440px Figma frame.
   --u is one Figma pixel, scaled to the viewport width. */
:root {
  --u: calc(100vw / 1440);
  --nav-h: calc(106 * var(--u));
  /* One page margin, used on both sides of every page and by the header and
     footer, so the logo, menu and content all share the same edges. */
  --pad: calc(32 * var(--u));
  /* Space from the content to the right and bottom screen edges. */
  --edge: calc(48 * var(--u));
  /* Feature ticker bar under the header. */
  --band-h: calc(40 * var(--u));
  --band-gap: calc(28 * var(--u));
  /* assets/hero-wordmark.svg viewBox: exact ink bounds of both lines. */
  --hero-ratio: calc(1130.04 / 710);
  /* Height of the content area under the ticker. */
  --body-h: calc(100vh - var(--nav-h) - var(--band-h) - var(--band-gap) - var(--edge));
  --green: #1fbf5c;
  --purple: #7a3fe0; /* fwd mode */
  --muted: rgba(0, 0, 0, .6);   /* secondary text */
  --faint: rgba(0, 0, 0, .1);   /* tracks and hairlines */
  --danger: #b3261e;
  --orange: #dd7f13; /* "see plans" button hover, Figma 3:9 */
  --black: #000;
  --white: #fff;
}

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

body {
  font-family: 'Gambarino', serif;
  background: var(--white);
  color: var(--black);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.nowrap { white-space: nowrap; }

/* Every page title: same face, size, spacing and position on every page. */
.page-title {
  font-family: 'Gambarino', serif;
  font-weight: 400;
  font-size: calc(160 * var(--u));
  letter-spacing: -.05em;
  line-height: .9;
  margin: calc(24 * var(--u)) 0 calc(56 * var(--u));
}
@media (max-width: 700px) {
  .page-title { font-size: 64px; margin: 28px 0 32px; }
}

/* The word you type to ask for a deep answer. */
.deep-key {
  white-space: nowrap;
  padding: 0 .18em;
  border-radius: .18em;
  background: rgba(31, 191, 92, .45);
}

/* Hover effects throughout only apply above phone width (701px and up);
   the matching scripts check the same width. */

/* Links inside text are always underlined, so they can't be mistaken for plain
   words. Buttons and the top nav have their own look. */
.plans-more a,
.inline-link,
.private__link,
.info-link,
.site-footer__links a {
  text-decoration-line: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: max(1.5px, .06em);
  text-underline-offset: .16em;
  transition: text-decoration-color 150ms ease, text-decoration-thickness 150ms ease;
}
.plans-more a:focus-visible, .inline-link:focus-visible, .private__link:focus-visible, .info-link:focus-visible {
  text-decoration-color: var(--green);
  text-decoration-thickness: max(3px, .13em);
}
@media (min-width: 701px) {
  .plans-more a:hover, .inline-link:hover, .private__link:hover, .info-link:hover {
    text-decoration-color: var(--green);
    text-decoration-thickness: max(3px, .13em);
  }
}
img { display: block; }

/* Landing: header, feature ticker bar, then two columns — the copy (headline,
   about card, buttons) on the left and the tall email demo on the right. */
.landing {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: var(--nav-h) var(--pad) var(--edge);
}

/* TOP BAR (46:4) */
.top-bar {
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 2;
}

/* Logo (1:6): Kihim 62px outlined to SVG; offsets place the ink where the
   Figma text box (left 31, top 8) puts it. */
.logo {
  position: absolute;
  left: var(--pad);
  top: calc(23.62 * var(--u));
}
.logo img {
  width: calc(229.59 * var(--u));
  height: auto;
}

.nav__link {
  font-family: 'Gambarino', serif;
  font-size: calc(35 * var(--u));
  letter-spacing: calc(-3.15 * var(--u));
  line-height: normal;
  white-space: nowrap;
  transition: opacity 150ms ease;
}
@media (min-width: 701px) {
  .nav__link:hover { opacity: 0.55; }
}
/* The menu is one row with equal gaps, centred on the wordmark, so it stays
   evenly spaced whether "plans" is "upgrade plans", or hidden on pro. */
@media (min-width: 701px) {
  .nav {
    position: absolute;
    right: var(--pad);
    top: calc(23.62 * var(--u) + 61.75 * var(--u) / 2);
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: calc(48 * var(--u));
  }
}

/* Layout 10, "demo hero": headline above the card on the left, the animation
   filling the right, and the two buttons across the bottom.
   --k is one design pixel, limited by height so all of it fits one screen. */
.landing__body {
  --k: min(var(--u), var(--body-h) / 678);
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: calc(520 * var(--k)) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: calc(26 * var(--k)) calc(30 * var(--k));
}
.landing__copy {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: calc(24 * var(--k));
}

/* Email demo slot: the demo (email-demo.js) scales itself to fill it. */
.anim-slot {
  position: relative;
  z-index: 2;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
}
.anim-slot .apl { max-width: none; margin: 0; }

/* The buttons join the page grid: "see plans" under the left column, "how it
   works" under the animation. */
.landing .hero-actions { display: contents; }
.landing .hero-actions .pill-button { --pill-u: calc(1.15 * var(--k)); }
.landing .about-card { --card-s: calc(270 * var(--k)); }

/* Hero wordmark (46:8): Vina Sans outlined to SVG, so the image edges are
   the letter edges. */
.hero img {
  width: 100%;
  height: auto;
  aspect-ratio: 1130.04 / 710;
}

/* Feature ticker (ticker.js): a full-width bar between two green lines that
   links to how it works. The track slides by exactly one strip and repeats,
   using only a transform, so nothing is re-laid out and it can't flicker. It
   never stops, including under the pointer. */
.ticker {
  --page-left: var(--pad);
  flex: none;
  position: relative;
  display: block;
  width: 100vw;
  height: var(--band-h);
  margin-left: calc(-1 * var(--page-left));
  margin-bottom: var(--band-gap);
  overflow: hidden;
  border-top: max(2px, calc(2.8 * var(--u))) solid var(--green);
  border-bottom: max(2px, calc(2.8 * var(--u))) solid var(--green);
  color: var(--green);
  font-family: 'Gambarino', serif;
  font-size: calc(0.5 * var(--band-h));
  letter-spacing: 0.02em;
  -webkit-text-stroke: 0.045em currentColor; /* Gambarino has one weight */
  line-height: 1;
}
.ticker__track {
  position: absolute;
  top: 50%;
  left: 0;
  display: flex;
  margin-top: -0.55em;
  white-space: nowrap;
  transform: translate3d(-50%, 0, 0);
  backface-visibility: hidden;
  will-change: transform;
  animation: ticker-slide 110s linear infinite;
}
.ticker:focus-visible { outline: 3px solid var(--black); outline-offset: -3px; }
.ticker__strip { flex: none; display: flex; }
.ticker__dot { padding: 0 0.9em; }
.ticker [data-encrypt] { text-decoration: none; cursor: pointer; }
.ticker [data-encrypt] .is-scrambled { color: var(--black); }
@keyframes ticker-slide {
  from { transform: translate3d(-50%, 0, 0); }
  to { transform: translate3d(0, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* About card: green, rounded, black outline, under the headline. Its text
   reacts to the cursor (proximity.js). */
.about-card {
  --card-s: calc(270 * var(--u));
  position: relative;
  z-index: 2;
  padding: calc(var(--card-s) * 0.075);
  border: max(3px, calc(var(--card-s) * 0.014)) solid var(--black);
  border-radius: calc(var(--card-s) * 0.1);
  background: var(--green);
  font-family: 'Gambarino', serif;
}
.about-card__title {
  font-weight: 400;
  font-size: calc(var(--card-s) * 0.13);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.45em;
}
.about-card__body {
  font-size: calc(var(--card-s) * 0.07);
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.about-card__mark {
  font-size: 0.7em;
  line-height: 0;
  vertical-align: super;
}
.about-card__note {
  margin-top: 0.9em;
  font-size: calc(var(--card-s) * 0.06);
  letter-spacing: -0.01em;
  color: var(--black);
}

/* Buttons under the about card: two pill buttons side by side, filling
   the column. Same outline weight as the card, with a hard black drop
   shadow that the button presses into on hover. "see plans" is filled
   green like the card; both turn the Figma hover orange. */
.hero-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(22 * var(--u));
}
.hero-actions .pill-button {
  --pill-u: calc(1.15 * var(--u));
  width: 100%;
  min-width: 0;
  padding-left: calc(24 * var(--pill-u));
  padding-right: calc(24 * var(--pill-u));
  gap: calc(14 * var(--pill-u));
  box-shadow: 0 calc(7 * var(--pill-u)) 0 var(--black);
  transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.hero-actions .pill-button--primary { background: var(--green); }
.hero-actions .pill-button:focus-visible {
  width: 100%;
  background: var(--orange);
  transform: translateY(calc(4 * var(--pill-u)));
  box-shadow: 0 calc(3 * var(--pill-u)) 0 var(--black);
}
@media (min-width: 701px) {
  .hero-actions .pill-button:hover {
    width: 100%;
    background: var(--orange);
    transform: translateY(calc(4 * var(--pill-u)));
    box-shadow: 0 calc(3 * var(--pill-u)) 0 var(--black);
  }
}
.hero-actions .pill-button:active {
  transform: translateY(calc(7 * var(--pill-u)));
  box-shadow: 0 0 0 var(--black);
}
.pill-button__arrow { transition: transform 180ms ease; }
.hero-actions .pill-button__arrow { width: 0.8em; height: 0.8em; }
@media (min-width: 701px) {
  .hero-actions .pill-button:hover .pill-button__arrow { transform: translateX(calc(6 * var(--pill-u))); }
}

/* Pill button: the Figma "see plans" button (3:3), white → orange on hover
   (3:9), with the arrow sliding out as the pill widens. Sized in --pill-u
   (the page's design pixel; the pricing page sets its own). */
.pill-button {
  --pill-u: var(--u);
  display: flex;
  align-items: center;
  justify-content: space-between;
  align-self: flex-start;
  width: 80%;
  min-width: max-content;
  gap: calc(24 * var(--pill-u));
  margin-top: auto;
  padding: calc(14 * var(--pill-u)) calc(28 * var(--pill-u)) calc(14 * var(--pill-u)) calc(32 * var(--pill-u));
  border: calc(6 * var(--pill-u)) solid var(--black);
  border-radius: 999px;
  background: var(--white);
  font-family: 'Boxing', serif;
  font-size: calc(30 * var(--pill-u));
  letter-spacing: calc(-0.9 * var(--pill-u));
  line-height: 1;
  white-space: nowrap;
  /* Boxing has one weight: a same-colour outline makes it bold, and looks
     the same in Safari and Chrome. */
  -webkit-text-stroke: 0.015em currentColor;
  transition: width 220ms ease, background-color 220ms ease;
}
/* Soft arrow: a rounded-end line icon in place of the ">" glyph. */
.pill-button__arrow {
  flex: none;
  width: 0.9em;
  height: 0.9em;
}
.pill-button:focus-visible {
  width: 100%;
  background: var(--orange);
  outline: none;
}
@media (min-width: 701px) {
  .pill-button:hover {
    width: 100%;
    background: var(--orange);
    outline: none;
  }
}

/* "private": scrambles while hovered (encrypt.js). */
[data-encrypt] {
  text-decoration: underline dotted;
  text-underline-offset: 0.18em;
  cursor: default;
}
[data-encrypt] .proximity__letter { text-align: center; }
[data-encrypt] .is-scrambled {
  color: var(--white);
  animation: glyph-flicker 110ms steps(2) infinite;
}
@keyframes glyph-flicker {
  50% { transform: translateY(-0.06em); opacity: 0.75; }
}

/* Letter spans created by proximity.js */
.proximity__word { display: inline-block; white-space: nowrap; }
.proximity__letter {
  display: inline-block;
}

/* Reveal footer: fixed behind the page, uncovered as the page scrolls up.
   Each page's <main> sits above it with a white background and leaves
   room for it underneath with margin-bottom. */
:root {
  --footer-h: calc(560 * var(--u));
}
.landing,
.plans-page,
.hiw-page,
.info-page,
.write-page {
  z-index: 1;
  background: var(--white);
  margin-bottom: var(--footer-h);
}

.site-footer {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 0;
  height: var(--footer-h);
  overflow: hidden;
  background: var(--green);
  color: var(--black);
}
/* Hidden while the page still covers it (footer-hold.js), so iPhone Safari
   doesn't tint its toolbar green before the footer is actually on screen. */
.site-footer.is-tucked { visibility: hidden; }

/* Two right-aligned link columns, top right. */
.site-footer__links {
  position: absolute;
  top: calc(64 * var(--u));
  right: var(--pad);
  display: flex;
  gap: calc(150 * var(--u));
}
.site-footer__links ul {
  list-style: none;
  text-align: right;
}
.site-footer__links a {
  font-family: 'Gambarino', serif;
  font-size: calc(35 * var(--u));
  letter-spacing: calc(-1.5 * var(--u));
  line-height: 1.45;
}
.site-footer__links a:focus-visible, .site-footer__links a[aria-current='page'] {
  text-decoration-thickness: max(3px, .13em);
}
@media (min-width: 701px) {
  .site-footer__links a:hover {
    text-decoration-thickness: max(3px, .13em);
  }
}

/* Huge logo, bottom left, its lower quarter cut off by the screen edge. */
.site-footer__logo {
  position: absolute;
  left: var(--pad);
  bottom: calc(-80 * var(--u));
  width: calc(1100 * var(--u));
  height: auto;
}

/* Mobile: stack the page: top bar, ticker bar, headline, animation, about
   card, buttons. The top bar gets two rows so nothing is squeezed: logo on
   top, then the links spread across the full width. */
@media (max-width: 700px) {
  /* No hover on phones, so no hint of one. */
  [data-encrypt] { text-decoration: none; }

  :root {
    --pad: 20px;
    --footer-h: 340px;
    --band-h: 30px;
    --band-gap: 0px;
  }

  .landing {
    height: auto;
    overflow: visible;
    padding: 0 var(--pad) 32px;
  }
  .ticker { --page-left: var(--pad); border-width: 2px; }
  .top-bar {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    height: auto;
    margin: 0 calc(-1 * var(--pad));
    padding: 20px var(--pad) 16px;
  }
  .logo { position: static; align-self: flex-start; }
  .logo img { width: 150px; }
  .nav { display: flex; justify-content: space-between; }
  .nav__link {
    position: static;
    font-size: 21px;
    letter-spacing: -0.5px;
  }

  .landing__body {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .landing__copy { display: contents; }
  .hero { order: 1; margin-top: 28px; }
  .hero img { width: 100%; }
  .anim-slot {
    order: 2;
    aspect-ratio: 732 / 515;
    margin-top: 28px;
  }
  .landing .about-card {
    order: 3;
    --card-s: min(100vw - 2 * var(--pad), 360px);
    margin-top: 28px;
  }
  .landing .hero-actions {
    display: grid;
    order: 4;
    margin-top: 24px;
    gap: 16px;
    grid-template-columns: 1fr;
  }
  .landing .hero-actions .pill-button { --pill-u: 0.72px; }
  .hero-actions .pill-button { --pill-u: 0.58px; }

  .site-footer__links {
    top: 32px;
    right: var(--pad);
    gap: 40px;
  }
  .site-footer__links a { font-size: 20px; letter-spacing: -0.6px; }
  .site-footer__logo { width: calc(100vw - 2 * var(--pad)); left: var(--pad); bottom: -6vw; }
}

/* ── Account icon (auth.js adds it next to the wordmark) ──────────────────
   Sits right of the logo, centred on it (logo box: top 23.62, height 61.75). */
.account-icon {
  --icon-s: calc(50 * var(--u));
  position: absolute;
  left: calc(var(--pad) + 253.59 * var(--u));   /* logo width + 24 */
  top: calc(23.62 * var(--u) + (61.75 * var(--u) - var(--icon-s)) / 2);
  width: var(--icon-s);
  height: var(--icon-s);
  display: grid;
  place-items: center;
  border: max(2.5px, calc(4 * var(--u))) solid var(--black);
  border-radius: 50%;
  background: var(--white);
  color: var(--black);
  transition: background-color 180ms ease, transform 180ms ease;
}
.account-icon svg { width: 62%; height: 62%; }
.account-icon.is-in { background: var(--green); }
.account-icon__initials {
  font-family: 'Vina Sans', sans-serif;
  font-size: calc(var(--icon-s) * 0.5);
  letter-spacing: 0.02em;
  line-height: 1;
  /* Vina Sans capitals sit .085em below the middle of their line box, so
     this puts the letters' ink exactly in the centre of the circle. */
  transform: translate(0.01em, -0.085em);
}
.account-icon:focus-visible {
  background: var(--orange);
  outline: max(3px, calc(4 * var(--u))) solid var(--black);
  outline-offset: max(3px, calc(4 * var(--u)));
}
@media (min-width: 701px) {
  .account-icon:hover { background: var(--orange); transform: scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .account-icon { transition: none; }
  .account-icon:hover { transform: none; }
}

/* Logged in, "upgrade plans" is longer than "plans": the two links before it
   shift left so nothing overlaps. Nothing else in the header moves. */
.nav__link[hidden] { display: none; }

@media (max-width: 700px) {
  .top-bar { position: relative; }
  .account-icon { --icon-s: 40px; left: auto; right: var(--pad); top: 20px; border-width: 3px; }
}

/* Footer hold (footer-hold.js): on pages taller than the window, the page
   stays pinned at its end for --hold of scrolling before the footer lifts in. */
:root { --hold: max(240px, 32vh); }
html.has-hold body::after { content: ''; display: block; height: var(--hold); }
html.has-hold main { position: sticky; }

/* Header that slides back in when you scroll up (header.js): a copy of the
   top bar, pinned to the top of the window, on the page's own colour. */
.top-bar-float {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--nav-h);
  background: var(--float-bg, var(--white));
  border-bottom: 3px solid var(--black);
  transform: translateY(calc(-100% - 4px));
  transition: transform 240ms ease;
}
.top-bar-float.is-shown { transform: none; }
.top-bar-float .top-bar { position: absolute; }
@media (max-width: 700px) {
  .top-bar-float { height: auto; border-bottom-width: 2px; }
  .top-bar-float .top-bar { position: relative; margin: 0; }
}
@media (prefers-reduced-motion: reduce) { .top-bar-float { transition: none; } }
@media print { .top-bar-float { display: none; } }
