@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/dm-mono-400-latin.woff2') format('woff2');
}

:root {
  --bg: #f7f7f5;
  --card: #ffffff;
  --text: #171717;
  --muted: #6b6b68;
  --faint: #a3a3a0;
  --line: rgba(0, 0, 0, 0.07);
  --line-strong: rgba(0, 0, 0, 0.12);
  --hover: #f1f1ee;
  --button: #171717;
  --button-text: #fafafa;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-lift: 0 1px 2px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.08);
  --dots: rgba(0, 0, 0, 0.09);
  --accent: #22c55e;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0b;
    --card: #141414;
    --text: #ededed;
    --muted: #8f8f8c;
    --faint: #5c5c5a;
    --line: rgba(255, 255, 255, 0.07);
    --line-strong: rgba(255, 255, 255, 0.13);
    --hover: #1c1c1c;
    --button: #ededed;
    --button-text: #0b0b0b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lift: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 32px rgba(0, 0, 0, 0.5);
    --dots: rgba(255, 255, 255, 0.08);
  }
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.6 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: var(--text); color: var(--bg); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 8px; }

.mono { font-family: 'DM Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font-size: 13px; color: var(--muted); margin-bottom: 10px; }

/* ── Nav ─────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 20px 14px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 500; text-decoration: none; }
.mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}

main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* ── Hero ────────────────────────────────────────────── */
.hero { padding: clamp(56px, 12vh, 128px) 0 clamp(56px, 9vh, 96px); max-width: 780px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 13px;
}
.pill .mono { font-size: 12px; color: var(--text); }
.dot { position: relative; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--accent);
  animation: ping 2.4s var(--ease-out) infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: 0.6; } 70%, 100% { transform: scale(3); opacity: 0; } }

h1 {
  font-size: clamp(44px, 8.4vw, 88px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
  margin-bottom: 28px;
}
.word { display: inline-block; }
.soft { color: var(--faint); }
.lead { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 540px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }

/* ── Buttons ─────────────────────────────────────────── */
.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--button);
  border-radius: 10px;
  background: var(--button);
  color: var(--button-text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}
.button.ghost { background: var(--card); color: var(--text); border-color: var(--line-strong); box-shadow: var(--shadow); }
.button.small { height: 34px; padding: 0 14px; font-size: 13px; }
.button:active { transform: scale(0.97); }

