/* ==========================================================================
   matthewschellenberg.com — static rebuild
   Design tokens recovered from the original Squarespace (Clarkson) site:
     bg            #0f0000  (near-black red) + fixed red-room photograph
     heading red   #9d0c0c  (h1/h2/h3, strong, content links)
     card          rgba(255,255,255,.9), 1em padding, 5px radius
     headings      Futura PT  -> fallback: Jost
     body          Proxima Nova 14px/1.6, .5px letterspacing -> fallback: Mulish
   ========================================================================== */

:root {
  --red: #9d0c0c;
  --bg: #0f0000;
  --card: rgba(255, 255, 255, 0.9);
  --font-heading: futura-pt, "Jost", "Futura", "Century Gothic", sans-serif;
  --font-body: proxima-nova, "Mulish", "Helvetica Neue", Arial, sans-serif;

  /* --- Desktop sizing, measured off screenshots of the live Squarespace site ---
     Nudge these if anything still reads too big or too small; everything
     downstream refers back to them. */
  --logo-size: 34px;          /* was 38 */
  --logo-sub-size: 12px;      /* was 13 */
  --nav-size: 13.5px;         /* was 15  */
  --quote-size: 19px;         /* was 22  */
  --card-w: 860px;            /* was 1000 */
  --card-w-wide: 900px;       /* was 1280 — the big one; Lovesick measured ~900 */
  --card-w-narrow: 700px;     /* was 760  */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--bg);
  color: #000;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.5px;
  line-height: 1.6em;
  min-height: 100vh;
}

/* Fixed full-bleed background photograph */
.site-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg) url("../assets/img/darker_background.webp") no-repeat center center;
  background-size: cover;
}

img { max-width: 100%; height: auto; border: 0; vertical-align: middle; }

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  color: var(--red);
  line-height: 1.2em;
}
h1 { font-size: 2.9em; }
h2 { font-size: 1.9em; }
h3 { font-size: 1.9em; }
strong, b { font-weight: 700; color: var(--red); }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 34px 44px 20px;
  position: relative;
  z-index: 100;
}

.logo-block a { color: #fff; text-decoration: none; }
.logo {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--logo-size);
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.21em;
  line-height: 1em;
}
.logo-subtitle {
  margin: 10px 0 0;
  font-family: var(--font-heading);
  font-size: var(--logo-sub-size);
  font-weight: 400;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.3em;
}

/* ---- Main nav ---- */

.main-nav ul {
  list-style: none;
  margin: 0.4em 0 0;
  padding: 0;
  display: flex;
  gap: 28px;
}
.main-nav li { position: relative; }
.main-nav li > a {
  font-family: var(--font-heading);
  font-size: var(--nav-size);
  letter-spacing: 1px;
  color: #fff;
  line-height: 1.5em;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: border-bottom-color 0.3s;
}
.main-nav li > a:hover,
.main-nav li.active > a {
  text-decoration: none;
  border-bottom-color: #fff;
}

/* dropdown */
.main-nav .folder-child {
  list-style: none;
  margin: 0;
  padding: 14px 0;
  position: absolute;
  top: calc(100% + 12px);
  right: -14px;
  min-width: 190px;
  background: #fff;
  display: none;
  flex-direction: column;
  gap: 0;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.25);
}
.main-nav .folder-child::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 30px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid #fff;
}
.main-nav .folder:hover .folder-child,
.main-nav .folder:focus-within .folder-child,
.main-nav .folder.open .folder-child { display: flex; }

/* invisible bridge covering the gap between the nav item and its dropdown,
   so the cursor never leaves the hover area on the way down */
.main-nav .folder::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -16px;
  right: -30px;
  height: 18px;
}
.main-nav .folder-child li > a {
  display: block;
  padding: 8px 22px;
  color: #111;
  font-size: 14px;
  border-bottom: none;
  white-space: nowrap;
}
.main-nav .folder-child li > a:hover { color: var(--red); }

/* mobile toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 3px;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 13px;
  letter-spacing: 2px;
  padding: 8px 14px;
  cursor: pointer;
}

/* ==========================================================================
   Page layout / content card
   ========================================================================== */

.page-wrap {
  padding: 20px 20px 90px;
  display: flex;
  justify-content: center;
}

.content-card {
  background: var(--card);
  padding: 2em 2.5em;
  border-radius: 5px;
  width: 100%;
  max-width: var(--card-w);
  overflow-wrap: break-word;   /* long URLs can't push the card wider than the screen */
}
.content-card--wide { max-width: var(--card-w-wide); }
.content-card--narrow { max-width: var(--card-w-narrow); }

/* Two-column layout (Lovesick) */
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5em;
  align-items: start;
}

/* white page-title displayed on the photo, outside a card (Reel) */
.overlay-title {
  font-family: var(--font-heading);
  font-size: 1.9em;
  color: #fff;
  text-align: center;
  margin: 0.6em 0 1em;
}

/* Home quote */
.home-quote {
  margin: 12vh auto 0;
  max-width: 980px;
  padding: 0 30px;
  text-align: center;
  color: #fff;
  font-family: var(--font-heading);
  font-size: var(--quote-size);
  font-style: italic;
  line-height: 1.5em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}
