/* Shared foundation: tokens, type, layout, nav, footer and the motion helpers every page uses. */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --black: #000;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --paper: #fff;
  --mist: #f5f5f7;
  --mist-2: #e8e8ed;
  --night-1: #161617;
  --night-2: #1d1d1f;
  --night-3: #2c2c2e;
  --on-dark: #f5f5f7;
  --on-dark-2: #a1a1a6;

  --blue: #0071e3;
  --blue-hover: #0077ed;
  --link: #0066cc;
  --link-dark: #2997ff;
  --live: #ff453a;
  --ok: #30d158;

  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 48px);
  --sec: clamp(96px, 13vw, 184px);
  --nav-h: 52px;
  --r-xl: 32px;
  --r-lg: 24px;
  --r: 18px;
  --r-sm: 12px;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.76, 0, .24, 1);
  --ease-soft: cubic-bezier(.33, 1, .68, 1);

  /* Chat wallpaper: an engineer's doodles (braces, a tag, a database, a cloud, a cog, coffee, a prompt, a bolt). */
  --doodle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180' fill='none' stroke='%23e2dacd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M26 14c-6 0-7 3-7 8v5c0 3-2 5-5 5 3 0 5 2 5 5v5c0 5 1 8 7 8M40 14c6 0 7 3 7 8v5c0 3 2 5 5 5-3 0-5 2-5 5v5c0 5-1 8-7 8'/%3E%3Cpath d='M88 20l-10 12 10 12M112 20l10 12-10 12M104 16l-8 32'/%3E%3Cellipse cx='155' cy='20' rx='14' ry='5'/%3E%3Cpath d='M141 20v22c0 3 6 5 14 5s14-2 14-5V20M141 31c0 3 6 5 14 5s14-2 14-5'/%3E%3Cpath d='M24 112a10 10 0 0 1 1-20 14 14 0 0 1 27-3 10 10 0 0 1 2 23z'/%3E%3Ccircle cx='104' cy='98' r='8'/%3E%3Cpath d='M104 82v5M104 109v5M88 98h5M115 98h5M93 87l3 3M112 106l3 3M93 109l3-3M112 90l3-3'/%3E%3Cpath d='M142 90h18v14a9 9 0 0 1-18 0zM160 94h4a4 4 0 0 1 0 8h-4M147 82c0-3 3-3 3-6M154 82c0-3 3-3 3-6'/%3E%3Crect x='16' y='140' width='40' height='28' rx='5'/%3E%3Cpath d='M23 150l5 4-5 4M32 160h10'/%3E%3Cpath d='M84 144h30a6 6 0 0 1 6 6v10a6 6 0 0 1-6 6H96l-8 6v-6h-4a6 6 0 0 1-6-6v-10a6 6 0 0 1 6-6z'/%3E%3Cpath d='M150 138l-10 16h9l-4 14 12-18h-9l4-12z'/%3E%3C/svg%3E");
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -.011em;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
:focus-visible { outline: 3px solid var(--link-dark); outline-offset: 3px; border-radius: 8px; }
::selection { background: rgba(41, 151, 255, .32); }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 12px; top: -64px; z-index: 200;
  padding: 10px 16px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 14px;
  transition: top .2s var(--ease-out);
}
.skip:focus { top: 10px; }

/* ---------- Page-to-page transitions ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .26s var(--ease-out) both; }
::view-transition-new(root) { animation: vt-in .62s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: scale(.985); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(28px); } }

/* ---------- Layout ---------- */
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.wrap-wide { width: min(100% - 2 * var(--gutter), 1440px); margin-inline: auto; }
.sec { padding-block: var(--sec); position: relative; }
.dark { background: var(--black); color: var(--on-dark); }
.night { background: var(--night-1); color: var(--on-dark); }
.mist { background: var(--mist); }
.center { text-align: center; }
.center .t-lead { margin-inline: auto; }

