/* Tern's landing page. Colors follow the app (src/app/globals.css) and the logo's
   indigo tile with its orange beak. No web fonts: the system's own, so the page
   asks nothing of anyone else's server. */

:root {
  color-scheme: light;
  --bg: #fbfbfd;
  --bg-soft: #f4f4f8;
  --surface: #ffffff;
  --ink: #15151b;
  --ink-2: #3b3b47;
  --muted: #62626f;
  --line: #e6e6ee;
  --accent: #5b5bd6;
  --accent-strong: #4f46e5;
  --accent-soft: #ededfc;
  --accent-ink: #ffffff;
  --beak: #ff7a3d;
  --frame: #f6f6f8;
  --frame-line: rgb(16 16 24 / 0.08);
  --shadow-lg:
    0 1px 2px rgb(16 16 24 / 0.04), 0 12px 32px -8px rgb(30 27 75 / 0.14), 0 40px 90px -30px rgb(30 27 75 / 0.32);
  --shadow-md: 0 1px 2px rgb(16 16 24 / 0.04), 0 10px 30px -10px rgb(30 27 75 / 0.18);
  --radius: 16px;
  --sans:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  --display:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b0b0e;
    --bg-soft: #111116;
    --surface: #141419;
    --ink: #ededf1;
    --ink-2: #c9c9d3;
    --muted: #9c9ca9;
    --line: #24242c;
    --accent: #8b8bf5;
    --accent-strong: #7d7df2;
    --accent-soft: #23234a;
    --accent-ink: #111116;
    --frame: #0e0e11;
    --frame-line: rgb(255 255 255 / 0.08);
    --shadow-lg:
      0 0 0 1px rgb(255 255 255 / 0.04), 0 24px 60px -20px rgb(0 0 0 / 0.7), 0 40px 120px -40px rgb(91 91 214 / 0.35);
    --shadow-md: 0 0 0 1px rgb(255 255 255 / 0.04), 0 16px 40px -16px rgb(0 0 0 / 0.7);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

h1,
h2,
h3 {
  font-family: var(--display);
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.028em;
  font-weight: 700;
}

p {
  margin: 0;
  text-wrap: pretty;
}

figure {
  margin: 0;
}

.wrap {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
}

.wrap-wide {
  width: min(1240px, 100% - 32px);
  margin-inline: auto;
}

.center {
  text-align: center;
}

.sprite {
  position: absolute;
  overflow: hidden;
}

.ic {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------------------------------------------------------------- Navigation */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 700 19px/1 var(--display);
  letter-spacing: -0.02em;
}

.brand img {
  border-radius: 8px;
}

.brand-small {
  font-size: 16px;
  gap: 8px;
}

.brand-small img {
  border-radius: 6px;
}

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: 12px;
}

.nav-links a,
.link-quiet {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 15px;
  color: var(--muted);
  transition:
    color 0.15s,
    background 0.15s;
}

.nav-links a:hover,
.link-quiet:hover {
  color: var(--ink);
  background: var(--bg-soft);
}

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 760px) {
  .nav-links,
  .hide-sm {
    display: none;
  }
}

/* ------------------------------------------------------------------- Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 18px;
  border-radius: 999px;
  /* The same indigo in both themes: white text needs its contrast. */
  background: #4f46e5;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  box-shadow:
    0 1px 1px rgb(30 27 75 / 0.2),
    inset 0 1px 0 rgb(255 255 255 / 0.18),
    0 6px 16px -6px rgb(79 70 229 / 0.6);
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}

.button:hover {
  background: #4338ca;
  transform: translateY(-1px);
  box-shadow:
    0 1px 1px rgb(30 27 75 / 0.2),
    inset 0 1px 0 rgb(255 255 255 / 0.18),
    0 10px 22px -8px rgb(79 70 229 / 0.7);
}

.button:active {
  transform: translateY(0);
}

.button-small {
  padding: 8px 15px;
  font-size: 14px;
}

.button-small .ic {
  width: 16px;
  height: 16px;
}

.button-large {
  padding: 14px 24px;
  font-size: 16.5px;
}

.button-ghost {
  background: var(--surface);
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1px var(--line),
    0 1px 2px rgb(16 16 24 / 0.04);
}

.button-ghost:hover {
  background: var(--surface);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, var(--line)),
    0 6px 18px -10px rgb(30 27 75 / 0.3);
}

.button-ghost .ic {
  transition: transform 0.15s;
}

.button-ghost:hover .ic {
  transform: translateX(2px);
}

.button-light {
  background: #fff;
  color: #1e1b4b;
  box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.5);
}

