/* ==========================================================================
   Varun Prakash Photography — stylesheet
   Design tokens live on :root (light) and are overridden per [data-theme].
   ========================================================================== */

:root {
  /* --- Color: light theme --- */
  --color-bg: #f6f4ef;
  --color-bg-rgb: 246, 244, 239;
  --color-surface: #ffffff;
  --color-text: #17161a;
  --color-text-muted: #56555c;
  --color-border: #dedad0;
  --color-accent: #c9552f;
  --color-accent-contrast: #fffaf5;
  --color-shield: 0, 0, 0;

  /* --- Type --- */
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-label: "Space Grotesk", "Archivo", sans-serif;
  --font-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-wordmark: "Playfair Display", Georgia, "Times New Roman", serif;

  /* --- Spacing (8px rhythm) --- */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4rem;
  --space-7: 6rem;
  --space-8: 8rem;

  --radius-sm: 4px;
  --radius-md: 10px;
  --container-max: 1400px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --motion-fast: 160ms;
  --motion-base: 300ms;
  --motion-slow: 500ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --color-bg: #111014;
  --color-bg-rgb: 17, 16, 20;
  --color-surface: #1a1920;
  --color-text: #f4f2ec;
  --color-text-muted: #a7a4ad;
  --color-border: #322f38;
  --color-accent: #e2733f;
  --color-accent-contrast: #1a0f08;
  --color-shield: 0, 0, 0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #111014;
    --color-bg-rgb: 17, 16, 20;
    --color-surface: #1a1920;
    --color-text: #f4f2ec;
    --color-text-muted: #a7a4ad;
    --color-border: #322f38;
    --color-accent: #e2733f;
    --color-accent-contrast: #1a0f08;
  }
}

/* ==========================================================================
   Reset
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--motion-base) var(--ease-out), color var(--motion-base) var(--ease-out);

  /* Subtle paper-grain texture: cheap, seamless, decorative only. */
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.03 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }

button, a, [tabindex] {
  cursor: pointer;
}

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

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

.skip-link {
  position: fixed;
  top: -100%;
  left: var(--space-2);
  z-index: 1000;
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-label);
  font-weight: 500;
  transition: top var(--motion-fast) var(--ease-out);
}
.skip-link:focus { top: var(--space-2); }

/* ==========================================================================
   Buttons / chips
   ========================================================================== */

.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.9em 1.7em;
  border-radius: 999px;
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: transform var(--motion-fast) var(--ease-out), background-color var(--motion-fast) var(--ease-out);
}
.button-primary {
  background: var(--color-text);
  color: var(--color-bg);
}
.button-primary:hover { transform: translateY(-2px); }
.button-primary:active { transform: translateY(0); }

/* ==========================================================================
   Header + menu toggle
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--gutter);
  pointer-events: none;
  background: rgba(var(--color-bg-rgb), 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.site-header > * { pointer-events: auto; }

.wordmark {
  display: flex;
  flex-direction: column;
  font-family: var(--font-wordmark);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: 0.015em;
  font-size: clamp(1.5rem, 4vw, 2.6rem);
}
.wordmark-line + .wordmark-line { margin-top: 0.05em; }

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

.theme-toggle,
.menu-toggle {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: rgba(var(--color-bg-rgb), 0.6);
  backdrop-filter: blur(6px);
  transition: border-color var(--motion-fast) var(--ease-out), background-color var(--motion-fast) var(--ease-out);
}
.theme-toggle:hover,
.menu-toggle:hover { border-color: var(--color-accent); }

.icon { width: 1.2rem; height: 1.2rem; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.menu-toggle-bar {
  position: relative;
  width: 1.3rem;
  height: 2px;
  background: currentColor;
  display: block;
  transition: transform var(--motion-base) var(--ease-out), opacity var(--motion-base) var(--ease-out);
}
.menu-toggle-bar + .menu-toggle-bar { margin-top: 5px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:first-child {
  transform: translateY(3.5px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

.site-nav {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: var(--space-4);
  padding: var(--gutter);
  background: var(--color-bg);
}
.site-nav[hidden] { display: none; }

.site-nav-list {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.site-nav-list a {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(2.25rem, 8vw, 5rem);
  line-height: 1.05;
  transition: color var(--motion-fast) var(--ease-out);
}
.site-nav-list a:hover { color: var(--color-accent); }

.site-nav-meta {
  font-family: var(--font-label);
  color: var(--color-text-muted);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  min-height: calc(100dvh - 2rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--gutter) var(--space-6);
  position: relative;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.hero-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-bg-scrim {
  position: absolute;
  inset: 0;
  background: rgba(var(--color-bg-rgb), 0.78);
}
/* No JS / reduced-motion: the <video> has no <source>, so only its poster
   shows — this rule is just a defensive second guard against motion. */
@media (prefers-reduced-motion: reduce) {
  .hero-bg-video { display: none; }
}

.hero-copy { position: relative; z-index: 1; max-width: 46rem; }

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(2.75rem, 9vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
}
.hero-title-line { display: block; }
.hero-title-accent {
  position: relative;
  color: var(--color-accent);
  display: inline-block;
}
.accent-mark {
  position: absolute;
  left: 0;
  bottom: -0.28em;
  width: 100%;
  height: 0.3em;
  color: var(--color-accent);
  overflow: visible;
}

