/* ─────────────────────────────────────────
   Kingwinston template — stylesheet

   Architecture:
   - Tabs nav is persistent (one DOM element,
     never cloned). Its active slot grows
     instantly when .stage[data-active] changes.
   - Content area is what gets cloned. During
     navigation, two .content elements coexist
     briefly. GSAP animates them.
   - The moving tab(s) get a FLIP transform
     applied at the same time so they appear
     to slide together with the content.

   No CSS transitions on layout properties.
   All motion handled by JS via GSAP.
───────────────────────────────────────── */

:root {
  --bg: #efede9;
  --ink: #1F2A22;
  --line: #1F2A22;
  --accent: #3D5C44;
  --hairline: 1px;
  --tab-w: 55px;
  --aside-w: 320px;
  --pad-frame: 14px;
}

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

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Serif", Georgia, serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.42;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: var(--pad-frame);
}

a { color: inherit; }

/* ── OUTER FRAME ──────────────────────── */
.frame {
  border: var(--hairline) solid var(--line);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── TOP BAR ──────────────────────────── */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px 24px;
  border-bottom: var(--hairline) solid var(--line);
  flex-shrink: 0;
}

.wordmark {
  grid-column: 2;
  font-family: "IBM Plex Serif", serif;
  font-weight: 400;
  letter-spacing: 0.22em;
  font-size: 15px;
}

