:root {
  --ink: #1b1c1e;
  --ink-soft: #2a2b2e;
  --paper: #ffffff;
  --mist: #f4f4f4;
  --line: #e6e6e6;
  --muted: #6b6c70;
  --muted-dark: #a3a4a8;
  --radius-icon: 22.5%;
  --wrap: 1120px;
  --accent: #9359ff;
  --sk-soft: #ececee;
  --sk-line: #e2e2e5;
  --sk-onink: rgba(255, 255, 255, 0.28);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--mist);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { margin: 0; line-height: 1.05; letter-spacing: -0.03em; }
h1 { font-size: clamp(2.75rem, 6vw, 5rem); font-weight: 800; line-height: 1.3; }
h2 { font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: 700; max-width: 26ch; text-wrap: balance; }
h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  border: 1.5px solid var(--ink);
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--small { padding: 8px 16px; font-size: 0.9rem; }
.btn--large { padding: 20px 32px; font-size: clamp(1rem, 2.5vw, 1.35rem); }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 14.4px; }
.brand__tile {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-icon);
  background: var(--ink);
  color: var(--paper);
}
.brand__mark { width: 14px; height: 24px; }
.brand__word {
  font-weight: 200;
  font-size: 2.2rem;
  line-height: 1;
  letter-spacing: 0.21em;
  margin-right: -0.21em;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: background-color .3s ease;
}
.nav .brand__tile,
.nav .brand__word,
.nav .btn { transition: background-color .3s ease, color .3s ease; }

/* Over a dark section the header flips to dark (set by nav.js). */
.nav--dark { background: rgba(27, 28, 30, 0.85); color: var(--paper); }
.nav--dark .brand__tile { background: var(--paper); color: var(--ink); }
.nav--dark .nav__links a:not(.btn) { color: var(--muted-dark); }
.nav--dark .nav__links a:not(.btn):hover { color: var(--paper); }
.nav--dark .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 84px; }
.nav__links { display: flex; align-items: center; gap: 28px; font-weight: 500; font-size: 0.95rem; }
.nav__links a:not(.btn) { color: var(--muted); transition: color .15s; }
.nav__links a:not(.btn):hover { color: var(--ink); }

/* Hero */
.hero { padding: 72px 0 112px; background: var(--paper); }
.hero__inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 48px;
}
/* Size the headline to its column so each line stays whole: the longest
   line, "Building utility,", is about 7em wide. */