/* ---------- Type ---------- */
.t-hero { font-size: clamp(54px, 10.4vw, 156px); font-weight: 700; line-height: .95; letter-spacing: -.052em; }
.t-display { font-size: clamp(38px, 7.2vw, 100px); font-weight: 700; line-height: 1.02; letter-spacing: -.042em; }
.t-title { font-size: clamp(34px, 4.8vw, 64px); font-weight: 700; line-height: 1.06; letter-spacing: -.036em; }
.t-sub { font-size: clamp(22px, 2.3vw, 30px); font-weight: 600; line-height: 1.18; letter-spacing: -.024em; }
.t-lead { font-size: clamp(19px, 1.85vw, 24px); font-weight: 500; line-height: 1.42; letter-spacing: -.018em; max-width: 40em; }
.t-small { font-size: 14px; line-height: 1.45; letter-spacing: -.006em; }
.t-kicker { font-size: clamp(17px, 1.6vw, 21px); font-weight: 600; letter-spacing: -.016em; }
h1, h2, h3, .t-lead, .t-sub { text-wrap: balance; }
.muted { color: var(--ink-2); }
.dark .muted, .night .muted { color: var(--on-dark-2); }
.num { font-variant-numeric: tabular-nums; }
.lead-gap { margin-top: clamp(16px, 2vw, 24px); }

.metal {
  background: linear-gradient(100deg, #8e8e93 0%, #f5f5f7 22%, #c7c7cc 40%, #ffffff 52%, #a1a1a6 70%, #e5e5ea 100%);
  background-size: 220% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html.js .ready .metal { animation: sheen 2.6s var(--ease-soft) .35s both; }
@keyframes sheen { from { background-position: 100% 0; } to { background-position: 0% 0; } }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 24px; border: 0; border-radius: 999px;
  background: var(--blue); color: #fff; font-size: 17px; font-weight: 500; letter-spacing: -.016em;
  transition: background-color .18s ease, transform .14s var(--ease-out);
}
.btn:hover { background: var(--blue-hover); }
.btn:active { transform: scale(.97); }
.btn-quiet { background: rgba(0, 0, 0, .06); color: var(--ink); }
.btn-quiet:hover { background: rgba(0, 0, 0, .1); }
.dark .btn-quiet, .night .btn-quiet { background: rgba(255, 255, 255, .12); color: var(--on-dark); }
.dark .btn-quiet:hover, .night .btn-quiet:hover { background: rgba(255, 255, 255, .2); }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 15px; }

.more { display: inline-flex; align-items: center; gap: 4px; color: var(--link); font-size: 17px; font-weight: 500; }
.dark .more, .night .more { color: var(--link-dark); }
.more::after {
  content: ""; width: 7px; height: 7px; margin-left: 2px;
  border-right: 2px solid currentColor; border-top: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .2s var(--ease-out);
}
.more:hover { text-decoration: underline; text-underline-offset: 3px; }
.more:hover::after { transform: translateX(3px) rotate(45deg); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.center .cta-row { justify-content: center; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: 999px; font-size: 14px; font-weight: 500;
  background: var(--mist); color: var(--ink);
}
.dark .chip, .night .chip { background: var(--night-3); color: var(--on-dark); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }

.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--live); position: relative; flex: none; }
.live-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit;
  animation: pulse 1.8s var(--ease-out) infinite;
}
@keyframes pulse { from { transform: scale(1); opacity: .7; } to { transform: scale(3); opacity: 0; } }

