/* unibadri.com: one stylesheet, no framework. */
:root {
  --bg: #0d0b0a;
  --bg-2: #151210;
  --ink: #f6efe6;
  --ink-2: #c9bfb3;
  --ink-3: #a99f95;
  --line: rgba(246, 239, 230, 0.12);
  --line-2: rgba(246, 239, 230, 0.18);
  --glass: rgba(24, 20, 17, 0.62);
  --amber: #ffb35c;
  --peach: #ff8a5b;
  --sage: #9fd3b4;
  --radius: 22px;
  --radius-sm: 12px;
  --max: 1240px;
  --pad: clamp(20px, 4vw, 48px);
  --sans: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--amber); color: #1a120a; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.serif { font-family: var(--serif); font-weight: 400; font-style: italic; letter-spacing: -0.01em; }
.muted { color: var(--ink-3); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* Ambient glow field */
.field {
  position: absolute; top: 0; left: 0; right: 0; height: 1600px; z-index: -1; pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent);
  background:
    radial-gradient(60vmax 42vmax at 18% -8%, rgba(255, 179, 92, 0.22), transparent 60%),
    radial-gradient(48vmax 38vmax at 92% 8%, rgba(255, 138, 91, 0.14), transparent 62%),
    radial-gradient(70vmax 50vmax at 50% 118%, rgba(159, 211, 180, 0.07), transparent 60%),
    var(--bg);
}
.field::after {
  content: ""; position: absolute; inset: 0; opacity: 0.06; mix-blend-mode: overlay;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Nav */
.nav {
  position: fixed; top: 14px; left: 0; right: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding-inline: max(var(--pad), calc((100vw - var(--max)) / 2 + var(--pad))); pointer-events: none;
}
.nav > * { pointer-events: auto; }
.brand { font-weight: 600; letter-spacing: -0.02em; font-size: 15px; display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: conic-gradient(from 200deg, var(--amber), var(--peach), #ffd7a8, var(--amber)); box-shadow: 0 0 24px rgba(255, 179, 92, 0.45); }
.pill {
  display: flex; gap: 2px; padding: 5px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.pill a { padding: 8px 16px; border-radius: 999px; font-size: 14px; color: var(--ink-2); transition: color .25s, background .25s; }
.pill a:hover, .pill a[aria-current="page"] { color: var(--ink); background: rgba(246, 239, 230, 0.08); }
.cta {
  justify-self: end; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; background: var(--ink); color: #15100c;
  font-weight: 600; font-size: 14px; transition: transform .3s var(--ease), box-shadow .3s;
}
.cta:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(255, 179, 92, 0.25); }
.cta .dot { width: 7px; height: 7px; border-radius: 50%; background: #2fbf71; box-shadow: 0 0 0 3px rgba(47, 191, 113, 0.2); }

/* Hero */
.hero { padding-block: clamp(150px, 22vh, 220px) clamp(60px, 10vh, 110px); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-2); }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--line-2); }
.display {
  margin: 22px 0 0; font-weight: 600; letter-spacing: -0.045em; line-height: 0.94;
  font-size: clamp(46px, 8vw, 118px); max-width: 15ch; text-wrap: balance;
}
.display .serif { color: var(--amber); letter-spacing: -0.02em; }
.lede { margin: 28px 0 0; max-width: 54ch; font-size: clamp(17px, 1.5vw, 20px); color: var(--ink-2); }
.proof { margin-top: 44px; display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 10px; padding: 12px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(246, 239, 230, 0.03);
}
.chip b { font-size: 26px; letter-spacing: -0.02em; font-weight: 600; }
.chip span { color: var(--ink-2); font-size: 15px; }

/* Shelf */
.shelf { padding-block: 40px 30px; }
.shelf-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding-top: 22px; margin-bottom: 26px; }
.shelf-head div p { margin: 0; }
.shelf-head h2 { margin: 6px 0 0; font-size: clamp(28px, 3.4vw, 44px); letter-spacing: -0.035em; line-height: 1; font-weight: 600; }
.shelf-head > p { margin: 0; max-width: 46ch; color: var(--ink-2); font-size: 16px; text-align: right; text-wrap: balance; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.card { grid-column: span 6; }
.card.wide { grid-column: span 12; }
.card a {
  position: relative; display: flex; flex-direction: column; height: 100%;
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background: var(--bg-2); transition: border-color .4s, transform .5s var(--ease);
}
.card a:hover { border-color: var(--line-2); transform: translateY(-4px); }
.card a::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 30%), rgba(255, 255, 255, 0.07), transparent 60%);
}
.card a:hover::after { opacity: 1; }
.cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.card.wide .cover { aspect-ratio: 21 / 8; }
.card-body { padding: 24px 26px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-meta { display: flex; justify-content: space-between; color: var(--ink-3); }
.card h3 { text-wrap: balance; margin: 0; font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -0.03em; line-height: 1.1; font-weight: 600; }
.card p { margin: 0; color: var(--ink-2); font-size: 16px; max-width: 52ch; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tags span { font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-3); }
.read { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; font-weight: 500; font-size: 14px; }
.read svg { transition: transform .35s var(--ease); }
.card a:hover .read svg { transform: translateX(4px); }

/* Cover art: metric-led until real product renders replace it */
.art {
  --h: 30;
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(20px, 3vw, 34px);
  background:
    radial-gradient(70% 100% at 85% 10%, hsla(var(--h), 90%, 62%, 0.55), transparent 62%),
    radial-gradient(60% 90% at 0% 120%, hsla(calc(var(--h) + 30), 80%, 50%, 0.35), transparent 60%),
    linear-gradient(165deg, hsl(var(--h), 24%, 12%), #0c0a09 75%);
}
.art::before {
  content: ""; position: absolute; width: 90%; aspect-ratio: 1; right: -30%; top: -50%; border-radius: 50%;
  border: 1px solid hsla(var(--h), 80%, 85%, 0.2);
  box-shadow: 0 0 0 70px hsla(var(--h), 80%, 85%, 0.03), 0 0 0 160px hsla(var(--h), 80%, 85%, 0.02);
}
.cover::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: linear-gradient(transparent, var(--bg-2)); pointer-events: none; }
.art .label { position: relative; margin-bottom: 18px; color: hsla(var(--h), 70%, 92%, 0.9); }
.art .metric { position: relative; }
.art .metric b {
  display: block; font-weight: 600; letter-spacing: -0.05em; line-height: 0.9;
  font-size: clamp(52px, 7vw, 104px); color: #fff8f0; text-shadow: 0 0 60px hsla(var(--h), 90%, 60%, 0.45);
}
.card:not(.wide) .art .metric b { font-size: clamp(48px, 5.4vw, 80px); }
.art .metric span { display: block; margin-top: 14px; font-size: 16px; color: #f3e9de; max-width: 30ch; }

/* How I work */
.principles { padding-block: 80px 20px; }
.principles ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 48px); counter-reset: p; }
.principles li { border-top: 1px solid var(--line-2); padding-top: 20px; counter-increment: p; }
.principles li::before { content: "0" counter(p); font-family: var(--mono); font-size: 12px; color: var(--amber); letter-spacing: .08em; }
.principles h3 { margin: 12px 0 8px; font-size: 22px; letter-spacing: -0.025em; font-weight: 600; line-height: 1.15; }
.principles p { margin: 0; color: var(--ink-2); font-size: 17px; }
.principles h3 { font-size: 24px; text-wrap: balance; }

