/*
 * Frame Fit — the public site.
 *
 * Light paper surfaces and dark type, from the shipping palette. The try-on
 * viewer stays on the dark tokens in ff-tokens.css: the camera is a dark
 * instrument, and this page is the page around it. One accent, used for the
 * primary action, links, and the focus ring.
 */
@import url("/ff-tokens.css");

:root {
  --ink: #ffffff;
  --surface: #ffffff;
  --raised: #f4f4f6;
  --line: rgba(16, 20, 28, 0.08);
  --line-strong: rgba(16, 20, 28, 0.14);
  --text: #1a1b20;
  --secondary: #373941;
  --muted: #52535d;
  --faint: #5c5d68;
  --accent: #0064d0;
  --accent-hover: #0054b1;
  --accent-ink: #ffffff;
  --accent-soft: rgba(11, 99, 246, 0.09);
  --good: #0b7a4b;
  --danger: #b42318;

  --display: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --body: var(--display);

  --page: 1200px;
  --gutter: clamp(20px, 4vw, 48px);

  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(11, 99, 246, 0.16); }

#ff-wrap { color-scheme: dark; }

.skip {
  position: absolute;
  left: 16px;
  top: 8px;
  transform: translateY(-150%);
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  z-index: 80;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.skip:focus { transform: none; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 65ch; }

h1, h2, h3, section { scroll-margin-top: 80px; }

/* ---------------------------------------------------------------- nav --- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.nav-in {
  max-width: var(--page); margin: 0 auto; padding: 5px var(--gutter);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--display); font-weight: 600; font-size: 16px;
  letter-spacing: -0.02em; color: var(--text); text-decoration: none;
  min-height: 44px;
}
.brand svg { display: block; }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 12px; border-radius: 8px; color: var(--muted);
  text-decoration: none; font-size: 14px; font-weight: 500;
  touch-action: manipulation;
}
.nav-links a.btn { padding: 0 16px; border-radius: 999px; }
.nav-links a.btn-primary { color: var(--accent-ink); background: var(--accent); }
.nav-links a.btn-ghost { color: var(--text); }

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ------------------------------------------------------------ buttons --- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 17px; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--body); font-size: 14px; font-weight: 500; line-height: 20px;
  text-decoration: none; cursor: pointer; text-align: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(11, 99, 246, 0.16);
  transition: background 100ms ease-out, border-color 100ms ease-out, transform 100ms ease-out;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-ghost {
  background: var(--surface); color: var(--text); border-color: var(--line-strong);
}
.btn:active { transform: scale(0.97); }
.btn-sm, .btn-lg { min-height: 44px; font-size: 14px; }

/* ----------------------------------------------------------- sections --- */

section { padding: 48px 0; border-top: 1px solid var(--line); }
section:first-of-type { border-top: 0; }

/* A leftover label, if a page still emits one. Sentence case, no tracking. */
.eyebrow {
  font-size: 12px; line-height: 16px; font-weight: 500;
  letter-spacing: 0; text-transform: none; color: var(--muted);
  margin: 0 0 8px;
}

h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; margin: 0; color: inherit; font-weight: 600; }
h1 { font-size: clamp(33px, 5vw, 62px); line-height: 1.05; letter-spacing: -0.055em; }
h2 { font-size: clamp(25px, 3.5vw, 40px); line-height: 1.12; letter-spacing: -0.045em; }
h3 { font-size: 20px; line-height: 28px; }

.lede { font-size: 16px; line-height: 24px; color: var(--muted); max-width: 65ch; }
p { margin: 16px 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 12px; line-height: 16px; }

:not(pre) > code {
  font-family: var(--ff-mono);
  font-size: 0.9em;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

/* -------------------------------------------------------------- hero --- */

.hero { padding: 48px 0 32px; }
.hero h1 { max-width: 20ch; }
.hero .lede { margin-top: 16px; }
.hero-cta { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.hero-note { margin-top: 12px; font-size: 12px; line-height: 16px; color: var(--faint); max-width: 65ch; }

/* -------------------------------------------------------------- grid --- */

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; padding: 24px;
}
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; color: var(--muted); font-size: 16px; line-height: 24px; }
button.card {
  width: 100%; cursor: pointer; text-align: left;
  font: inherit; color: inherit;
  touch-action: manipulation;
  transition: background 100ms ease-out, border-color 100ms ease-out, transform 100ms ease-out;
}
button.card:active { transform: scale(0.97); }

