/* ————————————————————————————————————————————————
   ksun — portfolio
   Palette: off-white / near-black
   Type: Fraunces (headings) + Inter (body)
———————————————————————————————————————————————— */

:root {
  --bg: #faf8f3;
  --ink: #1a1915;
  --ink-soft: #6f6a5e;
  --accent: #1a1915; /* was muted olive; now plain ink-black sitewide */
  --media-bg: #ece8df;
  --line: rgb(26 25 21 / 0.08);       /* hairline borders */
  --line-strong: rgb(26 25 21 / 0.3); /* interactive borders */
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --pad: clamp(1.25rem, 5vw, 4rem);
}

* { box-sizing: border-box; margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  /* no rubber-band bounce — it flashes a pale gap above the dark hero */
  overscroll-behavior-y: none;
}

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

img, video { display: block; max-width: 100%; }

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

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

.eyebrow {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2.5rem;
}

/* ——— Nav ——— */

.nav {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.5rem var(--pad);
  color: var(--ink);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.nav-name { font-family: var(--serif); font-size: 1rem; }

.nav-links { display: flex; gap: 1.75rem; }

.nav a { opacity: 0.9; transition: opacity 0.2s; }
.nav a:hover { opacity: 1; }

/* ——— Hero ——— */

/* full-page hero: text row on top, staggered photo band below it */
.hero {
  min-height: 100svh;
  max-width: 78rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(2.25rem, 6vh, 4rem);
  padding: 6.5rem var(--pad) 3rem;
}

/* vertical frames edge to edge; every other one dropped for rhythm.
   2 panels on phones, 4 on tablets, all 5 from 900px up. */
.hero-media {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(0.75rem, 2vw, 1.25rem);
  align-items: start;
  width: 100%;
}

.hero-panel {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--media-bg);
}

.hero-panel:nth-child(even) { margin-top: clamp(1.75rem, 5vh, 3.25rem); }

.hero-panel:nth-child(n+3) { display: none; }

/* panel slides stack; main.js toggles .is-shown to crossfade */
.hero-panel > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.1s ease;
}

.hero-panel > img.is-shown { opacity: 1; }

.hero-text { text-align: center; }

.hero-kicker {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.75rem, 8vw, 5rem);
  line-height: 1.05;
  margin: 0.5rem 0 0;
}

/* ——— Sections ——— */

.section {
  max-width: 78rem;
  margin: 0 auto;
  padding: clamp(4.5rem, 11vw, 8rem) var(--pad) 0;
}

/* ——— Work tabs ——— */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  margin: -1rem 0 2.5rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
}

.tab {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  position: relative;
  transition: color 0.2s;
}

.tab sup { font-size: 0.625rem; color: var(--accent); }

.tab:hover { color: var(--ink); }

.tab.is-active { color: var(--ink); }

.tab.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1.0625rem;
  height: 1px;
  background: var(--ink);
}

/* ——— Work grid ——— */

.work-grid { columns: 2; column-gap: 1rem; }

.piece {
  break-inside: avoid;
  margin-bottom: 1rem;
}

/* featured gigs: uniform cards instead of masonry */
.work-grid--gigs {
  columns: unset;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.work-grid--gigs .piece { margin-bottom: 0; }

.piece--gig .piece-media { aspect-ratio: 3 / 2; }

.grid-note { color: var(--ink-soft); font-size: 0.8125rem; }

.show-all {
  display: block;
  margin: 2.5rem auto 0;
  border: 1px solid var(--line-strong);
  background: none;
  padding: 0.7rem 1.6rem;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.show-all:hover { border-color: var(--accent); color: var(--accent); }

.piece-media {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: var(--media-bg);
  overflow: hidden;
}

.piece--reel .piece-media { aspect-ratio: 9 / 16; }
.piece--photo .piece-media { aspect-ratio: 3 / 2; }

.piece-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.piece figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  letter-spacing: 0.01em;
}

.piece-meta { color: var(--ink-soft); }

/* ——— Featured on (Instagram embeds) ——— */

.social-note {
  max-width: 34em;
  color: var(--ink-soft);
  margin: -1.5rem 0 2.5rem;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr));
  gap: 1.5rem;
  align-items: start;
}

.social-grid .instagram-media {
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  min-height: 28rem;
  background: var(--media-bg);
  border-radius: 4px;
}

