/* ============================================================
   divyadeepsawhney.com — design system per _ai/design-system.md
   Aesthetic: "engineered document" — paper + ink, one operational
   accent, hairline rules, monospace annotation layer.
   ============================================================ */

/* ── Fonts (self-hosted variable, latin subset) ── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin-var.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin-var.woff2') format('woff2');
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Tokens ── */
:root {
  /* color */
  --paper: #FAF9F6;
  --surface: #FFFFFF;
  --ink: #16181D;
  --ink-muted: #5C6168;
  --rule: #E4E2DC;
  --code-bg: #111417;

  /* accent theme: amber (default — no data-theme attribute needed).
     Switch by setting data-theme="green|terracotta|moss|indigo" on <html>. */
  --accent: #8A5A0A;
  --accent-hover: #6E4808;
  --accent-tint: #F7EEDD;
  --accent-bright: #F0B94D;
  --accent-overlay: rgba(138, 90, 10, 0.55);

  /* type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --fs-display: clamp(2.5rem, 7vw, 4.25rem);
  --fs-h2: clamp(1.6rem, 3.5vw, 2.25rem);
  --fs-h3: 1.2rem;
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-label: 0.75rem;

  /* spacing (4px base) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  /* misc */
  --radius-card: 8px;
  --radius-btn: 6px;
  --radius-tag: 4px;
  --nav-h: 64px;
  --transition: 0.2s ease;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ── Alternate accent themes ──
   All five were shortlisted together; amber is live by default (see :root above).
   Switch the whole site by changing one attribute: <html data-theme="green">. */
:root[data-theme="green"] {
  --accent: #0E7C5B;
  --accent-hover: #0A5F46;
  --accent-tint: #E9F4EF;
  --accent-bright: #8FE3C4;
  --accent-overlay: rgba(14, 124, 91, 0.55);
}
:root[data-theme="terracotta"] {
  --accent: #A84B27;
  --accent-hover: #863C1F;
  --accent-tint: #F5E6DF;
  --accent-bright: #F0A57C;
  --accent-overlay: rgba(168, 75, 39, 0.55);
}
:root[data-theme="moss"] {
  --accent: #4C6644;
  --accent-hover: #3B5035;
  --accent-tint: #E8EEE4;
  --accent-bright: #A8C89C;
  --accent-overlay: rgba(76, 102, 68, 0.55);
}
:root[data-theme="indigo"] {
  --accent: #38468A;
  --accent-hover: #2C3870;
  --accent-tint: #E7EAF6;
  --accent-bright: #9FB0E8;
  --accent-overlay: rgba(56, 70, 138, 0.55);
}

/* breakpoints (reference — used literally in @media below and in Phase 3):
   --bp-sm: 640px · --bp-md: 900px · --bp-lg: 1200px */

/* ── Base elements ── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: var(--fs-display); font-weight: 700; }
h2 { font-size: var(--fs-h2); font-weight: 700; }
h3 { font-size: var(--fs-h3); font-weight: 500; }

p { max-width: 65ch; }

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding-inline: var(--s-5);
}

section { padding-block: var(--s-8); }
@media (min-width: 900px) {
  section { padding-block: var(--s-9); }
}

/* ── Accessibility ── */
.skip-link {
  position: absolute;
  top: -48px;
  left: var(--s-2);
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius-btn);
  font-size: var(--fs-small);
  font-weight: 500;
  transition: top var(--transition);
}
.skip-link:focus { top: var(--s-2); }

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

/* ── Section label (numbered SOP motif) ── */
.section-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--s-3);
}
.label-num { color: var(--accent); }