/* ── Bento ───────────────────────────────────────────── */
.bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.card-text { padding: 20px 22px 22px; }
.card h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 10px; }
.card h3 { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.card .muted { font-size: 14px; line-height: 1.55; }
.demo {
  position: relative;
  height: 220px;
  border-bottom: 1px solid var(--line);
  background-image: radial-gradient(var(--dots) 1px, transparent 1px);
  background-size: 14px 14px;
  background-position: center;
}

/* Project card */
.card-project {
  grid-column: span 2;
  grid-row: span 2;
  flex-direction: row;
  align-items: stretch;
  min-height: 520px;
}
.card-project {
  background-image: radial-gradient(circle at 78% 70%, transparent, var(--card) 60%), radial-gradient(var(--dots) 1px, transparent 1px);
  background-size: auto, 14px 14px;
}
.card-project .card-text { flex: 1; display: flex; flex-direction: column; padding: 32px; }
.card-project h2 { font-size: clamp(26px, 3vw, 34px); margin-bottom: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: auto 0 0; padding-top: 24px; }
.tags li { padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 12px; color: var(--muted); }

.phone {
  flex: 0 0 auto;
  align-self: flex-end;
  width: 250px;
  height: 480px;
  margin: 40px 36px -40px 0;
  padding: 8px;
  border-radius: 44px;
  background: #0f0f0f;
  box-shadow: var(--shadow-lift), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: rotate(-3deg);
  transition: transform 500ms var(--ease-out);
}
.phone-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 36px;
  background: #fafaf8;
  color: #171717;
}
.phone-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 34px 18px 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.phone-avatar { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, #fbbf24, #f472b6); }
.feed {
  flex: 1;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 8%, #000 88%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 8%, #000 88%, transparent);
}
.feed-track { display: flex; flex-direction: column; gap: 10px; padding: 8px 12px; animation: feed 16s linear infinite; }
@keyframes feed { to { transform: translateY(calc(-50% - 5px)); } }
.event { padding: 8px; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04); }
.event-img { height: 78px; border-radius: 10px; margin-bottom: 8px; }
.i1 { background: linear-gradient(135deg, #fde68a, #fb923c); }
.i2 { background: linear-gradient(135deg, #a7f3d0, #38bdf8); }
.i3 { background: linear-gradient(135deg, #c4b5fd, #f0abfc); }
.i4 { background: linear-gradient(135deg, #fecaca, #f87171); }
.event-title { font-size: 12.5px; font-weight: 600; letter-spacing: -0.01em; padding: 0 2px; }
.event-meta { font-size: 11px; color: #737373; padding: 0 2px 2px; }

/* Toast demo */
.demo-toasts { display: flex; align-items: flex-end; justify-content: center; padding-bottom: 20px; }
.toaster {
  position: absolute;
  left: 50%;
  top: 28px;
  width: min(260px, calc(100% - 40px));
  height: 110px;
  margin: 0;
  padding: 0;
  list-style: none;
  transform: translateX(-50%);
}
.toast {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
  font-size: 13px;
  font-weight: 500;
  transform-origin: top center;
  transition: transform 400ms var(--ease-out), opacity 400ms var(--ease-out);
  will-change: transform;
}
.toast-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  color: var(--card);
}

/* Drag demo */
.demo-drag { display: grid; place-items: center; overflow: hidden; touch-action: none; }
.drag-rings {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 1px dashed var(--line-strong);
}
.drag-knob {
  position: relative;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 22px;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-lift);
  cursor: grab;
  user-select: none;
  touch-action: none;
  will-change: transform;
}
.drag-knob.is-dragging { cursor: grabbing; }

/* Tabs demo */
.card-wide { grid-column: span 2; }
.demo-tabs { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 20px; }
.segmented {
  position: relative;
  display: flex;
  padding: 3px;
  border-radius: 12px;
  background: var(--hover);
  box-shadow: inset 0 0 0 1px var(--line);
}
.segmented button {
  position: relative;
  z-index: 1;
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 200ms ease;
  -webkit-tap-highlight-color: transparent;
}
.segmented button[aria-selected='true'] { color: var(--text); }
.seg-indicator {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 0;
  border-radius: 9px;
  background: var(--card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 1px var(--line);
  transition: transform 300ms var(--ease-out), width 300ms var(--ease-out);
}
.tab-panels { display: grid; width: 100%; max-width: 440px; }
.stack {
  grid-area: 1 / 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  opacity: 0;
  filter: blur(4px);
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 250ms var(--ease-out), filter 250ms var(--ease-out), transform 250ms var(--ease-out);
}
.stack.is-active { opacity: 1; filter: blur(0); transform: none; pointer-events: auto; }
.stack li {
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card);
  font-size: 13px;
  box-shadow: var(--shadow);
}

/* Clock demo */
.demo-clock { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.big-time { font-size: 44px; letter-spacing: -0.04em; line-height: 1; }
.sec { color: var(--faint); }

/* ── Contact ─────────────────────────────────────────── */
.contact { padding: clamp(96px, 16vh, 160px) 0 clamp(80px, 12vh, 120px); text-align: center; display: flex; flex-direction: column; align-items: center; }
.contact-title { font-size: clamp(36px, 6vw, 64px); font-weight: 600; line-height: 1.02; letter-spacing: -0.045em; margin-bottom: 20px; }
.contact .hero-actions { justify-content: center; }

.copy-label { display: grid; }
.copy-a, .copy-b {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 200ms var(--ease-out), filter 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.copy-b { opacity: 0; filter: blur(4px); transform: scale(0.9); }
.copy.is-copied .copy-a { opacity: 0; filter: blur(4px); transform: scale(0.9); }
.copy.is-copied .copy-b { opacity: 1; filter: blur(0); transform: none; }

/* ── Footer ──────────────────────────────────────────── */
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 20px calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.footer-links { display: flex; gap: 20px; }
.site-footer a { text-decoration: none; transition: color 160ms ease; }

/* ── Hover, only where there is a real pointer ───────── */
@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover { color: var(--text); background: var(--hover); }
  .button:hover { opacity: 0.88; }
  .button.ghost:hover { opacity: 1; background: var(--hover); }
  .site-footer a:hover { color: var(--text); }
  .card-project:hover .phone { transform: rotate(0deg) translateY(-12px); }
  .segmented button:not([aria-selected='true']):hover { color: var(--text); }
}

/* ── Motion: entrance + scroll reveal ────────────────── */
.home .enter, .home .word {
  animation: enter 800ms var(--ease-out) both;
  animation-delay: calc(var(--d) * 70ms + 80ms);
}
@keyframes enter { from { opacity: 0; transform: translateY(12px); filter: blur(6px); } }

.js .reveal { opacity: 0; transform: translateY(16px); filter: blur(4px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out), filter 700ms var(--ease-out); }
.js .reveal.is-in { opacity: 1; transform: none; filter: none; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 860px) {
  .bento { grid-template-columns: 1fr; }
  .card-project, .card-wide { grid-column: auto; grid-row: auto; }
  .card-project { flex-direction: column; min-height: 0; }
  .card-project .card-text { padding: 24px 22px 8px; }
  .phone { align-self: center; width: 230px; height: 400px; margin: 24px 0 -60px; }
}
@media (max-width: 420px) {
  .nav-links a { padding: 6px 10px; }
  .brand span:last-child { display: none; }
}

/* ── Legal pages ─────────────────────────────────────── */
.legal main { max-width: 640px; padding-top: 64px; padding-bottom: 64px; }
.legal h1 { font-size: 32px; letter-spacing: -0.035em; line-height: 1.1; margin-bottom: 8px; }
.legal h2 { font-size: 15px; font-weight: 600; margin: 36px 0 8px; }
.legal p, .legal address { margin: 0 0 14px; }
.legal address { font-style: normal; }
.legal a { text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.back { display: inline-block; margin-bottom: 40px; color: var(--muted); font-size: 13px; text-decoration: none; }
.legal footer { display: flex; gap: 20px; width: 100%; max-width: 640px; margin: 0 auto; padding: 24px 20px 32px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.legal footer a { text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .home .enter, .home .word { animation-name: fade; }
  @keyframes fade { from { opacity: 0; } }
  .js .reveal { transform: none; filter: none; }
  .dot::after, .feed-track { animation: none; }
  .phone, .card-project:hover .phone { transform: none; }
  .button:active { transform: none; }
}
