/* ============================================================
   oliverbrown.design
   Theme tokens are injected from config.json by main.js as
   CSS custom properties on :root.
   ============================================================ */

:root {
  --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --outside-bg: #ffffff;
  --outside-text: #3a3a3a;
  --outside-muted: #8a8a8a;
  --outside-line: #9a9a9a;

  --inside-bg: #F7C9FF;
  --inside-text: #4a3340;
  --inside-card: #ffffff;
  --inside-accent: #6c3fa0;

  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--outside-text);
  background: var(--outside-bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

a { color: inherit; }

/* ---------- Navigation (not fixed) ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: none;
  margin: 0;
  padding: 1.6rem 3rem 1.07rem;
}

.nav__brand {
  font-size: 1.9rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav__links {
  display: flex;
  gap: 2rem;
}

.nav__link {
  font-size: 1.9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--outside-text);
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.18s ease, opacity 0.18s ease;
}

.nav__link:hover { border-color: currentColor; }

/* ---------- Sections ---------- */
.section {
  padding: 2.68rem 2rem 6rem;
  scroll-margin-top: 1rem;
}

.section--outside {
  background: var(--outside-bg);
  color: var(--outside-text);
}

.section--inside {
  position: relative;
  overflow: hidden;
  background: var(--inside-bg);
  color: var(--inside-text);
}

.section__heading {
  font-size: 2rem;
  font-weight: 500;
  margin: 0 0 2.5rem;
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Intro ----------
   Door and text are two stacked layers (door behind, text in front).
   The three pieces sit in a centered flex row sized to the ACTUAL
   wrapped text width (max-content), so the whole composition is
   centered on real content — not on fixed-width text boxes. */
.intro {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: none;
  margin: 2rem 0 0;
  min-height: 72vh;
}

/* Door — its own layer, behind the text, but kept in flow so it
   contributes its width to the group's centering. */
.intro__door {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: block;
  cursor: pointer;
}

.door-img {
  display: block;
  width: 750px;
  height: auto;
}

/* Text — front layer, each block only as wide as its longest line. */
.intro__col {
  position: relative;
  z-index: 2;
  width: max-content;
  text-align: center;
  font-size: 3.46rem;
  font-weight: 350;
  line-height: 1.32;
  color: var(--outside-text);
}

.intro__col div { white-space: nowrap; }

/* Text sits in front visually but lets clicks pass through to the door button */
.intro__col { pointer-events: none; }

/* Overlap the text in front of the door for the layered look. */
.intro__col--left { margin-right: -90px; }
.intro__col--right { margin-left: -90px; }

.door-glow { display: none; }


/* ---------- About ---------- */
.about {
  max-width: 720px;
  margin: 0 auto;
}

.about h2 {
  font-size: 2rem;
  font-weight: 500;
  margin: 0 0 1.5rem;
}

.about p {
  font-size: 1.2rem;
  font-weight: 300;
  margin: 0 0 1.2rem;
  color: var(--outside-text);
}

/* ---------- Portfolio ---------- */
.portfolio {
  position: relative;
  z-index: 2;
}

.portfolio__grid {
  display: grid;
  gap: 2.5rem;
  max-width: var(--maxw);
  margin: 0 auto;
}

.piece {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  align-items: center;
  gap: 2rem;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(2px);
  border-radius: 14px;
  padding: 1.75rem;
  text-decoration: none;
  color: var(--inside-text);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.piece:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(80, 40, 70, 0.18);
}

.piece__title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0 0 0.75rem;
}

.piece__blurb {
  font-size: 1.05rem;
  font-weight: 300;
  margin: 0 0 1.2rem;
}

.piece__more {
  display: inline-block;
  font-size: 0.95rem;
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--inside-accent);
  border-radius: 999px;
  color: var(--inside-accent);
}

.piece:hover .piece__more {
  background: var(--inside-accent);
  color: #fff;
}

/* Thumbnail with play button (matches the design mockups) */
.piece__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  background: #1d1320;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.piece__play {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}

.piece__play::after {
  content: "";
  margin-left: 4px;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent var(--inside-accent);
}

/* ---------- Scattered children (inside the classroom) ---------- */
.children {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.child {
  position: absolute;
  width: 56px;
  height: 85px;
  /* the white silhouette png is used as a mask so we can tint it */
  -webkit-mask: url('../../sprites/child.png') no-repeat center / contain;
  mask: url('../../sprites/child.png') no-repeat center / contain;
  opacity: 0.55;
}

/* ---------- Contact ---------- */
.section--contact { padding-bottom: 4rem; }

.contact {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.contact h2 {
  font-size: 2rem;
  font-weight: 500;
  margin: 0 0 1rem;
}

.contact p {
  font-size: 1.2rem;
  font-weight: 300;
  margin: 0 0 1.5rem;
}

.contact__email {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  text-decoration: none;
  border-bottom: 2px solid var(--inside-accent);
}

.contact__links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.contact__links a {
  font-size: 1.05rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.contact__links a:hover { border-color: currentColor; }

/* ---------- Footer ---------- */
.footer {
  padding: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--outside-muted);
  background: var(--outside-bg);
}

/* ============================================================
   Portfolio sub-page
   ============================================================ */
.subpage { background: var(--inside-bg); color: var(--inside-text); }

.subpage .nav__link,
.subpage .nav__brand { color: var(--inside-text); }

.piece-page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem 2rem 6rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  text-decoration: none;
  font-size: 1rem;
  border-bottom: 1px solid transparent;
}
.back-link:hover { border-color: currentColor; }

.piece-page__title {
  font-size: 2.6rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin: 0 0 0.5rem;
}

.piece-page__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 2rem;
}

.tag {
  font-size: 0.85rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
}

.piece-page__hero {
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #1d1320;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.piece-page__hero img,
.piece-page__hero video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.piece-page__body {
  max-width: 720px;
}

.piece-page__body p {
  font-size: 1.2rem;
  font-weight: 300;
  margin: 0 0 1.3rem;
}

.piece-page__facts {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
  margin: 2rem 0 0;
  font-size: 1rem;
}

.piece-page__facts dt {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.piece-page__facts dd { margin: 0; font-weight: 300; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
  .nav__links { gap: 1.25rem; }
  .intro { flex-direction: column; }
  .intro__col { font-size: 2.4rem; order: 2; margin: 0; }
  .intro__door { order: 1; }
  .door-img { width: 360px; }
  .piece { grid-template-columns: 1fr; }
  .piece-page__title { font-size: 2rem; }
}