/* Rimless and pale frames vanish on the light well without a hairline edge. */
.frame-well img { filter: drop-shadow(0 0 0.6px rgba(0, 0, 0, 0.45)) drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12)); }
.frame-well {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}
.frame-well img {
  display: block; width: 100%; height: 80px; object-fit: contain;
}
.frame-well.lg { padding: 24px; border-radius: 12px; }
.frame-well.lg img { height: auto; aspect-ratio: 2 / 1; }

/* ------------------------------------------------------------ figures --- */

.figure { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.figure-big { font-size: 32px; line-height: 40px; }
.figure-unit { font-size: 16px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.figure-label { font-size: 12px; line-height: 16px; color: var(--faint); margin-top: 8px; }

/* ------------------------------------------------------------- table --- */

table { width: 100%; border-collapse: collapse; font-size: 16px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
th { font-weight: 500; font-size: 14px; line-height: 20px; color: var(--muted); }
td.num { font-variant-numeric: tabular-nums; }
tr.ours td { background: var(--accent-soft); }
tr.ours td:first-child { font-weight: 600; }
.table-scroll { overflow-x: auto; }

/* ------------------------------------------------------------ pricing --- */

.tier {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 24px; display: flex; flex-direction: column; gap: 12px;
}
.tier.pick { border-color: var(--accent); border-width: 2px; }
.tier-name { font-weight: 600; font-size: 16px; }
.tier-price { font-weight: 600; font-size: 32px; line-height: 40px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tier-price span { font-size: 14px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.tier ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; line-height: 20px; color: var(--muted); }
.tier li { display: flex; gap: 8px; }
.tier li::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--text); margin-top: 8px; flex: none; }
.tier .btn { margin-top: auto; }

/* -------------------------------------------------------------- misc --- */

.note {
  background: var(--raised); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  color: var(--muted); font-size: 16px; line-height: 24px;
}
.kbd {
  font-family: var(--ff-mono); font-size: 12px; line-height: 16px;
  background: var(--raised); border: 1px solid var(--line); border-radius: 4px;
  padding: 2px 6px; color: var(--text);
}
pre.cmd {
  background: var(--raised); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; overflow-x: auto; font-size: 14px; line-height: 20px;
  font-family: var(--ff-mono); color: var(--text);
}

footer {
  border-top: 1px solid var(--line);
  background: var(--raised);
  padding: 30px 0 calc(32px + env(safe-area-inset-bottom));
  color: var(--faint); font-size: 14px; line-height: 20px;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.foot-in { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.foot-in nav { display: flex; gap: 16px; margin-left: auto; flex-wrap: wrap; }
.foot-in nav a { min-height: 44px; display: inline-flex; align-items: center; }

a.inline { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover { color: var(--text); background: var(--surface); }
  .nav-links a.btn-primary:hover { color: var(--accent-ink); background: var(--accent-hover); }
  .btn-primary:hover { background: var(--accent-hover); }
  .btn-ghost:hover { border-color: var(--text); background: var(--surface); }
  button.card:hover { border-color: var(--line-strong); background: var(--raised); }
  footer a:hover { color: var(--text); }
  a.inline:hover { color: var(--accent-hover); }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .nav-links a, button.card { transition: none; }
  .btn:active, button.card:active { transform: none; }
}
@media (max-width: 860px) {
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* On a phone the mid-width links move into a single Menu control. */
.nav-menu { display: none; position: relative; }
.nav-menu > summary {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 12px; border-radius: 8px; color: var(--muted);
  font-size: 14px; font-weight: 500; cursor: pointer; list-style: none;
  touch-action: manipulation;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu-list {
  position: absolute; right: 0; top: calc(100% + 4px);
  min-width: 180px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(16, 20, 28, 0.12);
  display: flex; flex-direction: column; z-index: 60;
}
.nav-menu-list a {
  display: flex; align-items: center; min-height: 44px;
  padding: 0 12px; border-radius: 8px; color: var(--text);
  text-decoration: none; font-size: 14px; font-weight: 500;
}

/* Demo listing: the header sits above a scrolling pane, so a sticky bar
   can never cover a row. The global scroll-margin/padding (meant to clear a
   sticky nav on the marketing pages) would leave a strip of the previous
   section in the same-coloured band under the bar, which looked like text
   inside the header. */
.site-page {
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.site-page .nav {
  position: relative;
  flex: 0 0 auto;
  z-index: 50;
  background: var(--surface);
}
.site-scroll {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;
  scroll-padding-top: 0;
}
.site-scroll h1,
.site-scroll h2,
.site-scroll h3,
.site-scroll section,
.site-scroll .frame-card {
  scroll-margin-top: 0;
}

@media (max-width: 640px) {
  /* Beat .nav-links a { display: inline-flex } so Pricing/FAQ actually hide. */
  .nav-links a.nav-wide { display: none; }
  .nav-menu { display: block; flex: 0 0 auto; }
  .nav-menu-list { right: 0; left: auto; }
  .nav-links { margin-left: auto; }
  :root { --gutter: 16px; }
  .btn { white-space: normal; }
}
@media (max-width: 560px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
}

/* The demo shares the public site's typography and keeps the viewer focused on the camera. */
.demo-hero { padding: clamp(50px, 8vw, 110px) 0 clamp(48px, 7vw, 84px); text-align: center; }
.demo-hero h1 { max-width: 18ch; margin: 0 auto; font-size: clamp(43px, 7vw, 85px); line-height: 1; letter-spacing: -0.05em; text-wrap: balance; }
.demo-hero .lede { margin: 18px auto 0; font-size: clamp(17px, 2vw, 22px); line-height: 1.45; max-width: 40ch; text-wrap: pretty; }
.demo-hero .hero-cta { justify-content: center; }
.demo-message { max-width: 38ch; margin: 16px auto 0; color: var(--muted); }
.demo-catalogue { background: #f0f0f0; }
.demo-catalogue .wrap { max-width: 1400px; padding-inline: clamp(16px, 3vw, 40px); }
.demo-catalogue .demo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 36px 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}
.demo-frame-tile { position: relative; align-self: start; }
.demo-frame-media {
  position: relative;
  display: grid;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--surface);
}
.demo-frame-photo {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
  transition: opacity 180ms ease, transform 250ms ease-out;
}
.demo-frame-photo[data-active="false"] { opacity: 0; }
.demo-frame-fallback { width: 92%; object-fit: contain; justify-self: center; }
.demo-frame-next {
  position: absolute;
  z-index: 2;
  inset: auto 5px 5px auto;
  padding: 0 10px;
  min-width: 48px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  font: 600 12px/1 var(--body);
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}
.demo-catalogue .frame-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 8px;
  width: 100%;
  padding: 10px 2px 0;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  touch-action: manipulation;
}
.demo-catalogue .frame-card::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
}
.demo-frame-title { grid-column: 1 / -1; font-size: 15px; font-weight: 550; line-height: 1.35; overflow-wrap: anywhere; }
.demo-frame-details, .demo-frame-action { font-size: 13px; line-height: 1.4; }
.demo-frame-details { color: var(--muted); }
.demo-frame-action { grid-column: 2; color: var(--accent); font-weight: 600; white-space: nowrap; }
.frame-card:hover .demo-frame-title, .frame-card:focus-visible .demo-frame-title { text-decoration: underline; text-underline-offset: 3px; }
.demo-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(22px, 5vw, 64px); }
.demo-details p { margin: 8px 0 0; }
.demo-credit { margin: 25px 0 0; }
@media (hover: hover) and (pointer: fine) {
  .demo-frame-tile:hover .demo-frame-photo[data-active="true"] { transform: scale(1.03); }
  .demo-frame-tile:not(:hover):not(:focus-within) .demo-frame-next { opacity: 0; }
}
@media (max-width: 989px) {
  .demo-catalogue .demo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 8px; }
}
@media (max-width: 640px) {
  .demo-frame-details, .demo-frame-action { font-size: 12px; }
  .demo-details { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-frame-photo { transition: none; }
}
