/* ============================================================
   Sopan Shah — personal landing page
   ============================================================ */

/* ---- Base reset (per design system) ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  hanging-punctuation: first last;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
ul[role='list'], ol[role='list'] { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; line-height: 1.15; }
p, li, figcaption { text-wrap: pretty; }

::selection {
  background: color-mix(in oklab, var(--color-primary) 30%, transparent);
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

button { cursor: pointer; background: none; border: none; }

a, button, [role='button'], input, textarea {
  transition: color var(--transition-interactive), background var(--transition-interactive),
    border-color var(--transition-interactive), box-shadow var(--transition-interactive),
    transform var(--transition-interactive);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

/* ============================================================
   Design tokens — refined executive palette (warm charcoal + brass)
   ============================================================ */
:root,
[data-theme='light'] {
  --color-bg: #f6f4ef;
  --color-surface: #ffffff;
  --color-surface-2: #fbfaf6;
  --color-border: #e2ddd2;
  --color-divider: #eae5da;

  --color-text: #1c1a16;
  --color-text-muted: #6b665b;
  --color-text-faint: #a49d8d;
  --color-text-inverse: #f6f4ef;

  --color-primary: #8a6a35;
  --color-primary-hover: #6c5228;
  --color-primary-active: #513c1d;
  --color-primary-highlight: #e7dcc4;

  --color-success: #3f6b34;
  --color-success-highlight: #dbe6d3;
  --color-error: #9a3324;
  --color-error-highlight: #f0d9d2;

  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px oklch(0.2 0.02 80 / 0.06);
  --shadow-md: 0 8px 24px oklch(0.2 0.02 80 / 0.10);
  --shadow-lg: 0 24px 56px oklch(0.2 0.02 80 / 0.16);

  --content-narrow: 620px;
  --content-default: 880px;
  --content-wide: 1120px;

  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Switzer', 'Work Sans', Helvetica, Arial, sans-serif;
}

[data-theme='dark'] {
  --color-bg: #14130f;
  --color-surface: #1a1813;
  --color-surface-2: #201e18;
  --color-border: #35322a;
  --color-divider: #26241d;

  --color-text: #efece3;
  --color-text-muted: #a49d8d;
  --color-text-faint: #6b665b;
  --color-text-inverse: #14130f;

  --color-primary: #cba15c;
  --color-primary-hover: #ddb877;
  --color-primary-active: #e8c98f;
  --color-primary-highlight: #3a3223;

  --color-success: #7ba668;
  --color-success-highlight: #263323;
  --color-error: #d17a63;
  --color-error-highlight: #3a231d;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 8px 24px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 24px 56px oklch(0 0 0 / 0.5);
}

/* ---- Fluid type scale ---- */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2.25rem, 1.4rem + 3vw, 4.25rem);

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem; --space-20: 5rem; --space-24: 6rem; --space-32: 8rem;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* ============================================================
   Layout
   ============================================================ */
.wrap {
  max-width: var(--content-default);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-divider);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text);
  text-decoration: none;
}

.brand__mark {
  width: 34px;
  height: 34px;
  color: var(--color-primary);
}

.brand__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  letter-spacing: 0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}
.theme-toggle:hover { color: var(--color-primary); border-color: var(--color-primary); }
.theme-toggle svg { width: 18px; height: 18px; }

.nav-cta {
  display: none;
}
@media (min-width: 640px) {
  .nav-cta { display: inline-flex; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--color-primary-hover); box-shadow: var(--shadow-md); transform: translateY(-1px); }

.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn--ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }

.btn--block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* ---- Hero ---- */
.hero {
  padding-block: clamp(var(--space-16), 12vw, var(--space-32)) clamp(var(--space-12), 8vw, var(--space-24));
  overflow: hidden;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: var(--space-12);
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: 1.2fr 0.8fr;
    gap: var(--space-16);
  }
}

.hero__content { min-width: 0; }

.hero__portrait {
  justify-self: center;
  width: min(320px, 72vw);
  order: -1;
}

@media (min-width: 900px) {
  .hero__portrait {
    justify-self: end;
    width: min(360px, 100%);
    order: 0;
  }
}

.hero__portrait picture {
  display: block;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
}

.hero__portrait picture::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.05);
  pointer-events: none;
}

.hero__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: var(--space-6);
}

.hero__eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--color-primary);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  letter-spacing: -0.01em;
  max-width: 16ch;
}

.hero h1 em {
  font-style: italic;
  color: var(--color-primary);
}

.hero__role {
  margin-top: var(--space-5);
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 42ch;
}

.hero__lede {
  margin-top: var(--space-6);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 60ch;
  line-height: 1.75;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-10);
}

.hero__actions svg { width: 18px; height: 18px; }

/* ---- Focus areas ---- */
.focus {
  padding-block: clamp(var(--space-10), 6vw, var(--space-20));
  border-top: 1px solid var(--color-divider);
}

.focus__grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: var(--space-10);
}

.focus__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  max-width: 20ch;
}

.focus-card {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.focus-card__num {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-primary);
  margin-bottom: var(--space-3);
  display: block;
}

.focus-card h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.focus-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ---- Contact ---- */
.contact {
  padding-block: clamp(var(--space-16), 10vw, var(--space-24));
  border-top: 1px solid var(--color-divider);
}

.contact__intro {
  max-width: 640px;
}

.contact__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
}

.contact__lede {
  margin-top: var(--space-4);
  color: var(--color-text-muted);
  line-height: 1.7;
}

.contact__grid {
  margin-top: var(--space-10);
  display: grid;
  gap: var(--space-10);
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .contact__grid { grid-template-columns: 0.85fr 1.15fr; }
}

.contact__note {
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  height: fit-content;
}

.contact__note h3 {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.contact__note ul { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-4); }

.contact__note li {
  display: flex;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  align-items: flex-start;
}

.contact__note li svg {
  width: 16px; height: 16px; margin-top: 3px; flex-shrink: 0; color: var(--color-primary);
}

/* Form */
.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.field { display: flex; flex-direction: column; gap: var(--space-2); }

.field label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  font-weight: 600;
}

.field input,
.field textarea {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-base);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-highlight);
}

.field textarea { resize: vertical; min-height: 130px; }

/* Honeypot — hidden from real visitors, catches bots */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.turnstile-holder { margin-top: var(--space-1); }

.form-status {
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  display: none;
}

.form-status.is-visible { display: block; }
.form-status.is-success { background: var(--color-success-highlight); color: var(--color-success); }
.form-status.is-error { background: var(--color-error-highlight); color: var(--color-error); }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-8);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.site-footer a { color: var(--color-text-faint); }
.site-footer a:hover { color: var(--color-primary); }
