/* ------------------------------------------------------------------
   Shared styles for bprasanna.dev — one file, both pages.
   ------------------------------------------------------------------ */

:root {
  color-scheme: light dark;

  --bg:        light-dark(#fbfbfa, #0e0f11);
  --surface:   light-dark(#ffffff, #16181c);
  --surface-2: light-dark(#f4f3f1, #1d2025);
  --border:    light-dark(#e5e2dd, #262a30);
  --border-2:  light-dark(#d3cfc8, #363b43);
  --text:      light-dark(#15171b, #e9ebee);
  --muted:     light-dark(#5c626b, #9aa2ad);
  --accent:    light-dark(#5b3fd6, #ab9bff);
  --accent-bg: light-dark(#f0edff, #221d3d);
  --shadow:    light-dark(rgb(0 0 0 / 0.28), rgb(0 0 0 / 0.7));

  --radius: 14px;
  --measure: 40rem;
  --ease: cubic-bezier(.2, .7, .3, 1);

  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Manual override. Flipping color-scheme is enough — every light-dark()
   token above re-resolves against it. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-block-start: 2rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(1rem, 0.94rem + 0.3vw, 1.125rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-synthesis-weight: none;
}

.page {
  max-width: 46rem;
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 5vw, 2.5rem);
  padding-block: clamp(1.25rem, 4vw, 2rem) 3rem;
  padding-bottom: max(3rem, env(safe-area-inset-bottom));
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- top bar: back link + theme toggle ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-block-end: clamp(1.25rem, 5vw, 2.5rem);
}

.topbar:not(:has(.back)) { justify-content: flex-end; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-block-size: 2.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;

  & svg { inline-size: 1em; block-size: 1em; }
  &:hover { color: var(--text); }
}

.theme-toggle {
  display: grid;
  place-items: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease),
              color 0.18s var(--ease);

  & svg { inline-size: 1.15rem; block-size: 1.15rem; }

  &:hover {
    border-color: var(--border-2);
    background: var(--surface-2);
    color: var(--text);
  }
}

/* Show the icon for the theme the button switches TO.
   data-resolved is set by site.js and reflects the theme actually in use,
   whether it came from the system or from an explicit choice. */
.theme-toggle .icon-sun { display: none; }
:root[data-resolved="dark"] .theme-toggle {
  .icon-sun  { display: block; }
  .icon-moon { display: none; }
}

/* ---------- headers ---------- */

.intro {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 3vw, 1.25rem);
  margin-block-end: 1.25rem;
}

.monogram {
  flex: none;
  display: grid;
  place-items: center;
  inline-size: clamp(3rem, 12vw, 3.75rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--border-2);
  font-size: clamp(1.1rem, 4vw, 1.35rem);
  font-weight: 650;
  letter-spacing: 0.02em;
  user-select: none;
}

h1 {
  margin: 0;
  font-size: clamp(1.75rem, 1.35rem + 2vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-wrap: balance;
}

.role, .lede {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.lede {
  font-size: 1rem;
  max-inline-size: var(--measure);
  text-wrap: pretty;
}

.bio {
  margin: 0 0 1.75rem;
  max-inline-size: var(--measure);
  color: var(--muted);
  text-wrap: pretty;
}

/* small uppercase section label */
.eyebrow {
  margin: 0 0 1.1rem;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

h2 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem);
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.25;
  text-wrap: balance;
}

h3 {
  margin: 0 0 0.35rem;
  font-size: 1.08rem;
  font-weight: 620;
  letter-spacing: -0.012em;
  line-height: 1.3;
}

section { margin-block-start: clamp(2.5rem, 8vw, 3.5rem); }

/* ---------- pill links (contact row, store row) ---------- */

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact { margin-block-end: clamp(2.5rem, 8vw, 3.5rem); }

.pills a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-block-size: 2.75rem;
  padding-inline: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease),
              transform 0.18s var(--ease);

  & svg { inline-size: 1.05em; block-size: 1.05em; flex: none; }

  &:hover {
    border-color: var(--border-2);
    background: var(--surface-2);
    transform: translateY(-1px);
  }
}

/* ---------- cards ---------- */

.cards {
  display: grid;
  gap: 0.9rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.card {
  position: relative;
  padding: clamp(1.1rem, 4vw, 1.4rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease),
              transform 0.2s var(--ease);
}

.card:is(:has(a:hover), :has(a:focus-visible)) {
  border-color: var(--border-2);
  box-shadow: 0 6px 24px -12px var(--shadow);
  transform: translateY(-2px);
}

/* the title link covers the whole card, so the card is tappable */
.card :is(h3, .card-title) a {
  color: inherit;
  text-decoration: none;

  &::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
  }

  &:hover { color: var(--accent); }
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  text-wrap: pretty;
}

.card p + p { margin-block-start: 0.5rem; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* links that must sit above the card-wide overlay */
.more {
  position: relative;
  z-index: 1;
  margin-top: 0.7rem;
  font-size: 0.88rem;
}

/* two-up card grid where there's room */
.cards.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

/* ---------- prose ---------- */

.prose {
  max-inline-size: var(--measure);
  color: var(--muted);
  text-wrap: pretty;
}

.prose p { margin: 0 0 1rem; }
.prose :is(ol, ul) { margin: 0 0 1rem; padding-inline-start: 1.35rem; }
.prose li { margin-block-end: 0.5rem; }
.prose strong { color: var(--text); font-weight: 600; }

/* ---------- steps ---------- */

.steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
}

.steps li:not(:last-child)::after {
  content: "→";
  margin-inline-start: 0.15rem;
  color: var(--muted);
}

/* ---------- media ---------- */

.videos {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

figure { margin: 0; }

figcaption {
  margin-block-start: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.frame {
  aspect-ratio: 16 / 9;
  inline-size: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}

.frame iframe { inline-size: 100%; block-size: 100%; border: 0; display: block; }

.shots {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.shots img {
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 8 / 5;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.form-embed {
  inline-size: 100%;
  block-size: min(80svh, 1039px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

/* ---------- footer ---------- */

footer {
  margin-block-start: clamp(3rem, 10vw, 4.5rem);
  padding-block-start: 1.5rem;
  border-block-start: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

footer p { margin: 0 0 0.75rem; }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .card:has(a:hover), .pills a:hover { transform: none; }
}
