/* ==========================================================================
   Surya Garigipati Photography & Films
   base.css — design tokens, reset, typography, buttons, utilities, animation
   ========================================================================== */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Jost:wght@200;300;400;500&display=swap');

/* ---------- Design tokens : LIGHT (default) ---------- */
:root {
  /* brand */
  --champagne:      #B3A692;
  --champagne-deep: #9A8C74;
  --champagne-soft: #D8CEBD;
  --ivory:          #F5F2EC;
  --emerald:        #3F5546;

  /* surfaces */
  --bg:             #FAF8F4;
  --bg-alt:         #F1EDE5;
  --bg-deep:        #E8E2D6;
  --surface:        #FFFFFF;
  --overlay:        rgba(20, 18, 15, .42);

  /* ink */
  --ink:            #2A2621;
  --ink-soft:       #5C5449;
  --ink-mute:       #8A8073;
  --line:           rgba(42, 38, 33, .13);
  --line-soft:      rgba(42, 38, 33, .07);

  --accent:         var(--champagne-deep);
  --on-accent:      #FFFFFF;
  --logo-filter:    none;

  --shadow-sm:  0 2px 10px rgba(42, 38, 33, .05);
  --shadow-md:  0 14px 40px -12px rgba(42, 38, 33, .16);
  --shadow-lg:  0 40px 90px -30px rgba(42, 38, 33, .30);

  /* type */
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans:  'Jost', 'Helvetica Neue', Arial, sans-serif;

  /* metrics */
  --nav-h:      88px;
  --nav-h-sm:   68px;
  --gutter:     clamp(1.25rem, 5vw, 5.5rem);
  --maxw:       1400px;
  --maxw-text:  62ch;
  --radius:     2px;

  --ease:      cubic-bezier(.22, 1, .36, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  --dur:       .6s;
}

/* ---------- Design tokens : DARK ---------- */
:root[data-theme="dark"] {
  --champagne:      #C9BCA5;
  --champagne-deep: #D9CDB6;
  --champagne-soft: #6E6352;
  --ivory:          #F5F2EC;
  --emerald:        #7E9986;

  --bg:             #131110;
  --bg-alt:         #1B1917;
  --bg-deep:        #232019;
  --surface:        #1E1B19;
  --overlay:        rgba(8, 7, 6, .55);

  --ink:            #EFEAE1;
  --ink-soft:       #B9B1A4;
  --ink-mute:       #8C8477;
  --line:           rgba(239, 234, 225, .14);
  --line-soft:      rgba(239, 234, 225, .07);

  --accent:         var(--champagne-deep);
  --on-accent:      #17140F;
  --logo-filter:    brightness(0) saturate(100%) invert(92%) sepia(9%) saturate(220%) hue-rotate(2deg) brightness(102%);

  --shadow-sm:  0 2px 10px rgba(0, 0, 0, .35);
  --shadow-md:  0 14px 40px -12px rgba(0, 0, 0, .55);
  --shadow-lg:  0 40px 90px -30px rgba(0, 0, 0, .75);
}

/* Follow the OS until the visitor picks a side */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --champagne: #C9BCA5;  --champagne-deep: #D9CDB6;  --champagne-soft: #6E6352;
    --emerald: #7E9986;
    --bg: #131110;  --bg-alt: #1B1917;  --bg-deep: #232019;
    --surface: #1E1B19;  --overlay: rgba(8, 7, 6, .55);
    --ink: #EFEAE1;  --ink-soft: #B9B1A4;  --ink-mute: #8C8477;
    --line: rgba(239, 234, 225, .14);  --line-soft: rgba(239, 234, 225, .07);
    --accent: #D9CDB6;  --on-accent: #17140F;
    --logo-filter: brightness(0) saturate(100%) invert(92%) sepia(9%) saturate(220%) hue-rotate(2deg) brightness(102%);
    --shadow-sm: 0 2px 10px rgba(0,0,0,.35);
    --shadow-md: 0 14px 40px -12px rgba(0,0,0,.55);
    --shadow-lg: 0 40px 90px -30px rgba(0,0,0,.75);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(.95rem, .35vw + .86rem, 1.0625rem);
  line-height: 1.75;
  letter-spacing: .012em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
  overflow-x: hidden;
  transition: background-color .45s var(--ease-soft), color .45s var(--ease-soft);
}

img, picture, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; background: none; border: none; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }

::selection { background: var(--champagne); color: var(--on-accent); }

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

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--champagne-soft); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--champagne); }

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5 {
  font-family: var(--serif);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -.005em;
  color: var(--ink);
}

