/* ---------------------------------------------------------------------------
   Nara — landing
   The product is the hero: a phone running Nara's real Home screen.
   Tokens mirror apps/mobile/src/theme/tokens.ts exactly. 8px spatial rhythm.
--------------------------------------------------------------------------- */

:root {
  --paper: #f3f3f1;
  --card: #ffffff;
  --ink: #18191b;
  --body-c: #26282b;
  --sub-ink: #4d5560;
  --secondary: #6a6e73;
  --faint: #9a9da1;
  --inactive: #a8abae;
  --accent: #2e50e6;
  --border-card: rgba(20, 22, 24, 0.07);
  --border-interactive: rgba(20, 22, 24, 0.12);

  --font: "Schibsted Grotesk", -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { height: 100%; }

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--paper); }

.ink {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
}

.pre-line {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  font-size: clamp(17px, 1.8vw, 22px);
  font-style: italic;
  color: var(--sub-ink);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 480px) {
  .pre-line { white-space: normal; text-align: center; width: 80vw; }
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Page container --------------------------------------------------------- */

.page {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(24px, 4vw, 48px);
}

/* ---- Nav ---------------------------------------------------------------------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
  flex-shrink: 0;
}

.identity { display: flex; align-items: center; gap: 10px; }

.mark {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mark-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--accent); }

.wordmark { font-size: 18px; font-weight: 700; letter-spacing: -0.4px; }

.nav-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.1px;
  color: var(--sub-ink);
  padding: 7px 12px 7px 10px;
  border: 1px solid var(--border-interactive);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(46, 80, 230, 0.45);
  animation: statusPulse 2.4s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 80, 230, 0.4); opacity: 1; }
  50% { box-shadow: 0 0 0 6px rgba(46, 80, 230, 0); opacity: 0.85; }
}

/* ---- Hero ------------------------------------------------------------------------ */

.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(32px, 5vw, 88px);
  padding: 24px 0 32px;
  min-height: 0;
}

.headline {
  font-size: clamp(44px, 5.6vw, 84px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.04;
  color: var(--ink);
}

.hl-line { display: block; perspective: 900px; }

.hl-italic { font-style: italic; font-weight: 400; letter-spacing: -0.02em; }

/* JS splits [data-split] into .w (word) > .ch (char) for the 3D type-setting. */
.w { display: inline-block; white-space: nowrap; }
.ch {
  display: inline-block;
  will-change: transform;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

.hl-dot {
  display: inline-block;
  width: 0.13em;
  height: 0.13em;
  border-radius: 999px;
  background: var(--accent);
  margin-left: 0.06em;
  transform: scale(0);
}

.voice {
  margin-top: 24px;
  font-size: clamp(15.5px, 1.3vw, 18px);
  font-style: italic;
  line-height: 1.62;
  color: var(--sub-ink);
  max-width: 30em;
}

.launch {
  margin-top: 40px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.launch-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.launch-rule {
  width: 28px;
  height: 1px;
  background: var(--border-interactive);
  flex-shrink: 0;
}

.launch-line {
  font-size: 14.5px;
  font-weight: 500;
  font-style: italic;
  color: var(--secondary);
  letter-spacing: -0.1px;
}

/* ---- The phone --------------------------------------------------------------------
   An iPhone running Nara's Home screen, rebuilt to the app's own tokens.
------------------------------------------------------------------------------------ */

.device { position: relative; }

.device-3d {
  position: relative;
  perspective: 1300px;
}

.phone-shadow {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -30px;
  height: 34px;
  border-radius: 999px;
  background: rgba(20, 22, 24, 0.24);
  filter: blur(26px);
  will-change: transform, opacity;
}

.phone {
  position: relative;
  width: 322px;
  height: 656px;
  background: #101113;
  border-radius: 52px;
  padding: 10px;
  box-shadow:
    0 2px 6px rgba(20, 22, 24, 0.10),
    0 24px 48px rgba(20, 22, 24, 0.14);
  will-change: transform;
  transform-style: preserve-3d;
}

.island {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 82px;
  height: 24px;
  border-radius: 999px;
  background: #101113;
}

.screen {
  width: 100%;
  height: 100%;
  border-radius: 42px;
  background: var(--paper);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 14px 18px 0;
}

/* Status bar */
.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 34px;
  padding: 0 8px;
  flex-shrink: 0;
}

.sb-time { font-size: 12px; font-weight: 600; letter-spacing: -0.1px; }

.sb-right { display: flex; align-items: center; gap: 5px; }

.sb-signal { display: inline-flex; align-items: flex-end; gap: 1.5px; }
.sb-signal i { width: 2.5px; background: var(--ink); border-radius: 1px; }
.sb-signal i:nth-child(1) { height: 4px; }
.sb-signal i:nth-child(2) { height: 6px; }
.sb-signal i:nth-child(3) { height: 8px; }
.sb-signal i:nth-child(4) { height: 10px; }

.sb-battery {
  width: 20px;
  height: 10px;
  border: 1px solid rgba(20, 22, 24, 0.4);
  border-radius: 3px;
  padding: 1px;
  display: inline-block;
}
.sb-battery i { display: block; width: 70%; height: 100%; background: var(--ink); border-radius: 1.5px; }

/* App header — the app's own Home header */
.appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 0;
  flex-shrink: 0;
}

.app-identity { display: flex; align-items: center; gap: 7px; }

.app-mark {
  width: 19px;
  height: 19px;
  border-radius: 5.5px;
  background: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.app-mark-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--accent); }

