/* Rivot Labs — static site styles
   Pure CSS, no JS. Light/dark via prefers-color-scheme.
   ─────────────────────────────────────────────────── */

:root {
  /* cream/warm light theme */
  --bg: #f5f1e8;
  --bg-2: #ece6d6;
  --ink: #1c1a14;
  --ink-2: #4a463b;
  --ink-3: #8a8478;
  --rule: rgba(28, 26, 20, 0.12);
  --accent: oklch(0.62 0.16 35);
  --accent-soft: oklch(0.92 0.04 60);
  --card: #faf7ef;

  /* signature Kelvin gradient */
  --kelvin: linear-gradient(
    90deg,
    #ff7a14 0%, #ffae5a 12%, #ffd187 24%, #ffeec2 36%,
    #fffbe9 48%, #f3f7fb 56%, #d6e4f5 68%,
    #a8c4ec 82%, #6d97d9 100%
  );

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Geist", -apple-system, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;

  --gutter: max(24px, 5vw);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15140f;
    --bg-2: #1f1d17;
    --ink: #f3eee0;
    --ink-2: #c2bda9;
    --ink-3: #6f6a5b;
    --rule: rgba(243, 238, 224, 0.12);
    --accent: oklch(0.78 0.13 70);
    --accent-soft: oklch(0.28 0.04 60);
    --card: #1c1a14;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: var(--bg); }

/* ── grain overlay ─────────────────────────────────── */
body::after {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: 0.035; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@media (prefers-color-scheme: dark) {
  body::after { mix-blend-mode: screen; opacity: 0.06; }
}

/* ── shared atoms ──────────────────────────────────── */
.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.mono .dot { color: var(--accent); }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; }

/* section header */
.sec-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 1px solid var(--ink);
  padding-top: 14px;
  margin-bottom: 60px;
}

/* ── nav ───────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px var(--gutter);
}
/* nav blur on scroll — using a sentinel via animation timeline isn't widely supported,
   so we keep nav always-subtly-glassy after first sticky engagement */
.nav::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 0.5px solid var(--rule);
  opacity: 0;
  transition: opacity 240ms ease;
}
/* Use scroll-driven via CSS @scroll-timeline isn't broadly supported. Fallback:
   keep nav fully transparent; on hover make it solid. Acceptable for static site. */
.nav:hover::before { opacity: 1; }

.wordmark {
  display: flex; align-items: center; gap: 8px;
  font-weight: 500; font-size: 18px; letter-spacing: -0.01em;
  color: var(--ink);
}
.wordmark .mark {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--ink); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 18px; font-style: italic; line-height: 1;
  padding-bottom: 2px;
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-size: 13.5px; color: var(--ink-2);
  letter-spacing: -0.005em;
  transition: color 160ms;
}
.nav-links a:hover { color: var(--ink); }

/* ── hero ──────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 140px var(--gutter) 80px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 60px;
  align-items: center;
}
.hero .eyebrow { display: block; margin-bottom: 32px; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(56px, 7.5vw, 112px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  text-wrap: balance;
}
.hero h1 em { color: var(--accent); font-style: italic; }
.hero h1 .punct { color: var(--ink-3); }
.hero .lede {
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 38ch;
}
.hero .cta-row {
  display: flex; gap: 16px; align-items: center; margin-top: 44px; flex-wrap: wrap;
}
.btn-fill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; background: var(--ink); color: var(--bg);
  border-radius: 999px; font-size: 14px; font-weight: 500;
  transition: transform 200ms ease, background 200ms ease;
}
.btn-fill:hover { transform: translateY(-1px); }
.btn-fill svg { width: 14px; height: 10px; }
.btn-underline {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 4px; color: var(--ink-2); font-size: 14px;
  border-bottom: 0.5px solid var(--rule);
  transition: color 200ms;
}
.btn-underline:hover { color: var(--ink); border-bottom-color: var(--accent); }

.hero-device-wrap {
  display: flex; justify-content: center; align-items: center;
  position: relative;
}
.hero-device-wrap::before {
  content: "";
  position: absolute; inset: 8% -4%; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--accent) 28%, transparent), transparent 70%);
  filter: blur(40px); opacity: 0.5; z-index: 0;
}

.hero-credits {
  grid-column: 1 / -1;
  margin-top: 32px;
  display: flex; justify-content: space-between; align-items: flex-end;
  flex-wrap: wrap; gap: 12px;
}

/* Kelvin signature stripe across hero bottom */
.kelvin-stripe {
  grid-column: 1 / -1;
  height: 3px;
  background: var(--kelvin);
  border-radius: 2px;
  opacity: 0.9;
  margin-top: 18px;
}

