/* ==========================================================================
   AJIT BAN — BASE
   Global element defaults, texture, skip link, container primitives.
   ========================================================================== */

html {
  background-color: var(--color-bg);
  background-image:
    radial-gradient(1100px 650px at 50% -100px, rgba(226, 195, 118, 0.10), transparent 68%),
    radial-gradient(900px 550px at 85% 15%, rgba(44, 82, 130, 0.08), transparent 62%),
    radial-gradient(100% 70% at 50% 118%, rgba(0, 0, 0, 0.65), transparent 60%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

html[data-theme="light"] {
  background-image:
    radial-gradient(1100px 650px at 50% -100px, rgba(212, 175, 55, 0.06), transparent 68%),
    radial-gradient(900px 550px at 85% 15%, rgba(40, 80, 138, 0.05), transparent 62%);
}

/* Single opaque ground on <html>; body carries only text colour so the
   grain texture and content layers compose cleanly. */
body {
  color: var(--color-text);
}

/* ---------------------------------------------------------------------
   FILM GRAIN — single tasteful texture layer, non-interactive
   --------------------------------------------------------------------- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------------
   LINKS
   --------------------------------------------------------------------- */
a:not([class]) {
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-color: var(--color-line-strong);
  text-underline-offset: 0.25em;
  transition: color var(--dur-fast) var(--ease-out),
              text-decoration-color var(--dur-fast) var(--ease-out);
}

a:not([class]):hover {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
}

/* ---------------------------------------------------------------------
   UTILITY — visually hidden, still announced by screen readers
   --------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------------
   HORIZONTAL RULE — editorial separator
   --------------------------------------------------------------------- */
hr {
  border: 0;
  border-top: var(--border);
  margin: 0;
}

/* ---------------------------------------------------------------------
   CONTAINER + SECTION PRIMITIVES
   --------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  position: relative;
  padding-block: var(--section-pad);
}

.section--tight { padding-block: calc(var(--section-pad) * 0.55); }

/* Quiet moment — compressed editorial beat */
.section--quiet { padding-block: calc(var(--section-pad) * 0.7); }

/* Statement moment — full-bleed, large type, deliberate pause */
.section--statement {
  padding-block: calc(var(--section-pad) * 1.15);
  border-block: var(--border);
  background: var(--color-surface);
}

/* ---------------------------------------------------------------------
   SKIP LINK — accessibility
   --------------------------------------------------------------------- */
.skip-link {
  position: fixed;
  top: var(--space-4);
  left: var(--space-4);
  z-index: calc(var(--z-cursor) + 1);
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem; /* 44px touch target */
  padding: var(--space-3) var(--space-5);
  background: var(--color-text);
  color: var(--color-bg);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  border-radius: var(--radius);
  transform: translateY(-200%);
  transition: transform var(--dur-fast) var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--color-bg);
}

/* ---------------------------------------------------------------------
   IMAGE FRAMES — consistent archival treatment
   --------------------------------------------------------------------- */
.media-frame {
  position: relative;
  background: var(--color-surface);
  border: var(--border);
  overflow: hidden;
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out),
              opacity var(--dur-base) var(--ease-out);
}

.media-frame:hover img {
  transform: scale(1.03);
}

.media-frame__caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-top: var(--border);
  background: var(--color-surface);
}

/* ---------------------------------------------------------------------
   BADGES
   --------------------------------------------------------------------- */
.badge-placeholder {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-accent-line);
  background: var(--color-accent-soft);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-accent);
  border-radius: var(--radius);
}

/* Content mode — set AJIT.site.contentMode in js/data/site.js.
   "development" (default) keeps placeholder badges visible for QA;
   "production" hides them once real content has shipped. */
:root[data-content-mode="production"] .badge-placeholder,
:root[data-content-mode="production"] .ph-suffix {
  display: none;
}

/* ---------------------------------------------------------------------
   IMAGE REVEAL — clip-path wrapper used across the site
   --------------------------------------------------------------------- */
.image-reveal {
  position: relative;
  overflow: hidden;
}

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

/* Pre-inview state (JS adds .is-inview) */
.image-reveal[data-image-reveal] {
  clip-path: inset(0 0 100% 0);
  transition: clip-path var(--dur-cinematic) var(--ease-out);
}

.image-reveal[data-image-reveal].is-inview {
  clip-path: inset(0 0 0% 0);
}

/* ---------------------------------------------------------------------
   EMPTY STATE — graceful "content to be provided"
   --------------------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-8) var(--container-pad);
  border: 1px dashed var(--color-line-strong);
}

.empty-state__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
}
