/* ------------------------------------------------------------------
   Sam Chowdi — Portfolio
   Warm editorial light theme with dark mode.
   Edit tokens below to retune the whole site.
------------------------------------------------------------------ */

:root {
  --bg: #f7f4ee;
  --bg-elev: #fdfcf9;
  --ink: #17160f;
  --ink-2: #4a4740;
  --muted: #7a766c;
  --line: #e4dfd4;
  --line-strong: #cfc9bc;
  --accent: #c2542b;
  --accent-ink: #ffffff;
  --accent-soft: rgba(194, 84, 43, 0.10);
  --blob: #ece2d6;
  --hero-accent: #e0472c;
  --shadow: none;

  --serif: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sans: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --max: 1160px;
  --gutter: clamp(20px, 5vw, 56px);
  --section: clamp(72px, 10vw, 120px);
  --radius: 14px;
  --radius-sm: 10px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #121110;
    --bg-elev: #1a1917;
    --ink: #f1ede5;
    --ink-2: #c9c3b6;
    --muted: #918b7e;
    --line: #2a2723;
    --line-strong: #3b3730;
    --accent: #e3764f;
    --accent-ink: #121110;
    --accent-soft: rgba(227, 118, 79, 0.14);
    --shadow: none;
    --blob: #2b2521;
    --hero-accent: #f06a4e;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #121110;
  --bg-elev: #1a1917;
  --ink: #f1ede5;
  --ink-2: #c9c3b6;
  --muted: #918b7e;
  --line: #2a2723;
  --line-strong: #3b3730;
  --accent: #e3764f;
  --accent-ink: #121110;
  --accent-soft: rgba(227, 118, 79, 0.14);
  --blob: #2b2521;
  --hero-accent: #f06a4e;
  --shadow: none;
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::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-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .35s ease, color .35s ease;
  overflow-x: clip;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Type ---------- */
.serif { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; }
.display {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 4.8vw, 60px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.display em, .h2 em, .h3 em { font-style: normal; color: inherit; }
.h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.h4 { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.4; }
.lede { font-size: clamp(16px, 1.3vw, 18px); line-height: 1.65; color: var(--ink-2); max-width: 60ch; text-wrap: pretty; }
.body { color: var(--ink-2); max-width: 64ch; text-wrap: pretty; }
.label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ---------- Layout ---------- */
.wrap { width: min(var(--max), 100% - var(--gutter) * 2); margin-inline: auto; }
.section { padding-block: var(--section); }
.section + .section { padding-top: 0; }
.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: clamp(40px, 6vw, 72px);
}
@media (min-width: 820px) {
  .section-head { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: end; gap: 40px; }
  .section-head .lede { justify-self: end; }
}
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 20px;
  border-radius: 8px;
  font-weight: 500; font-size: 14px; letter-spacing: -0.005em;
  border: 1px solid var(--ink);
  background: var(--ink); color: var(--bg);
  transition: background-color .2s, color .2s, border-color .2s, opacity .2s;
  white-space: nowrap;
}
.btn:hover { opacity: .85; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.link {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; font-size: 14px;
  border-bottom: 1px solid transparent;
  transition: border-color .25s, color .25s;
}
.link:hover { border-color: currentColor; color: var(--accent); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; }
.brand .dot { display: none; }
.nav-links { display: none; align-items: center; gap: 28px; }
.nav-links a { font-size: 14px; font-weight: 400; color: var(--ink-2); transition: color .2s; position: relative; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line-strong); color: var(--ink);
  transition: background-color .2s, border-color .2s;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
.icon-sun { display: none; }
.icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}
.nav .btn { height: 38px; padding: 0 14px; font-size: 13px; }
.menu-btn { display: inline-grid; }
@media (max-width: 480px) { .nav .btn { display: none; } }
@media (min-width: 820px) {
  .nav-links { display: flex; }
  .menu-btn { display: none; }
}
.mobile-menu {
  display: none; border-top: 1px solid var(--line);
  background: var(--bg);
}
.mobile-menu.open { display: block; }
.mobile-menu a { display: block; padding: 14px 0; font-size: 17px; font-weight: 500; border-bottom: 1px solid var(--line); }
.mobile-menu a:last-child { border-bottom: 0; }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(48px, 7vw, 96px); padding-bottom: clamp(56px, 8vw, 110px); }
.hero-grid { display: grid; gap: 44px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr); gap: clamp(40px, 6vw, 96px); } }
.hero .label { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.hero .label .pulse { width: 7px; height: 7px; border-radius: 50%; background: #2e9d5f; }
.hero .display em { color: var(--hero-accent); font-weight: 600; font-style: normal; }
.hero .lede { margin-top: 22px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 40px; color: var(--muted); font-size: 14px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }

.portrait {
  max-width: 440px;
  margin-inline: auto;
}
.portrait svg { display: block; width: 100%; height: auto; }
@media (max-width: 899px) { .portrait { max-width: 340px; } }

/* ---------- Work list ---------- */
.work { display: grid; gap: clamp(28px, 4vw, 48px); }
.work-item {
  display: grid; gap: 22px;
  padding-top: clamp(28px, 4vw, 48px);
  border-top: 1px solid var(--line);
}
@media (min-width: 860px) {
  .work-item { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
  .work-item:nth-child(even) .work-media-link { order: 2; }
}
.work-media {
  position: relative; display: block;
  aspect-ratio: 16 / 11; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-elev); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.work-media img { width: 100%; height: 100%; object-fit: cover; }
.work-media.contain img { object-fit: contain; padding: clamp(24px, 5%, 48px); }
.work-media .cover {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(160deg, var(--cover-a, #e9e2d3), var(--cover-b, #d7ccb8));
}
.work-media .cover span { font-family: var(--serif); font-weight: 500; font-size: clamp(32px, 4vw, 48px); color: rgba(23,22,15,.75); letter-spacing: -0.02em; }
.work-body { display: grid; gap: 16px; align-content: center; }
.work-index { display: flex; align-items: center; gap: 14px; }
.work-index .n { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.work-index .sep { flex: 0 0 24px; height: 1px; background: var(--line-strong); }
.work-title { font-weight: 500; font-size: clamp(24px, 2.4vw, 30px); line-height: 1.2; letter-spacing: -0.02em; }
.work-title a { transition: color .25s; }
.work-title a:hover { color: var(--accent); }
.work-desc { color: var(--ink-2); max-width: 52ch; text-wrap: pretty; font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill {
  font-size: 12px; font-weight: 500;
  padding: 5px 10px; border-radius: 6px;
  border: 1px solid var(--line-strong); color: var(--ink-2);
}
.work-links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 4px; }

/* ---------- About ---------- */
.about-grid { display: grid; gap: 40px; }
@media (min-width: 900px) { .about-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(40px, 7vw, 110px); } }
.about-text { display: grid; gap: 22px; }
.facts { display: grid; gap: 0; border-top: 1px solid var(--line); align-self: start; align-content: start; }
.fact { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.fact .k { color: var(--muted); font-size: 14px; }
.fact .v { font-weight: 500; font-size: 16px; text-align: right; }

/* ---------- Experience ---------- */
.xp { border-top: 1px solid var(--line); }
.xp-row {
  display: grid; gap: 8px;
  padding: 22px 0; border-bottom: 1px solid var(--line);
  transition: background-color .25s;
}
@media (min-width: 820px) {
  .xp-row { grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1.6fr); gap: 32px; align-items: start; }
}
.xp-row .when { color: var(--muted); font-size: 14px; padding-top: 4px; font-variant-numeric: tabular-nums; }
.xp-row .who { font-weight: 500; font-size: 17px; line-height: 1.3; letter-spacing: -0.01em; }
.xp-row .who small { display: block; font-family: var(--sans); font-size: 14px; color: var(--muted); margin-top: 4px; letter-spacing: 0; }
.xp-row .what { color: var(--ink-2); font-size: 15px; }

/* ---------- Process ---------- */
.steps { display: grid; gap: 28px; counter-reset: step; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .steps { grid-template-columns: repeat(4, 1fr); gap: 32px; } }
.step { padding-top: 22px; border-top: 1px solid var(--line-strong); display: grid; gap: 12px; }
.step .n { font-size: 12px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-weight: 500; }
.step .h4 { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.step p { color: var(--ink-2); font-size: 14.5px; }
.tools { margin-top: clamp(40px, 6vw, 64px); display: grid; gap: 18px; }
.tools .label { margin-bottom: 4px; }
.tool-row { display: flex; flex-wrap: wrap; gap: 10px; }
.tool {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--bg-elev);
  font-size: 13px; font-weight: 400;
}
.tool img { width: 16px; height: 16px; object-fit: contain; }

/* ---------- Principles ---------- */
.principles { display: grid; gap: 0; border-top: 1px solid var(--line); }
@media (min-width: 820px) { .principles { grid-template-columns: 1fr 1fr; column-gap: clamp(40px, 6vw, 80px); } }
.principle { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.principle .n { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.principle .t { font-weight: 500; font-size: 15px; letter-spacing: -0.005em; }
.principle .d { color: var(--ink-2); font-size: 14px; margin-top: 2px; }

/* ---------- Playground (bento) ---------- */
.play-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 150px;
  grid-auto-flow: dense;
}
@media (min-width: 760px) { .play-grid { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 190px; gap: 16px; } }
@media (min-width: 1000px) { .play-grid { grid-auto-rows: 230px; } }
.play {
  position: relative; display: grid; grid-template-columns: 100%; grid-template-rows: 100%;
  text-align: left; min-width: 0;
  border-radius: var(--radius-sm); overflow: hidden;
  background: var(--bg-elev); border: 1px solid var(--line);
}
.play.c2 { grid-column: span 2; }
.play.r2 { grid-row: span 2; }
.play img { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.play.top img { object-position: top; }
.play .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 40px 14px 14px;
  background: linear-gradient(to top, rgba(10,9,6,.72), rgba(10,9,6,0));
  color: #fff; display: flex; justify-content: space-between; align-items: end; gap: 10px;
}
.play .cap b { display: block; font-size: 14px; font-weight: 500; }
.play .cap span { font-size: 12px; opacity: .85; }
.play .cap svg { width: 16px; height: 16px; flex: none; opacity: .9; }

/* ---------- Contact ---------- */
.contact { text-align: left; }
.contact .display { font-size: clamp(30px, 4vw, 48px); }
.contact-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 36px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 28px; }
.email { font-weight: 500; font-size: clamp(18px, 2vw, 24px); letter-spacing: -0.01em; border-bottom: 1px solid var(--line-strong); transition: border-color .25s, color .25s; }
.email:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; }
.footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; color: var(--muted); font-size: 14px; }
.footer-in a:hover { color: var(--ink); }
.footer-links { display: flex; gap: 20px; }

/* ---------- Case study ---------- */
.cs-hero { padding-top: clamp(40px, 6vw, 80px); }
.back { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; color: var(--muted); margin-bottom: 32px; transition: color .2s; }
.back:hover { color: var(--ink); }
.cs-title { font-size: clamp(32px, 4.4vw, 54px); }
.cs-sub { margin-top: 18px; }
.cs-meta {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 28px;
  margin-top: clamp(32px, 5vw, 56px); padding-top: 26px; border-top: 1px solid var(--line);
}
@media (min-width: 720px) { .cs-meta { grid-template-columns: repeat(4, 1fr); } }
.cs-meta .k { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.cs-meta .v { font-size: 15px; margin: 0; }
.cs-hero-media {
  margin-top: clamp(36px, 6vw, 72px);
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-elev); box-shadow: var(--shadow);
  aspect-ratio: 16 / 11;
}
.cs-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.cs-hero-media.contain img { object-fit: contain; padding: clamp(24px, 6%, 72px); }
.cs-hero-media .cover { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(160deg, var(--cover-a, #e9e2d3), var(--cover-b, #d7ccb8)); }
.cs-hero-media .cover span { font-family: var(--serif); font-weight: 500; font-size: clamp(40px, 6vw, 72px); color: rgba(23,22,15,.75); letter-spacing: -0.02em; }

.cs-section { display: grid; gap: 24px; padding: clamp(40px, 6vw, 80px) 0; border-top: 1px solid var(--line); }
@media (min-width: 900px) { .cs-section { grid-template-columns: 280px minmax(0, 1fr); gap: 48px; } }
.cs-section .side { position: sticky; top: 96px; align-self: start; display: grid; gap: 10px; }
.cs-section .side .h3 { font-size: clamp(20px, 2vw, 24px); }
.cs-section .main { display: grid; gap: 22px; }
.cs-section .main > p { color: var(--ink-2); font-size: 16px; max-width: 66ch; text-wrap: pretty; }
.bullets { display: grid; gap: 12px; }
.bullets li { position: relative; padding-left: 26px; color: var(--ink-2); max-width: 66ch; }
.bullets li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.bullets li b { color: var(--ink); font-weight: 500; }
.features { display: grid; gap: 16px; }
@media (min-width: 720px) { .features { grid-template-columns: 1fr 1fr; } }
.feature { padding: 22px; border-radius: var(--radius-sm); background: var(--bg-elev); border: 1px solid var(--line); display: grid; gap: 8px; }
.feature .h4 { font-size: 15px; }
.feature p { color: var(--ink-2); font-size: 14px; }
.results { display: grid; gap: 14px; }
@media (min-width: 720px) { .results { grid-template-columns: 1fr 1fr; } }
.result { padding: 20px 22px; border-radius: var(--radius-sm); background: var(--bg-elev); border: 1px solid var(--line); display: grid; gap: 6px; }
.result b { font-size: 16px; letter-spacing: -0.01em; font-weight: 500; }
.result span { color: var(--ink-2); font-size: 14px; }
.gallery { display: grid; gap: 16px; margin-top: 8px; }
@media (min-width: 720px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
.gallery figure { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--bg-elev); }
.gallery img { width: 100%; height: auto; }
.gallery.phones { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .gallery.phones { grid-template-columns: repeat(4, 1fr); } }
.cs-next { border-top: 1px solid var(--line); padding: clamp(40px, 6vw, 80px) 0; display: grid; gap: 14px; }
.cs-next .label { margin-bottom: 2px; }
.cs-next a.h2 { transition: color .25s; display: inline-flex; align-items: center; gap: 16px; }
.cs-next a.h2:hover { color: var(--accent); }
.cs-next a.h2 svg { width: .8em; height: .8em; }
.note { padding: 16px 18px; border-radius: var(--radius-sm); border: 1px dashed var(--line-strong); color: var(--muted); font-size: 14px; }

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; background: rgba(10, 9, 6, .88); padding: 24px; }
.lb.open { display: grid; }
.lb img { max-width: min(1200px, 100%); max-height: 86vh; width: auto; height: auto; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.lb-close, .lb-prev, .lb-next {
  position: absolute; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  transition: background-color .2s;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.22); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.7); font-size: 13px; letter-spacing: .08em; }
.lb[data-single="true"] .lb-prev, .lb[data-single="true"] .lb-next, .lb[data-single="true"] .lb-count { display: none; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.no-js .reveal { opacity: 1; transform: none; }