.section-title { margin-bottom: var(--s-4); }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: var(--s-3) var(--s-6);
  border-radius: var(--radius-btn);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  padding: calc(var(--s-3) - 1.5px) calc(var(--s-6) - 1.5px);
}
.btn-outline:hover { background: var(--accent); color: #fff; }

/* ── Hairline rule ── */
.rule { border: 0; border-top: 1px solid var(--rule); }

/* ── Nav ── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  background: transparent;
  transition: background var(--transition), border-color var(--transition);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: var(--paper);
  border-bottom-color: var(--rule);
}

/* White nav over the dark hero photo, before the page scrolls */
.nav:not(.scrolled) .nav-logo,
.nav:not(.scrolled) .nav-links a:not(.nav-cta) { color: rgba(255, 255, 255, 0.92); }
.nav:not(.scrolled) .nav-toggle span { background: #fff; }
.nav:not(.scrolled) .nav-cta { border-color: rgba(255, 255, 255, 0.6); color: #fff; }
.nav:not(.scrolled) .nav-cta:hover { background: #fff; color: var(--ink); }

.nav-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding-inline: var(--s-5);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  font-size: var(--fs-small);
  font-weight: 500;
}
.nav-links a:not(.nav-cta):hover { color: var(--accent); }
.nav-cta { padding: var(--s-2) var(--s-4); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin-inline: auto;
  background: var(--ink);
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 899px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: var(--s-3) var(--s-5) var(--s-5);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a:not(.nav-cta) { display: block; padding: var(--s-3) 0; }
  .nav-links .nav-cta { display: inline-block; margin-top: var(--s-3); }
  /* solid nav whenever the menu is open, regardless of scroll position */
  .nav:has(.nav-links.open) { background: var(--paper); border-bottom-color: var(--rule); }
  .nav:has(.nav-links.open) .nav-logo,
  .nav:has(.nav-links.open) .nav-links a:not(.nav-cta) { color: var(--ink); }
  .nav:has(.nav-links.open) .nav-toggle span { background: var(--ink); }
  .nav:has(.nav-links.open) .nav-cta { border-color: var(--accent); color: var(--accent); }
  .nav:has(.nav-links.open) .nav-cta:hover { background: var(--accent); color: #fff; }
}

/* ── Hero ── */
/* Full-bleed photo with a fixed-attachment parallax (the effect from the
   original site) behind a duotone ink/accent overlay for text legibility. */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-block: var(--nav-h) var(--s-8);
  background-image: url('images/IMG_1310-1-jpg-e1669511250699.webp');
  background-size: cover;
  background-position: top center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(17, 20, 23, 0.88) 15%, var(--accent-overlay) 130%);
}

/* Fixed-attachment parallax is desktop-only: iOS Safari doesn't support it on
   body-level scroll, and it's a needless paint/compositing cost on mobile CPUs */
@media (hover: none), (max-width: 899px) {
  .hero { background-attachment: scroll; }
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: var(--s-4);
}

.hero-heading { color: #fff; }

.hero-sub {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 34em;
  margin-block: var(--s-5) var(--s-4);
}

.hero-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: var(--s-6);
}

/* ── About ── */
.about-inner {
  display: grid;
  gap: var(--s-7);
  align-items: center;
}
@media (min-width: 900px) {
  .about-inner { grid-template-columns: 2fr 3fr; }
}

.about-image img {
  border-radius: var(--radius-card);
  border: 1px solid var(--rule);
}

.about-text p { margin-bottom: var(--s-4); }
.about-text .btn { margin-top: var(--s-2); }

/* ── Current Work ── */
.work-role {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: var(--s-3);
}

/* ── Brands & Testimonials ── */
.brands-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-6) var(--s-7);
  margin-block: var(--s-6) var(--s-8);
}

.brand-item img {
  filter: grayscale(1);
  opacity: 0.6;
  transition: filter var(--transition), opacity var(--transition);
}
.brand-item img:hover { filter: none; opacity: 1; }

.testimonials-heading {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--s-5);
}

.testimonials-grid {
  display: grid;
  gap: var(--s-5);
}
@media (min-width: 900px) {
  .testimonials-grid { grid-template-columns: repeat(3, 1fr); align-items: start; }
}

.testimonial-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-card);
  padding: var(--s-6);
  box-shadow: var(--shadow-card);
}

.testimonial-quote {
  font-size: var(--fs-small);
  color: var(--ink);
  margin-bottom: var(--s-5);
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.testimonial-author img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.author-name { font-weight: 600; font-size: var(--fs-small); }
.author-role { font-size: var(--fs-label); color: var(--ink-muted); }

/* ── Contact ── */
.contact {
  background: var(--surface);
  border-top: 1px solid var(--rule);
  text-align: center;
}
.contact .section-label { text-align: center; }
.contact-text { margin: 0 auto var(--s-6); }

.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--s-4);
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  border: 1px solid var(--rule);
  border-radius: var(--radius-btn);
  background: var(--paper);
  font-size: var(--fs-small);
  font-weight: 500;
  transition: border-color var(--transition), color var(--transition);
}
.contact-link:hover { border-color: var(--accent); color: var(--accent); }

/* ── Footer ── */
.footer {
  background: var(--code-bg);
  color: #fff;
  padding-block: var(--s-7);
  text-align: center;
}
.footer p { margin-inline: auto; }
.footer-name { font-weight: 600; }
.footer-role {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9BA1A8;
  margin-block: var(--s-2) var(--s-4);
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-bright);
  margin-right: var(--s-2);
  vertical-align: middle;
}
.footer-copy { font-size: var(--fs-label); color: #9BA1A8; }

/* ── Global accent touches ── */
::selection { background: var(--accent-tint); color: var(--ink); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 6px;
  border: 2px solid var(--paper);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-hover); }

/* ── Motion safety ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
