/* Keerthi Kankipati - gallery site custom styles.
   Tailwind (CDN) handles layout utilities; this file owns the design tokens,
   masonry gallery, lightbox tuning and the quiet motion. */

:root {
  --bg: #f7f4ee;
  --bg-soft: #efeae0;
  --card: #fffdf9;
  --ink: #211d18;
  --muted: #6f675c;
  --line: #e4ddcf;
  --accent: #9e4a33;
  --accent-soft: #b96b52;
  --shadow: 0 1px 2px rgba(33, 29, 24, .04), 0 12px 30px -12px rgba(33, 29, 24, .18);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  --bg: #161310;
  --bg-soft: #1d1915;
  --card: #201b16;
  --ink: #ece6da;
  --muted: #a79d8c;
  --line: #332c23;
  --accent: #dc8b6f;
  --accent-soft: #e6a488;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 34px -14px rgba(0, 0, 0, .6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161310;
    --bg-soft: #1d1915;
    --card: #201b16;
    --ink: #ece6da;
    --muted: #a79d8c;
    --line: #332c23;
    --accent: #dc8b6f;
    --accent-soft: #e6a488;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 34px -14px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.font-serif, h1, h2, h3, .display { font-family: var(--serif); }

/* Fluid display type */
.display-xl { font-size: clamp(2.6rem, 7vw, 5.4rem); font-weight: 600; line-height: 1.02; letter-spacing: -.01em; }
.display-lg { font-size: clamp(2rem, 4.5vw, 3.3rem); font-weight: 600; line-height: 1.08; }
.display-md { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 600; line-height: 1.15; }

.eyebrow {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
}

a { color: inherit; text-decoration: none; }

/* Visible keyboard focus (accessibility) */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
:focus:not(:focus-visible) { outline: none; }

/* Skip to content */
.skip-link {
  position: fixed; top: .6rem; left: .6rem; z-index: 100;
  background: var(--accent); color: #fff; padding: .6rem 1rem; border-radius: 6px;
  font-size: .85rem; font-weight: 600;
  transform: translateY(-160%); transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

/* Theme toggle icon reflects current theme (moon in light, sun in dark) */
.js-theme-toggle .icon-sun { display: none; }
.js-theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .js-theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .js-theme-toggle .icon-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .js-theme-toggle .icon-moon { display: none; }
  :root:not([data-theme="light"]) .js-theme-toggle .icon-sun { display: block; }
}

.link-underline {
  position: relative;
  color: var(--accent);
  font-weight: 500;
}
.link-underline::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .35s ease;
}
.link-underline:hover::after { transform: scaleX(1); }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.site-header.scrolled { border-color: var(--line); }
.nav-link {
  font-size: .82rem; font-weight: 500; letter-spacing: .04em;
  color: var(--muted); padding: .4rem .1rem; transition: color .25s ease; position: relative;
}
.nav-link:hover, .nav-link.active { color: var(--ink); }
.nav-link.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1.5px; background: var(--accent);
}

/* Dropdown */
.has-dropdown { padding-bottom: .5rem; margin-bottom: -.5rem; } /* keep hover area continuous */
.has-dropdown > .dropdown {
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: all .22s ease; pointer-events: none;
}
/* Transparent bridge across the visual gap so the pointer never leaves :hover */
.has-dropdown > .dropdown::before {
  content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px;
}
.has-dropdown:hover > .dropdown,
.has-dropdown:focus-within > .dropdown {
  opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .82rem; font-weight: 600; letter-spacing: .03em;
  padding: .78rem 1.5rem; border-radius: 999px; transition: all .28s ease; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-soft); transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Masonry gallery ---- */
.masonry { column-gap: 1.1rem; }
.masonry { columns: 1; }
@media (min-width: 640px) { .masonry { columns: 2; } }
@media (min-width: 1024px) { .masonry { columns: 3; } }
.masonry.cols-2 { columns: 1; }
@media (min-width: 700px) { .masonry.cols-2 { columns: 2; } }