/* Contact */
.contact { padding-block: 80px 60px; }
.contact-card {
  position: relative; overflow: hidden; border-radius: 28px; padding: clamp(36px, 6vw, 72px);
  border: 1px solid var(--line);
  background: radial-gradient(80% 120% at 85% 0%, rgba(255, 179, 92, 0.24), transparent 60%), var(--bg-2);
}
.contact-card h2 .serif { color: var(--amber); }
.contact-card h2 { margin: 14px 0 0; font-size: clamp(36px, 6vw, 80px); letter-spacing: -0.04em; line-height: 1.02; font-weight: 600; max-width: 14ch; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 20px; border-radius: 999px; border: 1px solid var(--line-2); font-weight: 500; font-size: 15px; transition: background .25s, border-color .25s; }
.btn:hover { background: rgba(246, 239, 230, 0.06); border-color: rgba(246, 239, 230, 0.32); }
.btn.solid { background: var(--ink); color: #15100c; border-color: var(--ink); font-weight: 600; }
.btn.solid:hover { background: #fff; }

footer { padding-block: 30px 50px; color: var(--ink-3); font-size: 14px; }
footer .row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 24px; }
footer a:hover { color: var(--ink); }

/* Case study */
.cs-hero { padding-block: clamp(140px, 20vh, 190px) 40px; }
.back { display: flex; width: fit-content; align-items: center; gap: 8px; color: var(--ink-3); font-size: 14px; transition: color .25s; }
.back:hover { color: var(--ink); }
.cs-hero h1 { margin: 22px 0 0; font-size: clamp(42px, 7vw, 104px); letter-spacing: -0.045em; line-height: 0.95; font-weight: 600; max-width: 16ch; }
.cs-hero .lede { max-width: 46ch; }
.meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 46px; border-top: 1px solid var(--line); padding-top: 20px; }
.meta dt { color: var(--ink-3); }
.meta dd { margin: 6px 0 0; font-size: 15px; color: var(--ink); }
.cs-cover { position: relative; aspect-ratio: 21 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); margin-top: 20px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 34px 0 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { padding: 26px 24px; border-right: 1px solid var(--line); background: rgba(246, 239, 230, 0.02); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-size: clamp(26px, 3vw, 40px); letter-spacing: -0.04em; font-weight: 600; line-height: 1; }
.stat span { display: block; margin-top: 10px; color: var(--ink-2); font-size: 15px; line-height: 1.4; }
.cs-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(30px, 6vw, 90px); padding-block: 80px 40px; }
.toc { position: sticky; top: 110px; align-self: start; display: grid; gap: 4px; }
.toc a { color: var(--ink-3); font-size: 12.5px; padding: 6px 0 6px 14px; border-left: 1px solid var(--line); transition: color .25s, border-color .25s; }
.toc a:hover, .toc a.on { color: var(--ink); border-color: var(--amber); }
.prose { max-width: 68ch; }
.prose h2 { font-size: clamp(28px, 3vw, 38px); letter-spacing: -0.035em; line-height: 1.05; font-weight: 600; margin: 72px 0 18px; scroll-margin-top: 110px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 21px; letter-spacing: -0.02em; margin: 36px 0 8px; font-weight: 600; }
.prose p, .prose li { color: var(--ink-2); font-size: 18px; line-height: 1.65; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul { padding-left: 0; list-style: none; }
.prose li { position: relative; padding-left: 22px; margin: 10px 0; }
.prose li::before { content: ""; position: absolute; left: 2px; top: 0.72em; width: 8px; height: 1px; background: var(--amber); }
.next { margin: 60px 0 0; }
.next a { display: flex; min-height: 120px; justify-content: space-between; align-items: center; gap: 20px; padding: 30px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); transition: border-color .3s; }
.next a:hover { border-color: var(--line-2); }
.next a > svg { width: 28px; height: 28px; flex: none; }
.next h3 { margin: 6px 0 0; font-size: clamp(24px, 3vw, 36px); letter-spacing: -0.035em; font-weight: 600; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(30px, 6vw, 90px); padding-bottom: 40px; }
.about-grid .prose { max-width: 60ch; }
.facts { display: grid; gap: 0; align-self: start; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.facts div { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 6px 0 0; }

/* Reveal motion */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card a, .card a:hover { transform: none; }
}

@media (max-width: 900px) {
  .card, .card.wide { grid-column: span 12; }
  .card.wide .cover { aspect-ratio: 16 / 10; }
  .principles ol { grid-template-columns: 1fr; }
  .meta { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .cs-body { grid-template-columns: 1fr; }
  .toc { display: none; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .display { line-height: 1.02; letter-spacing: -0.035em; }
  .chip { width: 100%; }
  .hero { padding-block-end: 40px; }
  .shelf-head > p { text-align: left; }
  .nav { grid-template-columns: auto 1fr; }
  .nav .pill { display: none; }
  .brand > span:last-child { display: none; }
  .cs-hero { padding-block-start: 120px; }
  .meta { grid-template-columns: 1fr; gap: 14px; }
  .art::before { opacity: .5; }
  .shelf-head { flex-direction: column; align-items: start; }
}