.home-quote cite { display: block; font-style: normal; margin-top: 0.6em; font-weight: 700; }

/* ==========================================================================
   Embeds
   ========================================================================== */

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  margin: 1em 0;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* clearly-marked placeholder for a missing embed */
.video-placeholder {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1em 0;
  background: #1a1a1a center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-placeholder .todo {
  background: rgba(0, 0, 0, 0.75);
  color: #ffd9d9;
  font-family: var(--font-heading);
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 10px 18px;
  border: 1px dashed rgba(255, 217, 217, 0.7);
  border-radius: 3px;
}

.soundcloud-embed { margin: 1em 0; }
.soundcloud-embed iframe { width: 100%; border: 0; }

/* ==========================================================================
   Audio player (replicates the Squarespace "minimal dark" audio block)
   ========================================================================== */

.audio-track {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #272727;
  color: #fff;
  padding: 16px 20px;
  margin: 14px 0;
}
.audio-track button.play {
  flex: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 0;
  cursor: pointer;
  position: relative;
}
.audio-track button.play::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 8px;
  border-left: 14px solid #fff;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}
.audio-track.playing button.play::before {
  border: 0;
  left: 10px;
  top: 8px;
  width: 5px;
  height: 18px;
  background: #fff;
  box-shadow: 9px 0 0 #fff;
}
.audio-track .meta { flex: 1 1 auto; min-width: 0; }
.audio-track .title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.audio-track .author { font-size: 12px; color: #bbb; }
.audio-track .bar {
  flex: 0 0 34%;
  height: 3px;
  background: #4a4a4a;
  cursor: pointer;
  position: relative;
  touch-action: none;   /* let us scrub on touch instead of the page scrolling */
}
/* invisible taller hit area — 3px is far too thin to hit, especially on a phone */
.audio-track .bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -11px;
  bottom: -11px;
}
.audio-track .bar .fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: #fff;
}
.audio-track .time { font-size: 11px; color: #bbb; flex: none; min-width: 38px; text-align: right; }
.audio-track.todo-track { outline: 1px dashed rgba(157, 12, 12, 0.9); outline-offset: 2px; }

/* ==========================================================================
   Content bits
   ========================================================================== */

.awards-list { list-style: none; padding: 0; margin: 1em 0; }
.awards-list li { padding: 0.35em 0 0.35em 1.1em; position: relative; }
.awards-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.95em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #000;
}

.press-links p { margin: 1.2em 0; }

.cbc-intro {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin: 1em 0 2em;
}
.cbc-intro img { flex: none; width: 110px; }

.todo-note {
  border: 1px dashed var(--red);
  border-radius: 3px;
  background: rgba(157, 12, 12, 0.06);
  color: var(--red);
  font-size: 13px;
  padding: 10px 14px;
  margin: 1em 0;
}

.bio-photo { margin: 1.5em 0; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 2px;
  padding: 20px;
}

/* Contact address — assembled by js/main.js so it isn't plain text in the
   source. Two contexts: the dark footer, and the white Biography card. */
.site-footer .site-contact { display: block; margin-top: 8px; letter-spacing: 1px; }
.site-footer .site-contact a { color: rgba(255, 255, 255, 0.75); }
.site-footer .site-contact a:hover { color: #fff; }

.bio-contact { margin-top: 1.8em; }
.bio-contact .site-contact a { color: var(--red); }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1000px) {
  .cols { grid-template-columns: 1fr; }
  .site-header { padding: 28px 26px 14px; }
  .logo { font-size: 28px; }
}

@media (max-width: 760px) {
  .site-header { flex-direction: column; gap: 18px; }
  .nav-toggle { display: inline-block; align-self: flex-start; }
  .main-nav { display: none; width: 100%; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; margin-top: 0.6em; }
  .main-nav li > a { display: block; padding: 10px 0; font-size: 17px; }
  .main-nav .folder-child {
    position: static;
    display: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.95);
    margin: 4px 0 10px;
    border-radius: 4px;
  }
  .main-nav .folder-child::before { display: none; }
  .main-nav .folder.open .folder-child { display: flex; }
  .content-card { padding: 1.4em 1.2em; }
  h1 { font-size: 2.1em; }
  h2, h3 { font-size: 1.5em; }
  .home-quote { font-size: 17px; margin-top: 8vh; }
  .audio-track .bar { flex-basis: 26%; }
  .audio-track .time { display: none; }
  /* photo-beside-text intros stack instead of squeezing the text to a sliver */
  .cbc-intro { flex-direction: column; gap: 14px; }
  .cbc-intro img { width: 90px; }
}

/* Small phones. Without this the logo — 17 uppercase letters with .21em
   tracking — is wider than a 375px screen and pushes the page sideways. */
@media (max-width: 480px) {
  .site-header { padding: 22px 18px 12px; }
  .logo { font-size: 22px; }
  .logo-subtitle { font-size: 10px; letter-spacing: 0.22em; }
  .page-wrap { padding: 14px 12px 60px; }
  .content-card { padding: 1.2em 1em; }
  h1 { font-size: 1.8em; }
  h2, h3 { font-size: 1.35em; }
  .home-quote { font-size: 15px; padding: 0 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ruled page title (Biography) */
.overlay-title--ruled {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding-bottom: 0.8em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