.hero__copy { container-type: inline-size; }
.hero h1 { font-size: clamp(2rem, 13.5cqi, 5rem); }
.nowrap { white-space: nowrap; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 34ch; margin-top: 24px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.hero__art {
  position: relative;
  height: 620px;
  display: grid;
  place-items: center;
}

/* Device */
.device-wrap {
  position: relative;
  transform: scale(var(--device-scale, 1));
  /* Shrink the layout box along with the scale. */
  margin: calc((1 - var(--device-scale, 1)) * -269.5px) calc((1 - var(--device-scale, 1)) * -129.5px);
}
.device {
  position: relative;
  width: 259px;
  height: 539px;
  padding: 5.5px;
  border-radius: 42.5px;
  background: var(--ink);
  box-shadow: 0 40px 80px -30px rgba(27, 28, 30, 0.28);
  animation: float 7s ease-in-out infinite;
}
.device__screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 37px;
  background: #fafafa;
  overflow: hidden;
}
.device__status {
  position: absolute;
  inset: 0 0 auto;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-size: 11px;
  font-weight: 600;
}
.device__island {
  width: 72px;
  height: 20px;
  border-radius: 10px;
  background: var(--ink);
}
.device__battery {
  width: 20px;
  height: 9px;
  border-radius: 3px;
  border: 1.2px solid var(--ink);
  background: linear-gradient(90deg, var(--battery-color, var(--ink)) var(--battery-level, 100%), transparent 0) content-box;
  padding: 1px;
}
.device__power { display: flex; align-items: center; gap: 3px; }
.device__bolt { display: none; width: 6px; height: 9px; fill: var(--ink); }
.device__power.is-charging .device__bolt { display: block; }
.device__power.is-low { --battery-color: #ff3b30; }
.device__ui { position: absolute; inset: 0; }

/* Skeleton blocks */
.sk {
  position: absolute;
  cursor: pointer;
  background: var(--sk-soft);
  transition:
    left .75s cubic-bezier(.65, 0, .35, 1),
    top .75s cubic-bezier(.65, 0, .35, 1),
    width .75s cubic-bezier(.65, 0, .35, 1),
    height .75s cubic-bezier(.65, 0, .35, 1),
    border-radius .75s cubic-bezier(.65, 0, .35, 1),
    background-color .2s ease,
    opacity .4s ease,
    transform .25s ease;
}
.sk[data-tone="line"] { background: var(--sk-line); }
.sk[data-tone="ink"] { background: var(--ink); }
.sk[data-tone="onink"] { background: var(--sk-onink); }
.sk:hover { background: var(--accent); }
.sk[data-tone="onink"]:hover { background: var(--paper); }
/* Hovering the hero card, or a text line on it, turns the card purple
   and its text lines white. */
.device__ui:has([data-group="hero"]:hover) [data-key="hero"] { background: var(--accent); }
.device__ui:has([data-group="hero"]:hover) [data-key^="hl"] { background: var(--paper); }
.sk.is-hidden { opacity: 0; transform: scale(.85); pointer-events: none; }
.sk.is-pinged { animation: pulse .45s ease; }

.ping {
  position: absolute;
  pointer-events: none;
  border: 2px solid var(--sk-soft);
  animation: ping .9s cubic-bezier(.2, .6, .3, 1) forwards;
}

/* The ring keeps the element's own color; only the element turns purple. */
.ping[data-tone="line"] { border-color: var(--sk-line); }
.ping[data-tone="ink"] { border-color: var(--ink); }
.ping[data-tone="onink"] { border-color: var(--sk-onink); }

@keyframes ping {
  from { opacity: .7; transform: scale(1); }
  to { opacity: 0; transform: scale(1.35); }
}
@keyframes pulse {
  50% { transform: scale(.94); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Sections */
.section { padding: 112px 0; background: var(--paper); }
.section--dark { background: var(--ink); color: var(--paper); }
.section--dark .eyebrow,
.section--dark .section__lede,
.section--dark .card__num,
.section--dark .card p { color: var(--muted-dark); }
.section--dark .card { background: var(--ink-soft); }
.section__lede { font-size: 1.1rem; color: var(--muted); max-width: 52ch; margin-top: 20px; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 56px;
}

.card {
  background: var(--mist);
  border-radius: 28px;
  padding: 32px;
}
.card__num { display: block; font-weight: 700; color: var(--muted); margin-bottom: 48px; font-size: 0.9rem; }
.card h3 { line-height: 1.25; }
.card p { color: var(--muted); margin-top: 12px; }

/* Contact */
.contact {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

/* Footer */
.footer { padding: 40px 0; background: var(--ink); color: var(--paper); }
.footer .brand__tile { background: var(--paper); color: var(--ink); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer p { color: var(--muted-dark); font-size: 0.9rem; }

/* Responsive */
@media (max-width: 860px) {
  .hero { padding: 40px 0 80px; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { order: -1; height: 520px; --device-scale: .85; }
  .grid { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }
}

@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .nav__links { gap: 16px; }
  .nav__links a[href="#about"] { display: none; }
  .brand__word { font-size: 1.7rem; letter-spacing: 0.16em; margin-right: -0.16em; }
  .brand { gap: 11.2px; }
  .brand__tile { width: 34px; height: 34px; }
  .brand__mark { width: 12px; height: 20px; }
  .btn--large { width: 100%; }
  .hero { padding-top: 8px; }
  .hero__art { height: 420px; --device-scale: .72; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .device { animation: none; }
}
