/* ---------------------------------------------
   Teri Perona — Labirinto
   Base styles
--------------------------------------------- */

:root {
  --bg: #e6eae3;
  --bg-alt: #e3e2d8;
  --header-bg: rgba(210, 205, 206, 0.85);
  --text: #1f1e17;
  --text-body: #2b2b23;
  --text-muted: #46473b;
  --text-muted-2: #4a4a3f;
  --text-muted-3: #484839;
  --text-faint: #6b6c5d;
  --text-faint-2: #838372;
  --text-faint-3: #5c5d51;
  --border: #d6d5c9;
  --border-2: #dbdace;
  --border-3: #c9c8bb;
  --accent: #163b3b;
  --selection: #d6d6c6;

  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-sans: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --sidebar-w: 220px;
  --col-gap: 80px;
  --container-max: 1180px;
  --container-pad: clamp(20px, 5vw, 48px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  cursor: url('../assets/labyrinth-cursor.svg') 15 15, auto;
  position: relative;
}

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

a:hover {
  color: var(--accent);
}

::selection {
  background: var(--selection);
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

/* ---------------------------------------------
   Ambient background ("Turrell" color field)
--------------------------------------------- */

.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.55;
  pointer-events: none;
  overflow: hidden;
}

.ambient-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: turrellPulse 240s ease-in-out infinite;
}

/* Each layer holds a static gradient and only its opacity animates —
   opacity interpolates smoothly frame-to-frame, unlike animating the
   `background` property directly between different gradients, which
   can't be tweened and just snaps at each keyframe. Layers are spaced
   48s apart (240s / 5) so adjacent ones crossfade through each other. */