/* ——— About ——— */

.about {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

/* one type spec for everything in this section: same family, size, weight */
.about-text {
  font-size: clamp(1rem, 2.4vw, 1.125rem);
  line-height: 1.75;
}

.about-text p:not(.eyebrow) { max-width: 34em; }

.about-portrait {
  width: 100%;
  max-width: 22rem;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--media-bg);
}

/* ——— Contact (lives inside the About section) ——— */

.section--about { padding-bottom: clamp(4.5rem, 11vw, 8rem); }

.about-contact { margin-top: 2.5rem; }

.contact-note {
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.contact-email {
  display: inline-block;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 0.2s, color 0.2s;
}

.contact-email:hover { color: var(--accent); border-color: var(--accent); }

.contact-ig {
  display: block;
  margin-top: 1rem;
  color: var(--ink-soft);
  transition: color 0.2s;
}

.contact-ig:hover { color: var(--accent); }

/* ——— Footer ——— */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 78rem;
  margin: 0 auto;
  padding: 1.5rem var(--pad) 2rem;
  border-top: 1px solid var(--line);
  font-size: 0.6875rem;
  color: var(--ink-soft);
}

/* ——— Lightbox ——— */

.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(92vw, 70rem);
  max-height: 88vh;
  /* the universal margin reset kills the UA's dialog centering — restore it */
  margin: auto;
}

.lightbox::backdrop { background: rgb(20 20 16 / 0.93); }

.lightbox-stage img,
.lightbox-stage video {
  max-width: min(92vw, 70rem);
  max-height: 66vh;
  margin: 0 auto;
  object-fit: contain;
}

.lightbox-caption {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  color: #d8d4c9;
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0.8;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  color: #fff;
  font-family: var(--serif);
  font-size: 2.25rem;
  line-height: 1;
  padding: 1rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.lightbox-nav:hover { opacity: 1; }

.lightbox-prev { left: 0.5rem; }
.lightbox-next { right: 0.5rem; }

.lightbox--single .lightbox-nav { display: none; }

/* ——— Lightbox thumbnail strip ——— */

.lightbox-thumbs {
  display: flex;
  gap: 0.5rem;
  width: fit-content;
  max-width: min(92vw, 70rem);
  margin: 0.9rem auto 0;
  padding: 3px; /* room for the current-photo outline */
  overflow-x: auto;
  scrollbar-width: thin;
}

.lightbox-thumb {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.2s;
}

.lightbox-thumb:hover { opacity: 0.85; }

.lightbox-thumb.is-current { opacity: 1; outline: 1px solid #fff; outline-offset: 2px; }

.lightbox-thumb img { height: 3.25rem; width: auto; }

.lightbox--single .lightbox-thumbs { display: none; }

/* short viewports (landscape phones): give the photo the space back */
@media (max-height: 480px) {
  .lightbox-thumbs { display: none; }
  .lightbox-stage img, .lightbox-stage video { max-height: 78vh; }
}

/* ——— Wider screens ——— */

@media (min-width: 700px) {
  .hero-media { grid-template-columns: repeat(4, 1fr); }
  .hero-panel:nth-child(n+3) { display: block; }
  .hero-panel:nth-child(n+5) { display: none; }
  .about { grid-template-columns: 1.4fr 1fr; gap: 4rem; }
  .about-portrait { justify-self: end; }
  .work-grid--gigs { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  .hero-media { grid-template-columns: repeat(5, 1fr); }
  .hero-panel:nth-child(n+5) { display: block; }
  .work-grid { columns: 3; column-gap: 1.5rem; }
  .piece { margin-bottom: 1.5rem; }
  .work-grid--gigs .piece { margin-bottom: 0; }
}

/* ——— Motion ———
   Initial hidden states apply only when JS is running AND the
   visitor allows motion; main.js removes .js if the animation
   CDN fails so content is never stranded invisible. */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .js .hero-line,
  .js .reveal { opacity: 0; }

  .piece-media img { transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1); }
  .piece-media:hover img { transform: scale(1.03); }

  @keyframes fade-rise {
    from { opacity: 0; transform: translateY(14px); }
  }

  .tab-enter { animation: fade-rise 0.45s cubic-bezier(0.25, 0.1, 0.25, 1); }
}