.display {
  font-family: var(--serif);
  font-size: clamp(3rem, 8.5vw, 8rem);
  font-weight: 300;
  line-height: .95;
  letter-spacing: -.02em;
}

.h1 { font-size: clamp(2.5rem, 5.6vw, 5rem); }
.h2 { font-size: clamp(2rem, 4.2vw, 3.75rem); }
.h3 { font-size: clamp(1.5rem, 2.6vw, 2.25rem); }
.h4 { font-size: clamp(1.25rem, 1.8vw, 1.5rem); }

.serif  { font-family: var(--serif); }
.italic { font-style: italic; }

/* small-caps eyebrow — the connective tissue of the whole site */
.eyebrow {
  font-family: var(--sans);
  font-size: .6875rem;
  font-weight: 400;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: inline-flex;
  align-items: center;
  gap: .9em;
}
.eyebrow::before {
  content: '';
  width: 2.25rem;
  height: 1px;
  background: var(--champagne);
  flex: none;
}
.eyebrow.is-centered { justify-content: center; }
.eyebrow.is-centered::after {
  content: '';
  width: 2.25rem;
  height: 1px;
  background: var(--champagne);
  flex: none;
}
.eyebrow.no-rule::before, .eyebrow.no-rule::after { display: none; }

.lede {
  font-size: clamp(1.0625rem, .6vw + .93rem, 1.3125rem);
  line-height: 1.72;
  color: var(--ink-soft);
  font-weight: 300;
}

.muted { color: var(--ink-soft); }
.mute  { color: var(--ink-mute); }

p + p { margin-top: 1.15em; }

.script-accent {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  color: var(--champagne-deep);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap-narrow { max-width: 940px; }
.wrap-wide   { max-width: 1680px; }

.section { padding-block: clamp(4.5rem, 9vw, 9.5rem); }
.section-sm { padding-block: clamp(3rem, 6vw, 6rem); }
.section-alt  { background: var(--bg-alt); }
.section-deep { background: var(--bg-deep); }

.stack   > * + * { margin-top: var(--gap, 1.5rem); }
.center  { text-align: center; }
.measure { max-width: var(--maxw-text); }
.measure-center { max-width: var(--maxw-text); margin-inline: auto; }

.grid { display: grid; gap: var(--gap, 2rem); }
.flex { display: flex; gap: var(--gap, 1rem); }

/* Flex and grid children default to min-width:auto, so a long unbreakable run
   of text sets a min-content floor that the track cannot shrink below — which
   pushed the whole page ~16px wider than the viewport on small screens.
   Letting these items shrink is what keeps narrow layouts from overflowing. */
.flex > *,
.grid > *,
.split > *,
.form-grid > *,
.card-grid > *,
.contact-layout > *,
.booking-layout > *,
.summary-row > *,
.addon > * { min-width: 0; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.wrap-flex { flex-wrap: wrap; }

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
}

/* decorative diamond divider */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--champagne);
}
.divider::before, .divider::after {
  content: '';
  height: 1px;
  width: min(6rem, 18vw);
  background: currentColor;
  opacity: .55;
}
.divider span { font-size: .5rem; transform: rotate(45deg); display: inline-block; }
.divider span::before { content: '◆'; }

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

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bd: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .7em;
  padding: 1.05em 2.5em;
  font-family: var(--sans);
  font-size: .70rem;
  font-weight: 400;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  white-space: nowrap;
  transition: color .5s var(--ease), border-color .5s var(--ease), transform .5s var(--ease);
}
/* wipe-fill on hover */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--btn-fg);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .5s var(--ease);
}
.btn:hover::after, .btn:focus-visible::after { transform: scaleY(1); }
.btn:hover, .btn:focus-visible { color: var(--bg); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  --btn-bg: var(--ink);
  --btn-fg: var(--bg);
  --btn-bd: var(--ink);
}
.btn-primary::after { background: var(--champagne-deep); }
.btn-primary:hover, .btn-primary:focus-visible { color: var(--on-accent); border-color: var(--champagne-deep); }

.btn-gold {
  --btn-bg: var(--champagne-deep);
  --btn-fg: var(--on-accent);
  --btn-bd: var(--champagne-deep);
}
.btn-gold::after { background: var(--ink); }
.btn-gold:hover, .btn-gold:focus-visible { color: var(--bg); border-color: var(--ink); }

.btn-ghost { --btn-bd: var(--line); --btn-fg: var(--ink); }
.btn-ghost::after { background: var(--ink); }