.button-light:hover {
  background: #fff;
  box-shadow: 0 14px 34px -10px rgb(0 0 0 / 0.55);
}

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

.hero {
  position: relative;
  padding: clamp(56px, 9vw, 104px) 0 40px;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -64px 0 auto;
  height: 900px;
  z-index: -1;
  background:
    radial-gradient(40% 45% at 22% 18%, rgb(124 124 240 / 0.22), transparent 70%),
    radial-gradient(32% 38% at 80% 10%, rgb(255 122 61 / 0.13), transparent 70%),
    radial-gradient(60% 50% at 50% 60%, rgb(79 70 229 / 0.1), transparent 75%);
  pointer-events: none;
}

.hero-copy {
  text-align: center;
  max-width: 860px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow:
    inset 0 0 0 1px var(--line),
    0 1px 2px rgb(16 16 24 / 0.04);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  transition: box-shadow 0.15s;
}

.pill:hover {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, var(--line));
}

.pill .ic {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--beak);
  box-shadow: 0 0 0 3px rgb(255 122 61 / 0.18);
}

h1 {
  margin-top: 26px;
  font-size: clamp(2.7rem, 7.2vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 750;
}

.calm {
  background: linear-gradient(115deg, #4f46e5 10%, #7c7cf0 60%, #ff7a3d 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (prefers-color-scheme: dark) {
  .calm {
    background-image: linear-gradient(115deg, #8b8bf5 10%, #a5a5ff 55%, #ff9a66 115%);
  }
}

.lede {
  margin: 22px auto 0;
  max-width: 640px;
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
  line-height: 1.6;
  color: var(--muted);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
}

.fine {
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--muted);
}

.hero-window {
  margin-top: clamp(48px, 7vw, 76px);
}

.promises {
  list-style: none;
  padding: 0;
  margin-top: clamp(48px, 7vw, 72px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.promises li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.promises .ic {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  color: var(--accent);
}

.promises strong {
  display: block;
  font-weight: 600;
  font-size: 16px;
}

.promises span {
  display: block;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

@media (max-width: 820px) {
  .promises {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 480px;
  }
}

/* ------------------------------------------------------------ Window frames */

.window {
  border-radius: 14px;
  overflow: hidden;
  background: var(--frame);
  box-shadow:
    0 0 0 1px var(--frame-line),
    var(--shadow-lg);
}

.window-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 30px;
  padding: 0 14px;
  background: var(--frame);
}

.window-bar i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: inset 0 0 0 0.5px rgb(0 0 0 / 0.12);
}

.window-bar i:nth-child(2) {
  background: #febc2e;
}

.window-bar i:nth-child(3) {
  background: #28c840;
}

@media (max-width: 600px) {
  .window {
    border-radius: 10px;
  }
  .window-bar {
    height: 20px;
    gap: 5px;
    padding: 0 9px;
  }
  .window-bar i {
    width: 7px;
    height: 7px;
  }
}

.shot {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--frame-line),
    var(--shadow-md);
}

.shot-dark {
  background: #111114;
}

/* ------------------------------------------------------------------ Features */

.features {
  padding: clamp(72px, 10vw, 128px) 0 24px;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  margin-bottom: clamp(80px, 11vw, 140px);
}

.row-flip .row-copy {
  order: 2;
}

.row-copy > p:not(.eyebrow) {
  margin-top: 16px;
  color: var(--muted);
  font-size: 17.5px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.eyebrow .ic {
  width: 16px;
  height: 16px;
}

.checks {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 12px;
}

.checks li {
  display: flex;
  gap: 12px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-2);
}

.checks .ic {
  width: 20px;
  height: 20px;
  padding: 3px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  stroke-width: 3;
}

.keys {
  margin: 24px 0 0;
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 12px clamp(28px, 5vw, 56px);
}

.keys div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.keys dt {
  display: flex;
  gap: 4px;
  min-width: 62px;
}

.keys dd {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border-radius: 7px;
  background: var(--surface);
  box-shadow:
    inset 0 0 0 1px var(--line),
    0 2px 0 var(--line);
  font: 600 13px/1 var(--sans);
  color: var(--ink);
}

.showcase {
  margin: calc(-1 * clamp(24px, 4vw, 60px)) 0 clamp(80px, 11vw, 140px);
}

@media (max-width: 900px) {
  .row {
    grid-template-columns: 1fr;
  }
  .row-flip .row-copy {
    order: 0;
  }
  .row-copy {
    max-width: 620px;
  }
  .showcase {
    margin-top: 0;
  }
}

/* -------------------------------------------------------------------- Grid */

.more {
  padding: clamp(72px, 10vw, 112px) 0;
  background: var(--bg-soft);
  border-block: 1px solid var(--line);
}

.grid {
  list-style: none;
  padding: 0;
  margin: clamp(36px, 5vw, 56px) 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.grid li {
  padding: 22px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}

.grid li:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, var(--line)),
    var(--shadow-md);
}

.grid .ic {
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  stroke-width: 2;
}

.grid strong {
  display: block;
  margin-top: 16px;
  font-size: 16px;
  font-weight: 600;
}

.grid span {
  display: block;
  margin-top: 6px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
}

@media (max-width: 1000px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------ Phones */

.phones {
  padding: clamp(80px, 11vw, 140px) 0;
  overflow: hidden;
}

.phones-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
}

.phones-copy > p:not(.eyebrow) {
  margin-top: 16px;
  color: var(--muted);
  font-size: 17.5px;
}

.phone-pair {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(16px, 3vw, 28px);
}

.phone {
  width: min(270px, 48%);
  padding: clamp(6px, 1.4%, 9px);
  border-radius: clamp(28px, 16%, 46px) / clamp(28px, 7.5%, 46px);
  background: #0d0d10;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.06) inset,
    0 0 0 1px rgb(0 0 0 / 0.2),
    var(--shadow-lg);
}

.phone img {
  border-radius: clamp(22px, 14%, 38px) / clamp(22px, 6.5%, 38px);
}

.phone-back {
  margin-top: clamp(32px, 7vw, 64px);
}

@media (max-width: 900px) {
  .phones-inner {
    grid-template-columns: 1fr;
  }
  .phone-pair {
    max-width: 520px;
    margin-inline: auto;
    width: 100%;
  }
}

/* ------------------------------------------------------------------- Mac */

.mac {
  position: relative;
  padding: clamp(80px, 11vw, 128px) 0;
  text-align: center;
  color: #e9e9ff;
  background:
    radial-gradient(50% 60% at 50% 0%, rgb(124 124 240 / 0.45), transparent 70%),
    radial-gradient(30% 40% at 85% 100%, rgb(255 122 61 / 0.18), transparent 70%),
    linear-gradient(180deg, #1b1a4a, #11102e);
  overflow: hidden;
}

.mac h2 {
  color: #fff;
}

.mac-icon {
  margin: 0 auto 26px;
  border-radius: 20px;
  box-shadow:
    0 20px 50px -12px rgb(0 0 0 / 0.6),
    0 0 0 1px rgb(255 255 255 / 0.12);
}

.eyebrow-light {
  color: #b9b9ff;
}

.mac-lede {
  margin: 18px auto 0;
  max-width: 600px;
  font-size: 18px;
  color: #c4c4e6;
}

.mac-points {
  list-style: none;
  padding: 0;
  margin: clamp(40px, 6vw, 56px) auto 0;
  max-width: 980px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  text-align: left;
}

.mac-points li {
  padding: 22px;
  border-radius: 14px;
  background: rgb(255 255 255 / 0.05);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.09);
}

.mac-points .ic {
  width: 22px;
  height: 22px;
  color: #b9b9ff;
}

.mac-points strong {
  display: block;
  margin-top: 12px;
  color: #fff;
  font-weight: 600;
}

.mac-points span {
  display: block;
  margin-top: 6px;
  font-size: 14.5px;
  line-height: 1.55;
  color: #b4b4d8;
}

.steps {
  list-style: none;
  padding: 0;
  margin: clamp(40px, 6vw, 56px) auto 34px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  font-size: 15.5px;
  color: #d8d8f5;
}

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

.steps span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.1);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.16);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.fine-light {
  color: #9d9dc8;
}

@media (max-width: 820px) {
  .mac-points {
    grid-template-columns: 1fr;
    max-width: 480px;
  }
  .steps {
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;
    margin-inline: auto;
  }
}

/* --------------------------------------------------------------- Closing */

.closing {
  padding: clamp(80px, 11vw, 128px) 0;
}

.closing .lede {
  margin-top: 16px;
}

.cta-center {
  justify-content: center;
}

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

.footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 36px;
  font-size: 14px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.footer-inner .brand {
  color: var(--ink);
}

.footer-inner nav {
  margin-left: auto;
  display: flex;
  gap: 20px;
}

.footer-inner nav a:hover {
  color: var(--ink);
}

.footer-note {
  margin-top: 14px;
  font-size: 12.5px;
  opacity: 0.85;
}

@media (max-width: 600px) {
  .footer-inner nav {
    margin-left: 0;
    width: 100%;
  }
}
