/* Page-level layouts: hero, about split, composition, spotlight */

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  padding: calc(var(--nav-h) + 2rem) 0 0;
  background: var(--color-void);
  color: var(--color-cream-soft);
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--color-void);
}

.hero__media img,
.hero__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0.58;
  transform: scale(1.02);
}

.hero__video {
  position: absolute;
  inset: 0;
}

.hero__poster {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Hide static poster once video can play (progressive enhancement) */
.hero__media.has-video .hero__poster {
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease-soft);
}

@media (prefers-reduced-motion: reduce) {
  .hero__video {
    display: none;
  }

  .hero__media.has-video .hero__poster {
    opacity: 0.58;
  }
}

.hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 9, 8, 0.92) 0%, rgba(10, 9, 8, 0.72) 42%, rgba(10, 9, 8, 0.35) 70%, rgba(10, 9, 8, 0.55) 100%),
    linear-gradient(180deg, rgba(10, 9, 8, 0.25) 0%, rgba(10, 9, 8, 0.15) 40%, rgba(10, 9, 8, 0.88) 100%);
  z-index: 1;
}

.hero__grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero__frame {
  position: absolute;
  inset: 1.1rem;
  border: 1px solid rgba(232, 223, 208, 0.12);
  z-index: 2;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 3;
  width: min(100% - (var(--gutter) * 2), var(--wide-max));
  margin-inline: auto;
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.75rem);
}

.hero__eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
}

.hero__eyebrow .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-amber);
  opacity: 0.8;
}

.hero h1,
.hero__title {
  max-width: none;
}

.hero h1 em {
  font-style: italic;
  color: var(--color-amber);
}

/* Keep full name on one line (EN + TH) */
.hero__title {
  white-space: nowrap;
}

html[lang="th"] .hero__title {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.15;
  font-size: clamp(2rem, 1.1rem + 5.5vw, 5.75rem);
}

@media (max-width: 380px) {
  .hero__title {
    white-space: normal;
  }
}

.hero__roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 40rem;
}

.hero__roles li {
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  font-style: italic;
  color: var(--color-fog);
}

.hero__roles li:not(:last-child)::after {
  content: "·";
  margin-left: 0.55rem;
  margin-right: 0.2rem;
  opacity: 0.45;
  font-style: normal;
}

.hero__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(232, 223, 208, 0.14);
}

.hero__scroll {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-fog);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
}

.hero__scroll-line {
  width: 2.5rem;
  height: 1px;
  background: var(--color-amber);
  position: relative;
  overflow: hidden;
}

.hero__scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-cream-soft);
  transform: translateX(-100%);
  animation: scan 2.4s var(--ease-soft) infinite;
}

@keyframes scan {
  0% {
    transform: translateX(-100%);
  }
  50%,
  100% {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__scroll-line::after {
    animation: none;
    transform: none;
    opacity: 0.4;
  }
}

/* Marquee strip under hero */
.marquee {
  background: var(--color-burgundy);
  color: var(--color-ivory);
  overflow: hidden;
  border-block: 1px solid rgba(244, 239, 230, 0.12);
}

.marquee__track {
  display: flex;
  width: max-content;
  gap: 2.5rem;
  padding: 0.85rem 0;
  animation: marquee 38s linear infinite;
}

.marquee__track span {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.92;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track {
    animation: none;
    width: auto;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.5rem;
  }
}

/* ---- About ---- */
.about-layout {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
}

@media (min-width: 900px) {
  .about-layout {
    grid-template-columns: 0.95fr 1.05fr;
    align-items: start;
  }
}

.about-portrait {
  position: relative;
}

.about-portrait figure {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-smoke);
}

.about-portrait img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 15%;
}

.about-portrait figcaption {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  color: var(--color-cream-soft);
  background: rgba(10, 9, 8, 0.55);
  padding: 0.4rem 0.65rem;
  backdrop-filter: blur(6px);
}

.about-copy {
  display: grid;
  gap: 1.25rem;
}

.about-copy .lede {
  color: var(--color-ink-soft);
  font-size: var(--fs-md);
}

.about-copy p {
  color: var(--color-ink-soft);
  max-width: 48ch;
}

/* ---- Split media sections ---- */
.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }

  .split--reverse .split__media {
    order: 2;
  }

  .split--reverse .split__copy {
    order: 1;
  }
}

.split__media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-smoke);
}

.split__media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.split__media .frame-label {
  position: absolute;
  top: 1rem;
  left: 1rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  color: var(--color-cream-soft);
  background: rgba(10, 9, 8, 0.5);
  padding: 0.35rem 0.55rem;
}

.split__copy {
  display: grid;
  gap: 1.25rem;
}

.split__copy p {
  max-width: 42ch;
  color: var(--fg-muted);
}

/* Teaching callout */
.teaching-callout {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid var(--color-rule);
  display: grid;
  gap: 0.85rem;
  background: rgba(107, 36, 48, 0.04);
}

.section--dark .teaching-callout {
  background: rgba(196, 165, 116, 0.06);
}

.teaching-callout p {
  margin: 0;
  max-width: 52ch;
  color: var(--fg-muted);
  font-size: var(--fs-sm);
}

/* Closing quote band */
.closing {
  text-align: center;
  display: grid;
  place-items: center;
  gap: 1.5rem;
}

.closing .pull-quote {
  margin-inline: auto;
}

.closing .pull-quote p {
  font-size: clamp(1.75rem, 3.5vw, 2.85rem);
}

/* Selected work placeholders — marked clearly */
.work-panel {
  border: 1px solid var(--color-rule);
  padding: clamp(1.25rem, 3vw, 2rem);
  display: grid;
  gap: 0.75rem;
  background: linear-gradient(145deg, rgba(196, 165, 116, 0.05), transparent 55%);
}

.work-panel__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.work-panel h3 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
}

.work-panel p {
  color: var(--fg-muted);
  max-width: 48ch;
}

.work-grid {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 800px) {
  .work-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

/* Spotlight cursor (optional, progressive) */
.spotlight-surface {
  position: relative;
}

.js-enabled body:not(.reduce-motion) .spotlight-surface::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    420px circle at var(--spot-x, 50%) var(--spot-y, 40%),
    rgba(196, 165, 116, 0.09),
    transparent 55%
  );
  z-index: 2;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease-soft);
}

.js-enabled body:not(.reduce-motion) .spotlight-surface:hover::after,
.js-enabled body:not(.reduce-motion) .spotlight-surface:focus-within::after {
  opacity: 1;
}

/* Active section indicator offset for sticky header */
[id] {
  scroll-margin-top: calc(var(--nav-h) + 1rem);
}