.app-name { font-size: 13.5px; font-weight: 700; letter-spacing: -0.3px; }

.app-time { font-size: 9.5px; font-weight: 500; color: var(--faint); }

/* Greeting */
.app-greeting {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.6px;
  line-height: 1.08;
  margin-top: 20px;
  flex-shrink: 0;
}

/* Capture card */
.app-capture {
  margin-top: 16px;
  background: var(--card);
  border: 1px solid var(--border-card);
  border-radius: 13px;
  padding: 13px 13px 11px;
  box-shadow: 0 1px 3px rgba(20, 22, 24, 0.05);
  flex-shrink: 0;
}

.app-capture-text { font-size: 12.5px; font-weight: 500; min-height: 18px; line-height: 1.4; }

.app-placeholder { color: var(--faint); }

.app-typed { color: var(--ink); font-style: italic; }

.app-caret {
  display: none;
  width: 1.5px;
  height: 0.95em;
  background: var(--accent);
  vertical-align: -0.12em;
  margin-left: 1px;
  animation: caretBlink 1.05s steps(1) infinite;
}
.app-caret.on { display: inline-block; }

@keyframes caretBlink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }

.app-capture-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.app-capture-hint { font-size: 8.5px; color: #c2c4c7; }

.app-capture-go {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  line-height: 24px;
  text-align: center;
  font-weight: 600;
}

/* Recent */
.app-recent-label {
  margin-top: 18px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--faint);
  flex-shrink: 0;
}

.app-cards {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* The app's NoteCard, at phone scale */
.app-note {
  background: var(--card);
  border: 1px solid var(--border-card);
  border-radius: 11px;
  padding: 9px 11px;
  flex-shrink: 0;
  will-change: transform, opacity;
}

.app-note.pending {
  border-color: rgba(46, 80, 230, 0.28);
  border-style: dashed;
}

.app-note-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
}

.app-note-dot { width: 5px; height: 5px; border-radius: 1.5px; flex-shrink: 0; }
.app-note.pending .app-note-dot { border-radius: 999px; background: var(--accent); animation: pendingPulse 1.3s ease-in-out infinite; }

@keyframes pendingPulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

.app-note-cat {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}
.app-note.pending .app-note-cat { color: var(--accent); }

.app-note-time { margin-left: auto; font-size: 8px; color: var(--faint); }

.app-note-body {
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--body-c);
}

/* Tab bar — the app's drawn icons */
.app-tabbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 9px 12px 18px;
  margin: 10px -18px 0;
  border-top: 1px solid var(--border-card);
  background: var(--paper);
  flex-shrink: 0;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 52px;
  color: var(--inactive);
}
.tab-active { color: var(--ink); }