.clock {
  grid-column: 3;
  text-align: right;
  font-size: 20px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

/* ── MAIN ROW ─────────────────────────── */
.shell {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* Left description column */
.aside {
  width: var(--aside-w);
  flex-shrink: 0;
  border-right: var(--hairline) solid var(--line);
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.aside p {
  max-width: 290px;
  font-size: 18px;
  line-height: 1.4;
}

.corner-logo {
  width: 200px;
  height: auto;
  display: block;
}

/* ── STAGE ────────────────────────────── */
.stage {
  flex: 1;
  position: relative;
  min-width: 0;
  overflow: hidden;
}

/* ── TABS LAYER (top, persistent) ─────── */
.tabs {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 2;
  pointer-events: none;
}

.tab-slot {
  flex: 0 0 var(--tab-w);
  position: relative;
  border-right: var(--hairline) solid var(--line);
}

.tab-slot:last-child { border-right: none; }

/* Active slot grows. This snaps instantly;
   the slide is created by translating the
   moving tab via JS (FLIP). */
.stage[data-active="work"]    .tab-slot[data-tab="work"],
.stage[data-active="about"]   .tab-slot[data-tab="about"],
.stage[data-active="contact"] .tab-slot[data-tab="contact"] {
  flex: 1 1 0;
}

.tab {
  display: block;
  width: var(--tab-w);
  height: 100%;
  text-decoration: none;
  color: inherit;
  background: var(--bg);
  pointer-events: auto;
  position: relative;
  cursor: pointer;
  will-change: transform;
}

.tab-label {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.tab-dot {
  width: 10px;
  height: 10px;
  border: var(--hairline) solid var(--ink);
  border-radius: 50%;
  flex-shrink: 0;
  transition: background-color 200ms ease;
}

.stage[data-active="work"]    .tab[data-tab="work"]    .tab-dot,
.stage[data-active="about"]   .tab[data-tab="about"]   .tab-dot,
.stage[data-active="contact"] .tab[data-tab="contact"] .tab-dot {
  background-color: var(--accent);
  border-color: var(--accent);
}

.tab-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: "IBM Plex Serif", serif;
  font-size: 20px;
  letter-spacing: 0.02em;
}

/* ── CONTENT LAYER (behind tabs) ──────── */
.content-wrapper {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.content {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  will-change: transform;
}

.content-inner {
  min-height: 100%;
  padding-top: 28px;
  padding-bottom: 40px;
}

/* Each content has padding based on its OWN
   data-tab — so when two are coexisting during
   transition, each has the correct padding for
   the page it represents. */
.content[data-tab="work"] .content-inner {
  padding-left: 0;
  padding-right: calc(var(--tab-w) * 2);
}
.content[data-tab="about"] .content-inner {
  padding-left: var(--tab-w);
  padding-right: var(--tab-w);
}
.content[data-tab="contact"] .content-inner {
  padding-left: calc(var(--tab-w) * 2);
  padding-right: 0;
}

.content-body {
  padding: 0 28px 0 90px;
  max-width: 1180px;
}

/* ── WORK VIEW ────────────────────────── */
.work-list {
  list-style: none;
  font-family: "Hanken Grotesk", sans-serif;
  font-weight: 400;
  font-size: clamp(40px, 6.4vw, 88px);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.work-list li a {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  padding: 2px 0;
  transition: opacity 200ms ease;
}

.work-list li a:hover { opacity: 0.35; }

/* ── ABOUT VIEW ───────────────────────── */
.about-body p {
  font-size: 17px;
  line-height: 1.45;
  margin-bottom: 18px;
  max-width: 1000px;
}

.section-head {
  font-family: "IBM Plex Serif", serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 13px;
  margin-top: 36px;
  margin-bottom: 14px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 60px;
  font-size: 16px;
  max-width: 720px;
}

.press p {
  font-size: 16px;
  margin-bottom: 6px;
}

.press a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.studio-photo {
  margin-top: 40px;
  width: 100%;
  max-width: 1000px;
  aspect-ratio: 16 / 8.5;
  background:
    linear-gradient(180deg, rgba(15,25,18,0.18) 0%, rgba(15,25,18,0.55) 100%),
    linear-gradient(135deg, #6b7e6b 0%, #3d5c44 55%, #1f2a22 100%);
}

/* ── CONTACT VIEW ─────────────────────── */
.contact-body .section-head:first-child { margin-top: 0; }

.contact-body .lead-link {
  font-size: 17px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.playlist {
  margin-top: 36px;
  width: 100%;
  max-width: 1000px;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(15,25,18,0.55) 0%, rgba(15,25,18,0.25) 40%, rgba(15,25,18,0.65) 100%),
    linear-gradient(135deg, #4a5e4a 0%, #1f2a22 100%);
}
.playlist-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(245, 240, 230, 0.9);
  font-family: "IBM Plex Serif", serif;
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.005em;
  text-align: center;
  pointer-events: none;
}
.playlist-text .a { font-size: clamp(40px, 6.5vw, 100px); letter-spacing: 0.04em; }
.playlist-text .b { font-size: clamp(48px, 8vw, 130px); }

/* ── RESPONSIVE FALLBACK ──────────────── */
@media (max-width: 920px) {
  .aside { width: 240px; padding: 22px 18px; }
  .aside p { font-size: 14px; }
}

@media (max-width: 680px) {
  body { padding: 8px; }
  .topbar { padding: 12px 14px; }
  .wordmark { font-size: 13px; letter-spacing: 0.18em; }
  .clock { font-size: 11px; }

  .shell { flex-direction: column; overflow: visible; }
  .aside {
    width: 100%;
    border-right: none;
    border-bottom: var(--hairline) solid var(--line);
    padding: 18px 16px;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
  }
  .aside p { font-size: 13px; max-width: none; flex: 1; }
  .corner-logo { width: 120px; flex-shrink: 0; }

  .stage { overflow: visible; }
  .tabs {
    position: relative;
    inset: auto;
    flex-direction: column;
  }
  .tab-slot {
    flex: 0 0 auto;
    width: 100%;
    border-right: none;
    border-bottom: var(--hairline) solid var(--line);
  }
  .tab-slot:last-child { border-bottom: none; }
  .tab {
    width: 100%;
    height: auto;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .tab-label {
    position: static;
    transform: none;
    flex-direction: row;
    gap: 12px;
  }
  .tab-text {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 15px;
  }

  .content-wrapper { position: relative; inset: auto; overflow: visible; }
  .content { position: relative; inset: auto; }
  .content[data-tab] .content-inner {
    padding: 16px 16px 24px;
  }
  .content-body { padding: 0; }

  .work-list { font-size: clamp(36px, 11vw, 56px); }
  .services-grid { grid-template-columns: 1fr 1fr; gap: 4px 24px; }
}