/* Portrait fallback: a monogram until assets/img/rahul.jpg exists. */
.ph-mono { display: none; }
.no-photo img { display: none; }
.no-photo .ph-mono {
  display: grid; place-items: center; position: absolute; inset: 0;
  font-size: clamp(96px, 12vw, 180px); font-weight: 800; letter-spacing: -.06em; color: rgba(0, 0, 0, .14);
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 100; height: var(--nav-h);
  color: var(--ink); view-transition-name: site-nav;
  transition: color .3s ease;
}
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(255, 255, 255, .74);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  transition: background-color .3s ease;
}
.nav[data-tone="dark"] { color: var(--on-dark); }
.nav[data-tone="dark"]::before { background: rgba(22, 22, 23, .74); }
.nav-in { height: 100%; display: flex; align-items: center; gap: 30px; width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.brand-mark {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px;
  background: currentColor; font-size: 11px; font-weight: 800; letter-spacing: -.02em;
}
.brand-mark span { color: var(--paper); }
.nav[data-tone="dark"] .brand-mark span { color: var(--black); }
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; font-size: 14px; }
.nav-links a { opacity: .78; transition: opacity .18s ease; padding-block: 14px; }
.nav-links a:hover { opacity: 1; }
.nav-links a[aria-current="page"] { opacity: 1; font-weight: 600; }
.nav-cta { font-size: 14px; font-weight: 500; padding: 6px 15px; border-radius: 999px; background: var(--blue); color: #fff; transition: background-color .18s ease, transform .14s var(--ease-out); }
.nav-cta:hover { background: var(--blue-hover); }
.nav-cta:active { transform: scale(.96); }
.nav-cta[aria-current="page"] { background: rgba(127, 127, 127, .24); color: inherit; }
.nav-toggle { display: none; flex-direction: column; justify-content: center; align-items: center; gap: 6px; width: 44px; height: 44px; margin-right: -10px; border: 0; background: none; }
.nav-toggle span { display: block; width: 18px; height: 1.5px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease-out); }
.nav.open .nav-toggle span:first-child { transform: translateY(3.75px) rotate(45deg); }
.nav.open .nav-toggle span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
.nav-menu {
  position: fixed; inset: var(--nav-h) 0 0; z-index: 99; overflow-y: auto;
  padding: 18px var(--gutter) 48px; background: var(--paper); color: var(--ink);
}
.nav[data-tone="dark"] .nav-menu { background: var(--black); color: var(--on-dark); }
.nav-menu ul { list-style: none; padding: 0; margin: 0; }
.nav-menu a {
  display: block; padding: 8px 0; font-size: 30px; font-weight: 700; letter-spacing: -.035em;
  opacity: 0; transform: translateY(-10px);
}
.nav.open .nav-menu a { animation: menu-in .5s var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 45ms + 40ms); }
@keyframes menu-in { to { opacity: 1; transform: none; } }
.nav-menu p { margin-top: 28px; }

@media (max-width: 820px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding-top: calc(var(--nav-h) + clamp(72px, 11vw, 150px)); padding-bottom: clamp(56px, 8vw, 112px); }
.page-hero .t-lead { margin-top: clamp(18px, 2.2vw, 28px); }
.page-hero .cta-row { margin-top: 32px; }

/* ---------- Motion helpers ---------- */
html.js .reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 80ms);
}
html.js .reveal.scale { transform: scale(.94); }
html.js .reveal.left { transform: translateX(-36px); }
html.js .reveal.in { opacity: 1; transform: none; }

.rise { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.rise > span { display: inline-block; }
html.js .rise > span { transform: translateY(108%); }
html.js .ready .rise > span { transform: none; transition: transform 1.15s var(--ease-out); transition-delay: calc(var(--i, 0) * 110ms + 80ms); }

html.js .fade-load { opacity: 0; transform: translateY(16px); }
html.js .ready .fade-load { opacity: 1; transform: none; transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); transition-delay: calc(var(--i, 0) * 110ms + 300ms); }

[data-words] .w { transition: color .25s linear, opacity .25s linear; }
html.js [data-words] .w { opacity: .18; }
html.js [data-words] .w.on { opacity: 1; }

/* ---------- Next-page band ---------- */
.next { display: grid; gap: 22px; }
.next a.next-link { display: inline-block; transition: opacity .2s ease; }
.next a.next-link:hover { opacity: .72; }
.next .t-display span { color: var(--on-dark-2); }

/* ---------- Footer ---------- */
.foot { padding: clamp(80px, 10vw, 140px) 0 36px; background: var(--black); color: var(--on-dark); overflow: hidden; }
.foot-word {
  font-size: 12.6vw; font-weight: 700; letter-spacing: -.055em; line-height: .9; white-space: nowrap;
  color: #2a2a2c; margin-left: calc(-.02em);
}
.foot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: clamp(40px, 6vw, 80px); }
.foot h2 { font-size: 14px; font-weight: 600; color: var(--on-dark); margin-bottom: 12px; letter-spacing: -.006em; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 15px; color: var(--on-dark-2); }
.foot a { transition: color .18s ease; }
.foot a:hover { color: var(--on-dark); }
.foot-note { margin-top: 56px; font-size: 13px; color: #86868b; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :last-child { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  html.js .reveal, html.js .rise > span, html.js .fade-load { opacity: 1 !important; transform: none !important; }
  html.js [data-words] .w { opacity: 1; }
  @view-transition { navigation: none; }
}