/* ── iPhone device (CSS only) ──────────────────────── */
.iphone {
  width: 320px; height: 696px;
  border-radius: 48px;
  position: relative;
  background: #000;
  box-shadow: 0 40px 80px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.12);
  overflow: hidden;
  flex-shrink: 0;
}
.iphone::before { /* dynamic island */
  content: "";
  position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
  width: 100px; height: 30px; border-radius: 20px; background: #000;
  z-index: 50;
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.06);
}
.iphone::after { /* home indicator */
  content: "";
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 4px; border-radius: 100px; background: rgba(255,255,255,0.55);
  z-index: 60;
}

/* KelvinCam screen */
.screen {
  position: absolute; inset: 0;
  background: #0a0a0c;
  display: flex; flex-direction: column;
  font-family: -apple-system, "SF Pro", system-ui, sans-serif;
  color: #fff;
}
/* status bar (subtle) */
.screen .statusbar {
  position: absolute; top: 0; left: 0; right: 0; height: 50px;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 28px 0;
  font-size: 13px; font-weight: 600;
  z-index: 10; color: #fff;
}
.screen .statusbar .ind {
  display: flex; gap: 5px; align-items: center;
}
.screen .statusbar .ind span {
  display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: #fff;
}

/* viewfinder */
.viewfinder {
  flex: 1;
  margin: 50px 12px 0;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 25%, #f8d59a 0%, transparent 45%),
    radial-gradient(ellipse at 70% 70%, #6a8fbf 0%, transparent 55%),
    linear-gradient(160deg, #ffe1b5 0%, #c79468 30%, #4a6b8e 75%, #2a3d54 100%);
}
/* scene "rule of thirds" grid */
.viewfinder::before {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, transparent 33.3%, rgba(255,255,255,0.15) 33.3%, rgba(255,255,255,0.15) 33.4%, transparent 33.4%, transparent 66.6%, rgba(255,255,255,0.15) 66.6%, rgba(255,255,255,0.15) 66.7%, transparent 66.7%),
    linear-gradient(to bottom, transparent 33.3%, rgba(255,255,255,0.15) 33.3%, rgba(255,255,255,0.15) 33.4%, transparent 33.4%, transparent 66.6%, rgba(255,255,255,0.15) 66.6%, rgba(255,255,255,0.15) 66.7%, transparent 66.7%);
  pointer-events: none;
}
/* focus reticle */
.viewfinder .reticle {
  position: absolute; top: 38%; left: 28%;
  width: 56px; height: 56px;
  border: 1px solid rgba(255,255,255,0.85);
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
}
.viewfinder .reticle::after {
  content: "";
  position: absolute; inset: -1px;
  border: 0.5px solid rgba(0,0,0,0.4);
}

/* big temperature readout */
.kelvin-readout {
  position: absolute; top: 14px; left: 14px;
  padding: 8px 12px 9px;
  border-radius: 12px;
  background: rgba(0,0,0,0.42);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  backdrop-filter: blur(8px) saturate(160%);
  border: 0.5px solid rgba(255,255,255,0.18);
}
.kelvin-readout .num {
  font-family: var(--serif);
  font-size: 38px; line-height: 1; font-weight: 400;
  letter-spacing: -0.02em;
  color: #fff;
  display: flex; align-items: baseline; gap: 4px;
}
.kelvin-readout .num small {
  font-family: var(--sans);
  font-size: 13px; font-weight: 500; opacity: 0.7;
  letter-spacing: 0.02em;
}
.kelvin-readout .label {
  font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase;
  opacity: 0.6; margin-top: 4px;
}

/* tint indicator chip */
.tint-chip {
  position: absolute; top: 14px; right: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(0,0,0,0.42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 0.5px solid rgba(255,255,255,0.18);
  display: flex; align-items: center; gap: 6px;
}
.tint-chip::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: oklch(0.78 0.13 70);
}

/* kelvin scale bar */
.kelvin-bar {
  position: absolute; left: 14px; right: 14px; bottom: 78px;
  height: 26px;
  border-radius: 999px;
  background: var(--kelvin);
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 4px 12px rgba(0,0,0,0.25);
  display: flex; align-items: center;
}
.kelvin-bar::after { /* marker at ~5400K (about 48% of scale 1000–12000K) */
  content: "";
  position: absolute; left: 47%;
  top: -4px; bottom: -4px;
  width: 3px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.35);
}
.kelvin-bar .tick {
  position: absolute;
  font-size: 8.5px; letter-spacing: 0.04em;
  color: rgba(0,0,0,0.55); font-weight: 600;
}
.kelvin-bar .tick.lo { left: 8px; }
.kelvin-bar .tick.hi { right: 8px; color: rgba(255,255,255,0.85); }

