/* Palette tokens work like --intro-padding: change the value once and every var() reader updates. */
:root {
  --intro-padding: 48px;
  --champagne: #d9c39a;
  --ink: #090d14;
  --glass: #77c9eb;
  --bg: var(--ink);
  --surface: #131f2e;
  --raised: #1d3245;
  --text: #e0eaf2;
  --muted: #b5c6d6;
  --heading: var(--champagne);
  --accent: var(--glass);
  --edge: #36546b;
  color-scheme: dark;
}
:root[data-theme="organic"] {
  --bg: #e6f2f5;
  --surface: #f5fbfc;
  --raised: #cae5ef;
  --text: #152e3e;
  --muted: #365366;
  --heading: #523919;
  --accent: #075771;
  --edge: #719eaf;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.65 system-ui, "Segoe UI", sans-serif;
}
main { padding: var(--intro-padding); text-align: center; }
/* Only the padding playground needs to center an intrinsically sized block. */
body:not(.home-page) {
  display: grid;
  place-items: center;
}
a { color: var(--accent); text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.skip { position: absolute; top: .5rem; left: .5rem; z-index: 5; padding: .65rem; background: var(--surface); transform: translateY(-180%); }
.skip:focus { transform: none; }
.masthead {
  padding: 1.8rem 1rem 1rem;
  text-align: center;
  background: var(--ink);
  color: #e0eaf2;
  border-bottom: 1px solid #32485c;
}
.brand { display: inline-grid; justify-items: center; color: var(--champagne); text-decoration: none; }
.brand img { display: block; }
.studio-wordmark { font-size: 1.45rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
nav { display: flex; flex-wrap: wrap; gap: .2rem 1.15rem; justify-content: center; }
nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: .95rem; }
.masthead nav { margin-top: .65rem; }
.masthead nav a { color: inherit; }
.masthead :focus-visible { outline-color: var(--glass); }
/* Size the panel frame from the available page width, independently of the heading. */
.entrance {
  width: min(calc(100% - 2rem), 900px);
  margin-inline: auto;
  padding-block: 1rem 2rem;
  text-align: center;
}
.entrance h1 { font-size: clamp(1.2rem, 3.3vw, 1.7rem); }
.doors {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--edge);
  border-radius: 1rem;
  height: clamp(18rem, 51svh, 36rem);
}
.door {
  position: absolute;
  inset-block: 0;
  width: 50%;
  display: grid;
  place-items: center;
  padding: .5rem;
  text-align: center;
  border: 0;
  font: inherit;
  cursor: pointer;
  transition: left 620ms cubic-bezier(.2,.75,.2,1), width 620ms cubic-bezier(.2,.75,.2,1);
}
.door.organic {
  left: 0;
  color: #122d3b;
  background:
    radial-gradient(ellipse at 25% 20%, #fff9df, transparent 55%),
    repeating-radial-gradient(ellipse at 0 100%, #d4edf2 0 22px, #c2e1eb 23px 25px, #ddf1f3 26px 45px);
}
.door.industrial {
  left: 50%;
  color: #ecf5fa;
  background:
    radial-gradient(ellipse at 75% 25%, #244e6a, transparent 65%),
    repeating-linear-gradient(120deg, #0b1520 0 27px, #2f4d62 28px, #101d29 29px 52px);
}
.door span {
  min-width: 0;
  max-width: 100%;
  padding: clamp(.4rem, 1.3vw, .65rem) clamp(.4rem, 2vw, 1.5rem);
  border: 1px solid #d9c39a;
  border-radius: .65rem;
  background: #eff8fa;
  font-size: clamp(.875rem, 1.5vw, 1rem);
  overflow-wrap: anywhere;
}
.door.industrial span { background: #0d1b27; }
.door strong { display: block; font-size: clamp(1rem, 3vw, 2.55rem); font-weight: 650; line-height: 1.2; }
.door:focus-visible { outline: 3px solid #d9c39a; outline-offset: -6px; z-index: 1; }
.door:focus-visible span { box-shadow: 0 0 0 4px #3d7c9b; }
@media (hover: hover) {
  .door:hover span { box-shadow: 0 0 0 4px #3d7c9b; }
}
/* Keep the panel's outside edge anchored. The other panel exits through the clipped edge. */
.doors[data-selection="organic"] .organic { width: 100%; }
.doors[data-selection="organic"] .industrial { left: 100%; }
.doors[data-selection="industrial"] .organic { left: -50%; }
.doors[data-selection="industrial"] .industrial { left: 0; width: 100%; }

.home-page main { padding: 0 clamp(1rem, 5vw, 3rem); max-width: 70rem; margin-inline: auto; }
h1, h2, h3 { line-height: 1.15; color: var(--heading); }
h1 { font-size: clamp(2.25rem, 6vw, 4.15rem); letter-spacing: -.045em; margin: .35em 0; }
h2 { font-size: clamp(1.45rem, 3vw, 2.1rem); margin: .25em 0 .65em; }
h3 { font-size: 1.22rem; margin: 1rem 0 .5rem; }
.hero { padding: clamp(2.75rem, 8vw, 6rem) 0; border-bottom: 1px solid var(--edge); }
.eyebrow, .status { font-size: .875rem; font-weight: 650; color: var(--accent); }
.eyebrow { text-transform: uppercase; letter-spacing: .13em; }
.hero-grid { display: grid; grid-template-columns: 1fr 2.4fr 1fr; align-items: center; gap: 1rem; }
.hero-grid h1 { grid-column: 2; grid-row: 1; }
.hero-grid .primary { grid-column: 1; grid-row: 1; }
.hero-grid .cta:last-child { grid-column: 3; grid-row: 1; }
.cta { display: grid; place-items: center; min-height: 3.15rem; padding: .6rem .55rem; border: 1px solid var(--accent); border-radius: .55rem; font-weight: 650; text-decoration: none; }
.cta.primary, .cta:hover { background: var(--raised); }
.intro { max-width: 42rem; margin: 1rem auto 0; color: var(--muted); }
.workbench { padding: 2.8rem 0 1rem; }
.cards, .paired-projects { display: grid; gap: 1rem; }
.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* A separate second row keeps Writing and Music together without a carousel or hidden cards. */
.cards-paired, .paired-projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards-paired { margin-top: 1rem; }
.card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border: 1px solid var(--edge);
  border-radius: .8rem;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.card:hover { border-color: var(--accent); background: var(--raised); }
.card h3 { margin-top: .25rem; }
.card p { margin: .5rem 0; }
.card .status { margin-top: auto; padding-top: .65rem; }
.devlog-preview { margin: 2rem 0; padding: 1.5rem 0; border-top: 1px solid var(--edge); }
.project-media { margin: 1.5rem 0 0; }
.project-media img { display: block; width: 100%; height: auto; border: 1px solid var(--edge); border-radius: .65rem; }
.project-media figcaption { margin-top: .65rem; color: var(--muted); }
.encounter-diagram { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.encounter-diagram span { padding: .55rem .75rem; border: 1px solid var(--edge); border-radius: .5rem; background: var(--surface); }
.home-page .reading { max-width: 52rem; text-align: left; padding-top: 2.5rem; padding-bottom: 3rem; }
.reading section { margin-top: 2rem; border-top: 1px solid var(--edge); padding-top: 1.25rem; }
.reading p { max-width: 65ch; }
.home-page .reading-wide { max-width: 67rem; }
/* Reading pages widen only where a paired section or a development image needs the space. */
.feature-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: start;
  gap: 1.5rem;
}
.feature-split .project-media { margin-top: 0; }
.reading .paired-projects > section {
  margin-top: 1rem;
  padding: 1.2rem;
  border: 1px solid var(--edge);
  border-radius: .8rem;
  background: var(--surface);
}
.sequence, .journal-entry time, .about-devlog time { color: var(--accent); font-weight: 650; }
.journal-entry, .about-devlog { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--edge); }
.journal-entry header h2 { margin-top: .6rem; }
.lede { font-size: 1.25rem; color: var(--muted); }
footer { padding: 1.1rem 1rem; border-top: 1px solid var(--edge); text-align: center; }
footer p { margin: 0; font-weight: 700; color: var(--heading); }
@media (max-width: 710px) {
  .feature-split { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr 1fr; }
  .hero-grid h1 { grid-column: 1 / -1; }
  .hero-grid .primary { grid-column: 1; grid-row: 2; }
  .hero-grid .cta:last-child { grid-column: 2; grid-row: 2; }
}
@media (max-width: 560px) {
  .cards, .paired-projects { grid-template-columns: 1fr; }
}
/* Match the JavaScript motion check. Reduced-motion skips the directional animation. */
@media (prefers-reduced-motion: reduce) {
  .door { transition: none; }
}