.tab-label { font-size: 7.5px; font-weight: 600; }

.tab-talk {
  width: 15px; height: 15px;
  border: 1.8px solid currentColor;
  border-radius: 4.5px;
  display: flex; align-items: center; justify-content: center;
}
.tab-talk i { width: 5px; height: 5px; border-radius: 999px; background: currentColor; }

.tab-notes { width: 15px; display: flex; flex-direction: column; gap: 2.5px; padding-top: 2px; }
.tab-notes i { height: 1.8px; border-radius: 1px; background: currentColor; }
.tab-notes i.short { width: 70%; }

.tab-ask {
  width: 15px; height: 13px;
  border: 1.8px solid currentColor;
  border-radius: 6px 6px 6px 1.5px;
  margin-top: 1px;
}

.tab-people { display: flex; padding-top: 2.5px; }
.tab-people i {
  width: 9.5px; height: 9.5px;
  border: 1.8px solid currentColor;
  border-radius: 999px;
}
.tab-people i + i { margin-left: -4px; background: var(--paper); }

/* ---- Marquee ------------------------------------------------------------------------ */

.marquee {
  overflow: hidden;
  padding: 13px 0;
  border-top: 1px solid var(--border-card);
  flex-shrink: 0;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
}

.marquee-track { display: inline-flex; align-items: center; white-space: nowrap; will-change: transform; }

.mq-item { font-size: 12.5px; font-style: italic; color: var(--faint); padding: 0 14px; }

.mq-dot { width: 4px; height: 4px; border-radius: 999px; background: var(--accent); opacity: 0.5; flex-shrink: 0; }

/* ---- Footer -------------------------------------------------------------------------- */

.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
  flex-shrink: 0;
}

.foot-clock { font-variant-numeric: tabular-nums; }

/* ---- Custom cursor -------------------------------------------------------------------- */

.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  z-index: 20;
  pointer-events: none;
  border-radius: 999px;
  opacity: 0;
}

.cursor-dot { width: 5px; height: 5px; background: var(--ink); transform: translate(-50%, -50%); }

.cursor-ring {
  width: 26px; height: 26px;
  border: 1px solid rgba(20, 22, 24, 0.28);
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease), height 0.3s var(--ease), border-color 0.3s var(--ease);
}

body.cursor-on, body.cursor-on a { cursor: none; }
body.cursor-grow .cursor-ring { width: 44px; height: 44px; border-color: var(--accent); }

/* ---- Intro states ------------------------------------------------------------------------ */

[data-intro] { opacity: 0; }
.js-off [data-intro] { opacity: 1; }

/* ---- Reduced motion -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  [data-intro] { opacity: 1 !important; transform: none !important; }
  .ch { transform: none !important; }
  .hl-dot { transform: scale(1) !important; }
  .app-caret, .app-note.pending .app-note-dot,
  .nav-status-dot { animation: none; }
  .ink, .cursor-dot, .cursor-ring { display: none; }
  .marquee-track { transform: none !important; }
}

/* ---- Responsive --------------------------------------------------------------------------------
   Desktop: copy left, phone right, single viewport.
   Under 960px: stacked, phone below copy, natural scroll.
--------------------------------------------------------------------------------------------------- */

@media (max-height: 820px) and (min-width: 961px) {
  .phone { transform: scale(0.88); transform-origin: center; }
  .hero { padding-bottom: 8px; }
}

@media (max-width: 960px) {
  .nav { height: 72px; }

  .hero {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 48px;
    padding: 16px 0 48px;
  }

  .headline { font-size: clamp(44px, 10vw, 72px); }

  .launch { margin-top: 32px; }

  .device { justify-self: center; }
}

@media (max-width: 400px) {
  .phone { width: 300px; height: 612px; border-radius: 48px; }
  .screen { border-radius: 39px; }
  .headline { font-size: clamp(40px, 11.5vw, 52px); }
  .foot { flex-direction: column; gap: 4px; }
}