/* shutter row */
.shutter-row {
  position: absolute; left: 12px; right: 12px; bottom: 28px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px;
}
.shutter-row .small-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 0.5px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #fff;
}
.shutter {
  width: 56px; height: 56px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px transparent, 0 0 0 4px rgba(255,255,255,0.55);
}

/* mode selector */
.modes {
  position: absolute; left: 0; right: 0; bottom: 100px;
  display: flex; justify-content: center; gap: 18px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase;
}
.modes span { color: rgba(255,255,255,0.5); }
.modes .active { color: oklch(0.78 0.13 70); }

/* ── studio section ────────────────────────────────── */
.studio {
  padding: 120px var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 280px) 1fr;
  gap: 80px;
  align-items: start;
}
.studio .stick {
  position: sticky; top: 120px;
}
.studio .stick h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: 44px; line-height: 1; letter-spacing: -0.02em;
  margin-top: 16px;
}
.studio .stick h2 em { color: var(--ink); font-style: italic; }
.studio .lede {
  font-family: var(--serif); font-size: clamp(22px, 2vw, 28px);
  line-height: 1.4; letter-spacing: -0.005em; color: var(--ink);
  max-width: 38ch; margin-bottom: 12px;
}
.studio .body {
  font-size: 16px; line-height: 1.65; color: var(--ink-2);
  max-width: 52ch; margin-bottom: 48px;
}
.principles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; margin-top: 16px; }
.principle { border-top: 1px solid var(--rule); padding-top: 18px; }
.principle .t {
  font-family: var(--serif); font-size: 26px; margin-top: 6px;
  letter-spacing: -0.01em;
}
.principle .d { color: var(--ink-2); font-size: 14px; margin-top: 8px; line-height: 1.55; }

/* ── apps catalogue ────────────────────────────────── */
.apps { padding: 40px var(--gutter) 120px; }

.featured {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 60px;
  align-items: center;
  background: var(--card);
  border-radius: 24px;
  padding: 60px;
  border: 0.5px solid var(--rule);
}
.featured-device-wrap {
  display: flex; justify-content: center;
  position: relative;
}
.featured-device-wrap::before {
  content: "";
  position: absolute; inset: 4% -8%; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--accent) 22%, transparent), transparent 70%);
  filter: blur(30px); opacity: 0.55; z-index: 0;
}
.featured-device-wrap .iphone { position: relative; z-index: 1; }