.ambient-sage  { background: radial-gradient(ellipse 90% 70% at 30% 20%, #b7c9bf 0%, #b7c9bf 32%, transparent 68%); animation-delay: -48s; }
.ambient-mauve { background: radial-gradient(ellipse 90% 70% at 55% 25%, #c3bbc7 0%, #c3bbc7 32%, transparent 68%); animation-delay: 0s; }
.ambient-sand  { background: radial-gradient(ellipse 90% 70% at 70% 45%, #c9bfa9 0%, #c9bfa9 32%, transparent 68%); animation-delay: -192s; }
.ambient-slate { background: radial-gradient(ellipse 90% 70% at 55% 70%, #b4c0c4 0%, #b4c0c4 32%, transparent 68%); animation-delay: -144s; }
.ambient-olive { background: radial-gradient(ellipse 90% 70% at 30% 60%, #c0c6b5 0%, #c0c6b5 32%, transparent 68%); animation-delay: -96s; }

@keyframes turrellPulse {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  40%  { opacity: 0; }
  100% { opacity: 0; }
}

.page {
  position: relative;
  z-index: 1;
}

/* Cursor-follow tooltip */

.cursor-label {
  position: fixed;
  pointer-events: none;
  z-index: 50;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 2px;
  white-space: nowrap;
  transition: opacity 0.15s ease;
  opacity: 0;
}

.cursor-label.is-visible {
  opacity: 1;
}

/* ---------------------------------------------
   Header
--------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px 48px;
  background: var(--header-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}

.logo-sep {
  color: var(--text-faint);
  font-weight: 400;
}

.header-meta {
  display: flex;
  gap: 28px;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-faint-3);
}

@media (max-width: 640px) {
  .site-header {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 8px;
    padding: 16px var(--container-pad);
  }
  .header-meta {
    gap: 16px;
    flex-wrap: wrap;
  }
}

/* ---------------------------------------------
   Eyebrow / small caps labels
--------------------------------------------- */

.eyebrow {
  font-family: var(--font-sans);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  font-weight: 400;
  margin: 0;
}

/* ---------------------------------------------
   Hero
--------------------------------------------- */

.hero {
  padding: 96px 0 72px;
}

.hero .two-col {
  align-items: start;
}

.hero-inner h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 42px;
  line-height: 1.32;
  letter-spacing: -0.01em;
  max-width: 22ch;
  color: var(--text);
}

.hero-sub {
  margin: 32px 0 0;
  max-width: 58ch;
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-muted);
}

@media (max-width: 700px) {
  .hero .two-col {
    display: block;
  }
}

/* ---------------------------------------------
   Two-column practice layout
--------------------------------------------- */

.two-col {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: var(--col-gap);
}

/* Sidebar index */

.practice-index {
  position: sticky;
  top: 96px;
  align-self: start;
}

.index-label {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.index-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.index-list li {
  border-bottom: 1px solid var(--border-2);
}

.index-list a {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 14px 0;
  font-size: 17px;
  transition: color 0.15s ease;
}

.index-list .num {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-faint-2);
}

/* Practice sections */

.practice-sections {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 40px;
}

.practice-section {
  transition: opacity 0.45s ease;
  scroll-margin-top: 96px;
}

.practice-section + .practice-section {
  margin-top: 88px;
}

.practice-section.is-dimmed {
  opacity: 0.24;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-bottom: 18px;
  border-bottom: 1.5px solid var(--accent);
}

.section-header h2 {
  margin: 0;
  font-family: var(--font-sans);
  text-transform: uppercase;
  font-size: 15px;
  letter-spacing: 0.12em;
  font-weight: 500;
  color: var(--text);
}

.section-tags {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-faint);
}

/* Case entries */

.case-entry {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  padding: 30px 16px 30px 0;
  border-bottom: 1px solid var(--border-2);
  cursor: pointer;
  transition: background 0.25s ease, padding-left 0.25s ease;
}

.case-entry:hover {
  background: var(--bg-alt);
  padding-left: 16px;
}

.case-title-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.case-num {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-faint-2);
  flex-shrink: 0;
}

.case-entry h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 350;
  font-size: 27px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.case-entry p {
  margin: 10px 0 0 25px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted-2);
  max-width: 44ch;
}

.case-meta {
  display: grid;
  gap: 12px;
  justify-items: start;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-faint-3);
  padding-top: 6px;
}

.case-meta-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border: 1px solid var(--border-3);
  border-radius: 2px;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--text-faint-3);
  white-space: nowrap;
}

.read-case {
  color: var(--accent);
}

.more-note {
  margin: 0;
  padding: 18px 16px 0 25px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-faint-2);
}

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
  }
  .practice-index {
    position: static;
  }
  .index-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.5rem;
  }
  .index-list li {
    border-bottom: none;
  }
  .case-entry {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------
   About band
--------------------------------------------- */

.about-band {
  border-top: 1px solid var(--border);
  margin-top: 96px;
  background: var(--bg-alt);
}

.about-grid {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--sidebar-w);
  gap: var(--col-gap);
  align-items: start;
  padding: 80px 0;
}

.about-label {
  padding-top: 8px;
}

.about-text p {
  margin: 0;
  font-size: 22px;
  line-height: 1.6;
  font-weight: 300;
  max-width: 52ch;
  color: var(--text);
}

.about-text p.about-sub {
  margin-top: 22px;
  font-size: 17px;
  line-height: 1.7;
  font-weight: 400;
  color: var(--text-muted-3);
  max-width: 56ch;
}

.about-elsewhere {
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 2;
  color: var(--text-faint-3);
  padding-top: 8px;
}

.about-elsewhere .elsewhere-label {
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 10px;
}

@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 48px 0;
  }
}

/* ---------------------------------------------
   Footer
--------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding-top: 40px;
  padding-bottom: 64px;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-faint-2);
}

.footer-egg {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.why-link {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
  color: inherit;
}

.why-link:hover {
  color: var(--accent);
}

.egg-reveal {
  color: var(--accent);
  font-style: italic;
  font-family: var(--font-serif);
  font-size: 14px;
  max-width: 80ch;
  display: none;
}

.egg-reveal.is-visible {
  display: inline;
}

.back-to-top {
  color: var(--text);
}