.btn-light { --btn-fg: #fff; --btn-bd: rgba(255,255,255,.6); }
.btn-light::after { background: #fff; }
.btn-light:hover, .btn-light:focus-visible { color: #171410; border-color: #fff; }

.btn-sm { padding: .8em 1.75em; font-size: .625rem; letter-spacing: .22em; }
.btn-block { width: 100%; }

/* underline text link with animated rule */
.link-under {
  position: relative;
  display: inline-block;
  font-size: .70rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  padding-bottom: .45em;
  color: var(--ink);
}
.link-under::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform-origin: right;
  transform: scaleX(1);
  transition: transform .55s var(--ease);
}
.link-under:hover::after { transform-origin: left; animation: link-sweep .6s var(--ease); }
@keyframes link-sweep {
  0%   { transform: scaleX(1); transform-origin: right; }
  49%  { transform: scaleX(0); transform-origin: right; }
  50%  { transform: scaleX(0); transform-origin: left; }
  100% { transform: scaleX(1); transform-origin: left; }
}

/* ==========================================================================
   Images & media primitives
   ========================================================================== */

.media {
  /* Must be block: several .media frames are <span> or <a> elements, which are
     inline by default — and inline boxes ignore height, aspect-ratio and
     overflow, so the image escaped its frame and painted over the text below. */
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--bg-deep);
  border-radius: var(--radius);
}
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.4s var(--ease), filter 1.4s var(--ease);
}
.media-zoom:hover img { transform: scale(1.06); }

.ratio-portrait  { aspect-ratio: 2 / 3; }
.ratio-tall      { aspect-ratio: 3 / 5; }
.ratio-square    { aspect-ratio: 1 / 1; }
.ratio-landscape { aspect-ratio: 3 / 2; }
.ratio-wide      { aspect-ratio: 16 / 9; }
.ratio-cinema    { aspect-ratio: 21 / 9; }

/* warm film-grade wash that keeps the gallery feeling like one body of work */
.tint::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, var(--overlay) 100%);
  pointer-events: none;
}

/* ==========================================================================
   Scroll-reveal animation
   ========================================================================== */

/* All initial hidden states are scoped to .js (set by theme.js in <head>).
   Without scripting the content renders normally instead of staying at
   opacity:0 — where it would also be unclickable, since clip-path clips
   hit-testing as well as painting. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity  1s var(--ease) var(--reveal-delay, 0ms),
    transform 1s var(--ease) var(--reveal-delay, 0ms),
    clip-path 1.2s var(--ease) var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

.js [data-reveal="fade"]  { transform: none; }
.js [data-reveal="left"]  { transform: translateX(-36px); }
.js [data-reveal="right"] { transform: translateX(36px); }
.js [data-reveal="scale"] { transform: scale(.94); }

/* On narrow screens the side-entry offset widens the page (a transform still
   counts toward scroll width) and reads oddly in a single column — so those
   elements rise instead of sliding. */
@media (max-width: 900px) {
  .js [data-reveal="left"],
  .js [data-reveal="right"] { transform: translateY(28px); }
}

/* Image curtain-reveal.
   The clip lives on the child image, never on the observed element itself:
   IntersectionObserver measures the *clipped* area, so clipping the observed
   node to zero height means it can never register as intersecting — it would
   stay hidden forever, waiting for an event that cannot fire. */
.js [data-reveal="curtain"] {
  opacity: 1;
  transform: none;
}
.js [data-reveal="curtain"] > img,
.js [data-reveal="curtain"] > picture {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.2s var(--ease) var(--reveal-delay, 0ms);
}
.js [data-reveal="curtain"].is-in > img,
.js [data-reveal="curtain"].is-in > picture { clip-path: inset(0 0 0 0); }

/* per-word headline reveal */
.split-line { display: block; overflow: hidden; }
.js .split-word {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 1.1s var(--ease) var(--word-delay, 0ms);
}
.js .is-in .split-word,
.js .split-ready.is-in .split-word { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .js [data-reveal="curtain"] > img,
  .js [data-reveal="curtain"] > picture { clip-path: none !important; }
  .js .split-word { transform: none !important; }
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.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;
}

.skip-link {
  position: absolute;
  top: -100px; left: 1rem;
  z-index: 999;
  padding: .85rem 1.4rem;
  background: var(--ink);
  color: var(--bg);
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  transition: top .3s var(--ease);
}
.skip-link:focus { top: 1rem; }

.no-scroll { overflow: hidden; }

.text-gold { color: var(--champagne-deep); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.75rem; }
.mt-4 { margin-top: 2.5rem; }
.mt-5 { margin-top: 4rem; }
.mb-3 { margin-bottom: 1.75rem; }
.mb-4 { margin-bottom: 2.5rem; }
.mb-5 { margin-bottom: 4rem; }