.hero-lede {
  margin-top: var(--space-4);
  max-width: 34rem;
  font-size: 1.15rem;
  color: var(--color-text-muted);
}

.hero .button { margin-top: var(--space-4); }

.hero-scroll-cue {
  position: absolute;
  z-index: 1;
  bottom: var(--space-4);
  left: var(--gutter);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-label);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.hero-scroll-line {
  width: 2.5rem;
  height: 1px;
  background: var(--color-text-muted);
}

/* ==========================================================================
   Work / gallery
   ========================================================================== */

.work {
  padding: var(--space-7) var(--gutter);
  max-width: var(--container-max);
  margin-inline: auto;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.section-heading h2 {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
}
.section-heading p { color: var(--color-text-muted); max-width: 26rem; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}
.filter-chip {
  padding: 0.55em 1.2em;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  font-family: var(--font-label);
  font-size: 0.9rem;
  transition: background-color var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out), border-color var(--motion-fast) var(--ease-out);
}
.filter-chip:hover { border-color: var(--color-accent); }
.filter-chip.is-active {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}

.filter-status {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
}

.gallery-item {
  transition: opacity var(--motion-base) var(--ease-out), transform var(--motion-base) var(--ease-out);
}
.gallery-item[hidden] { display: none; }

@media (min-width: 900px) {
  .gallery-item.is-featured { grid-column: span 2; }
}

.protected-figure { height: 100%; }

.protected-image {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  aspect-ratio: var(--ar, 4 / 5);

  /* Blocks the native "save/copy image" long-press callout on iOS Safari. */
  -webkit-touch-callout: none;
}

.protected-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;

  /* Anti-theft: disable native drag ghost and selection highlight on the image itself. */
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  user-select: none;
  transition: transform var(--motion-slow) var(--ease-out);
}

.gallery-item button.protected-trigger,
.gallery-item .protected-image { cursor: zoom-in; }
.protected-image:hover img { transform: scale(1.04); }

/* Sits above the image and captures right-click / long-press / drag-start —
   there is nothing here for "Save Image As" to save. See README for what
   this can and cannot stop. */
.protection-shield {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: transparent;
  -webkit-user-select: none;
  user-select: none;
}

figcaption {
  margin-top: var(--space-1);
  font-family: var(--font-label);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ==========================================================================
   About
   ========================================================================== */

.about {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  padding: var(--space-7) var(--gutter);
  max-width: var(--container-max);
  margin-inline: auto;
}
.about-portrait .protected-image { aspect-ratio: 4 / 5; max-width: 24rem; }
.about-copy h2 {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: var(--space-3);
}
.about-copy p { max-width: 40rem; color: var(--color-text-muted); }
.about-copy p + p { margin-top: var(--space-2); }

@media (min-width: 800px) {
  .about { grid-template-columns: 22rem 1fr; align-items: start; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding: var(--space-7) var(--gutter) var(--space-5);
  max-width: var(--container-max);
  margin-inline: auto;
  border-top: 1px solid var(--color-border);
}
.footer-primary h2 {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(2rem, 6vw, 3.5rem);
  margin-bottom: var(--space-3);
  max-width: 20ch;
}
.footer-meta {
  margin-top: var(--space-5);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  align-items: center;
}
.footer-links { display: flex; gap: var(--space-3); font-family: var(--font-label); }
.footer-links a:hover { color: var(--color-accent); }
.footer-copyright { color: var(--color-text-muted); font-size: 0.85rem; }

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 9, 11, 0.92);
}

.lightbox-stage {
  position: relative;
  z-index: 1;
  width: min(92vw, 1200px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-image-wrap {
  width: 100%;
  max-height: 78vh;
  border-radius: var(--radius-md);
  background: #000;
}
.lightbox-image-wrap img { width: 100%; height: 100%; max-height: 78vh; object-fit: contain; }

.lightbox-caption {
  margin-top: var(--space-2);
  color: #f4f2ec;
  font-family: var(--font-label);
}
.lightbox-counter {
  color: rgba(244, 242, 236, 0.6);
  font-family: var(--font-label);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.lightbox-close {
  position: absolute;
  top: -3rem;
  right: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  color: #f4f2ec;
  border-radius: 50%;
  border: 1px solid rgba(244, 242, 236, 0.3);
}
.lightbox-close svg { width: 1.1rem; height: 1.1rem; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  color: #f4f2ec;
  border-radius: 50%;
  border: 1px solid rgba(244, 242, 236, 0.3);
  background: rgba(0, 0, 0, 0.3);
  transition: background-color var(--motion-fast) var(--ease-out);
}
.lightbox-nav:hover { background: rgba(0, 0, 0, 0.55); }
.lightbox-nav svg { width: 1.3rem; height: 1.3rem; }
.lightbox-prev { left: -1rem; }
.lightbox-next { right: -1rem; }

@media (max-width: 700px) {
  .lightbox-prev { left: 0.25rem; }
  .lightbox-next { right: 0.25rem; }
  .lightbox-close { top: 0.5rem; right: 0.5rem; }
}

/* ==========================================================================
   Reveal-on-scroll (progressive enhancement; JS adds .is-visible)
   ========================================================================== */

[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
  transition: opacity var(--motion-slow) var(--ease-out), transform var(--motion-slow) var(--ease-out);
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
}