.featured h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(48px, 5vw, 72px); line-height: 1.02;
  letter-spacing: -0.02em; margin-top: 16px; margin-bottom: 6px;
}
.featured h2 em { color: var(--ink-3); font-style: normal; font-weight: 400; }
.featured .pitch {
  font-family: var(--serif); font-size: 22px; line-height: 1.45;
  letter-spacing: -0.005em; max-width: 32ch; color: var(--ink-2);
  margin-top: 16px; margin-bottom: 32px;
}
.spec-grid {
  display: grid; grid-template-columns: auto 1fr;
  gap: 6px 20px; max-width: 460px; margin-bottom: 32px;
}
.spec-grid .v {
  font-size: 14px; color: var(--ink);
  border-bottom: 0.5px solid var(--rule); padding-bottom: 6px;
}
.appstore {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 14px;
  background: var(--ink); color: var(--bg);
  border-radius: 12px;
  font-family: var(--sans);
  font-size: 13px; line-height: 1.1;
  transition: transform 200ms ease;
}
.appstore:hover { transform: translateY(-1px); }
.appstore svg { width: 22px; height: 22px; flex-shrink: 0; }
.appstore .stack { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.appstore .stack .top { font-size: 9.5px; opacity: 0.7; letter-spacing: 0.06em; }
.appstore .stack .bot { font-size: 15px; font-weight: 500; margin-top: 1px; }

/* upcoming sketches */
.workshop-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 100px 0 28px;
}
.workshop-head h3 {
  font-family: var(--serif); font-weight: 400; font-size: 40px;
  letter-spacing: -0.02em;
}
.workshop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.sketch {
  background: var(--card);
  border: 0.5px solid var(--rule);
  border-radius: 18px;
  padding: 24px;
  height: 260px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
  transition: transform 240ms ease, border-color 240ms ease;
}
.sketch::before {
  content: "";
  position: absolute; inset: 0; opacity: 0.5; pointer-events: none;
  background: repeating-linear-gradient(135deg, transparent 0 18px, var(--rule) 18px 19px);
  -webkit-mask-image: radial-gradient(ellipse at top right, black, transparent 70%);
  mask-image: radial-gradient(ellipse at top right, black, transparent 70%);
}
.sketch:hover { transform: translateY(-3px); border-color: var(--accent); }
.sketch .name {
  font-family: var(--serif); font-size: 32px; line-height: 1.05;
  letter-spacing: -0.015em; margin-top: 10px;
}
.sketch .row {
  position: relative;
  display: flex; justify-content: space-between; align-items: flex-end;
}
.sketch .arrow { font-size: 18px; color: var(--ink-3); transition: color 200ms; }
.sketch:hover .arrow { color: var(--accent); }

/* ── contact ────────────────────────────────────── */
.contact {
  padding: 120px var(--gutter) 80px;
  background: var(--bg-2);
  border-top: 0.5px solid var(--rule);
}
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 80px;
}
.contact h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(44px, 5vw, 72px); line-height: 1.08;
  letter-spacing: -0.02em;
  margin-top: 16px; margin-bottom: 36px;
  max-width: 14ch; text-wrap: balance;
}
.contact h2 em { color: var(--accent); font-style: italic; }
.contact .lede {
  font-size: 16px; color: var(--ink-2); line-height: 1.55; max-width: 36ch;
}
.contact .links { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 8px; }
.contact .links .col { display: flex; flex-direction: column; gap: 6px; }
.contact .links .col .head { margin-bottom: 6px; }
.contact .links a {
  font-family: var(--serif); font-size: 22px;
  border-bottom: 0.5px solid var(--rule); padding-bottom: 4px;
  align-self: flex-start;
  transition: color 200ms, border-color 200ms;
}
.contact .links a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.contact .big-mail {
  font-family: var(--serif); font-size: clamp(28px, 3vw, 44px);
  letter-spacing: -0.01em; line-height: 1.1;
  border-bottom: 1px solid var(--ink); padding-bottom: 10px;
  display: inline-block;
  transition: color 200ms;
}
.contact .big-mail:hover { color: var(--accent); }

.footer {
  margin-top: 120px; padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
}

/* ── small-screen tightening ───────────────────────── */
@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 120px var(--gutter) 60px;
    gap: 40px;
  }
  .hero-device-wrap { order: 2; }
  .studio { grid-template-columns: 1fr; gap: 32px; }
  .studio .stick { position: static; }
  .principles { grid-template-columns: 1fr; }
  .featured {
    grid-template-columns: 1fr;
    padding: 32px;
    gap: 32px;
  }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .contact .links { grid-template-columns: 1fr 1fr; }
  .nav-links a { font-size: 12.5px; }
  .nav-links { gap: 18px; }
  .iphone { transform: scale(0.85); transform-origin: top center; }
}
@media (max-width: 540px) {
  .nav { padding: 16px 20px; }
  .nav-links { gap: 14px; }
  .nav-links a:nth-child(2) { display: none; } /* drop "Studio" first on mobile */
  .hero h1 { font-size: clamp(44px, 11vw, 72px); }
  .workshop-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .workshop-head h3 { font-size: 32px; }
  .featured { padding: 24px; }
  .featured h2 { font-size: 42px; }
}