.art {
  break-inside: avoid; margin-bottom: 1.1rem; display: block; position: relative;
  border-radius: 4px; overflow: hidden; background: var(--card);
  box-shadow: var(--shadow); cursor: zoom-in;
}
.art img {
  display: block; width: 100%; height: auto;
  transition: transform .9s cubic-bezier(.2,.7,.2,1), filter .5s ease;
  will-change: transform;
}
.art:hover img { transform: scale(1.045); }
.art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(20,16,12,.55));
  opacity: 0; transition: opacity .4s ease; pointer-events: none;
}
.art:hover::after { opacity: 1; }
.art .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1rem;
  color: #fff; font-size: .78rem; letter-spacing: .02em;
  transform: translateY(6px); opacity: 0; transition: all .4s ease; z-index: 2;
}
.art:hover .cap { transform: translateY(0); opacity: 1; }
.art .cap .zoom { display:inline-flex; align-items:center; gap:.35rem; font-weight:600; }

/* ---- Painting card grid (matted, uniform height, no crop) ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.6rem 1.25rem;
}
@media (min-width: 720px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 1.6rem; } }

.mat {
  position: relative;
  height: clamp(210px, 33vw, 340px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(.7rem, 2vw, 1.4rem);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .35s ease, border-color .35s ease, transform .35s ease;
}
.mat img {
  max-height: 100%; max-width: 100%; width: auto; height: auto;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(20,16,12,.14);
  transition: transform .7s cubic-bezier(.2,.7,.2,1);
}
.art-card:hover .mat { box-shadow: 0 2px 4px rgba(33,29,24,.06), 0 22px 44px -18px rgba(33,29,24,.32); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.art-card:hover .mat img { transform: scale(1.035); }
.view-cue {
  position: absolute; bottom: .6rem; right: .6rem;
  background: var(--accent); color: #fff; font-size: .68rem; font-weight: 600; letter-spacing: .04em;
  padding: .32rem .62rem; border-radius: 999px;
  display: inline-flex; align-items: center; gap: .3rem;
  opacity: 0; transform: translateY(5px); transition: opacity .3s ease, transform .3s ease;
}
.art-card:hover .view-cue { opacity: 1; transform: none; }
.mat.mat-sm { height: 104px; padding: .5rem; border-radius: 3px; }
.mat.mat-sm img { box-shadow: 0 1px 4px rgba(20,16,12,.16); }

/* ---- Painting detail image ---- */
.detail-image { position: relative; }
.detail-image .zoom-badge {
  position: absolute; bottom: 1rem; right: 1rem; z-index: 3;
  background: rgba(20,16,12,.72); color: #fff; font-size: .72rem; letter-spacing: .03em;
  padding: .36rem .72rem; border-radius: 999px;
  opacity: 0; transform: translateY(5px); transition: all .3s ease; backdrop-filter: blur(4px);
}
.detail-image:hover .zoom-badge { opacity: 1; transform: none; }

/* ---- Series / section cards ---- */
.series-card { position: relative; overflow: hidden; border-radius: 6px; box-shadow: var(--shadow); background: var(--card); }
.series-card img { transition: transform 1s cubic-bezier(.2,.7,.2,1); }
.series-card:hover img { transform: scale(1.06); }
.series-card .veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,16,12,.05) 40%, rgba(20,16,12,.78));
}

/* prose */
.prose-art { max-width: 68ch; }
.prose-art p { margin: 0 0 1.1rem; color: var(--ink); }
.prose-art h3 { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; margin: 2rem 0 .8rem; }
.prose-art ul { margin: 0 0 1.2rem; padding-left: 1.1rem; }
.prose-art li { margin-bottom: .5rem; position: relative; padding-left: .3rem; }
.prose-art li::marker { color: var(--accent); }
.lead { font-size: 1.18rem; color: var(--muted); line-height: 1.75; }

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

/* hero image frame */
.hero-frame { position: relative; overflow: hidden; border-radius: 6px; box-shadow: var(--shadow); }

/* Section fade helper (works with AOS but degrades gracefully) */
[data-aos] { will-change: opacity, transform; }

/* GLightbox tuning */
.glightbox-clean .gslide-description { background: rgba(20,16,12,.92); }
.glightbox-clean .gslide-title { font-family: var(--serif); font-size: 1.2rem; }
.gdesc-inner { padding: 18px 22px; }

/* Mobile menu */
#mobileMenu { transition: opacity .3s ease, transform .3s ease; }
#mobileMenu.hidden-menu { display: none; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .art img { transition: none; }
}
