/* =========================================================================
   Composer portfolio — shared styles
   One stylesheet for all pages. Dark, minimal, serif.
   Tweak the variables below to restyle the whole site at once.
   ========================================================================= */

:root {
  --bg:            #0a0a0a;   /* near-black background */
  --text:          #f0ece4;   /* off-white / cream primary text */
  --text-muted:    #8c8880;   /* muted gray for secondary text */
  --accent:        #c0392b;    /* subtle red, used sparingly (e.g. [Video]) */
  --line:          #262421;   /* hairline borders */

  --serif-display: "Playfair Display", Georgia, serif;
  --serif-body:    "EB Garamond", Georgia, serif;

  /* ╔═══════════════════════════════════════════════════════════════════╗
     ║  ✏️ EDIT: LEFT / RIGHT LAYOUT (how wide the content is)            ║
     ║                                                                    ║
     ║  These are the DEFAULT widths, used by About and Contact.          ║
     ║  BIGGER number = content is wider, less empty space on the sides.  ║
     ║  SMALLER number = content is narrower, more empty space.           ║
     ║  Everything stays centred either way.                              ║
     ║                                                                    ║
     ║  The Compositions page is WIDER — it overrides these just below,   ║
     ║  in the `body.wide-layout` rule.                                   ║
     ╚═══════════════════════════════════════════════════════════════════╝ */
  --content-max:   960px;     /* outer page width */
  --content-width: 820px;     /* the column the text actually sits in */
  --edge-band:     1080px;    /* black centre band over the background photo;
                                 must stay WIDER than --content-width */
  --gutter:        1.5rem;
}

/* ╔═════════════════════════════════════════════════════════════════════╗
   ║  ✏️ EDIT: WIDER LAYOUT — Compositions page only                      ║
   ║  Applied via  <body class="comp-bg wide-layout">  in                 ║
   ║  compositions.html. Change these three numbers to make ONLY the      ║
   ║  Compositions page wider or narrower. Remove the `wide-layout`       ║
   ║  class from that page's <body> to make it match the other pages.     ║
   ╚═════════════════════════════════════════════════════════════════════╝ */
body.wide-layout {
  --content-max:   1180px;
  --content-width: 1060px;
  --edge-band:     1220px;   /* keep this wider than --content-width */
}

/* ╔═════════════════════════════════════════════════════════════════════╗
   ║  ✏️ EDIT: FONT SIZES — where each one lives in this file             ║
   ║                                                                      ║
   ║  Sizes are in `rem`: 1rem = 16px. So 0.8rem ≈ 13px, 1.5rem = 24px.   ║
   ║  Search this file for the property name in the middle column.        ║
   ║                                                                      ║
   ║   WHAT YOU SEE ON SCREEN          SEARCH FOR        CURRENT          ║
   ║   ─────────────────────────────────────────────────────────────      ║
   ║   Body text everywhere            body {            1.125rem         ║
   ║   Big name on Home page           .hero-name        clamp(...6.5rem) ║
   ║   Tagline on Home page            .hero-tagline     clamp(...1.35rem)║
   ║   Your name, top of each page     .site-id-name     1.3rem           ║
   ║   "composer, educator..." line    .site-id-role     0.68rem          ║
   ║   Nav links (HOME, ABOUT...)      .nav-links a      0.78rem          ║
   ║   "Works: Multi Media | ..."      .works-nav        0.9rem           ║
   ║   Section headings                .works-heading    1.05rem          ║
   ║   Piece titles                    .comp-title       0.98rem          ║
   ║   "(for reed quintet)"            .comp-medium      0.95rem          ║
   ║   "Immersive | audiovisual..."    .comp-tags        0.8rem           ║
   ║   Duration, e.g. 7':00"           .comp-duration    0.9rem           ║
   ║   [Video, Audio] links            .comp-media       0.95rem          ║
   ║   Performance lines               .comp-performances li  0.95rem     ║
   ║   "Performed by ..." note         .perf-performers  0.9rem           ║
   ║   Footer                          .site-footer      0.8rem           ║
   ║                                                                      ║
   ║  NOTE: a few sizes are overridden for phones inside the              ║
   ║  `@media (max-width: 720px)` block at the BOTTOM of this file.       ║
   ║  If a change doesn't show up on a narrow screen, look there too.     ║
   ╚═════════════════════════════════════════════════════════════════════╝ */

/* ----- Reset-ish ----- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;   /* jump links glide instead of snapping */
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif-body);
  font-size: 1.125rem;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: inherit; }

img { max-width: 100%; height: auto; display: block; }

/* =========================================================================
   Header / navigation (shared on every page)
   ========================================================================= */
.site-header {
  position: relative;
  z-index: 20;
  padding: 1.75rem var(--gutter);
}

.nav {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

/* ----- Name block, at the very top above the nav (all pages except Home) -----
   Markup lives in about/compositions/contact .html inside <header>, before
   the <nav>. It is left-aligned, but constrained to the same centered column
   as the content below — so it lines up with that content, not with the
   far-left edge of the browser window.
   Change --site-id-width to match a different content column. */
.site-id {
  display: block;
  max-width: var(--content-width);
  margin: 0 auto 1.75rem;   /* space between the name block and the nav */
  text-align: left;
  text-decoration: none;
  line-height: 1.2;
}
.site-id-name {
  display: block;
  font-family: var(--serif-display);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text);
}
.site-id-role {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}
.site-id:hover .site-id-name { color: var(--accent); }

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.75rem;
}

.nav-links a {
  text-decoration: none;
  font-family: var(--serif-body);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: color 0.25s ease;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}

.nav-links a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Hamburger toggle — hidden on desktop, shown on small screens */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* =========================================================================
   Home / hero
   ========================================================================= */
body.home main { flex: 1; }

.hero {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 96px); /* fill viewport minus header */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  /* dim the video so text stays legible */
  filter: brightness(0.55);
}

.hero-overlay {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: var(--gutter);
}

.hero-name {
  font-family: var(--serif-display);
  font-weight: 600;
  font-size: clamp(2.75rem, 9vw, 6.5rem);
  line-height: 1.05;
  letter-spacing: 0.04em;
  margin: 0;
  text-shadow: 0 2px 30px rgba(0,0,0,0.6);
}

.hero-tagline {
  margin: 1.25rem 0 0;
  font-style: italic;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  color: var(--text);
  letter-spacing: 0.02em;
  text-shadow: 0 2px 20px rgba(0,0,0,0.7);
}

/* Mute / unmute toggle over the video */
.mute-toggle {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(240, 236, 228, 0.35);
  background: rgba(10, 10, 10, 0.45);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.mute-toggle:hover,
.mute-toggle:focus-visible {
  background: rgba(10, 10, 10, 0.75);
  border-color: rgba(240, 236, 228, 0.7);
}

/* =========================================================================
   Interior pages (about, compositions, contact)
   ========================================================================= */
.page {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 4rem;
}

.page-title {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  letter-spacing: 0.04em;
  text-align: center;
  margin: 1rem 0 3rem;
}

/* ----- About ----- */
.about-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: start;
  max-width: var(--content-width);
  margin: 0 auto;
}

.portrait {
  margin: 0;
}
.portrait img {
  width: 100%;
  border: 1px solid var(--line);
  filter: grayscale(0.15);
}

.about-bio p {
  margin: 0 0 1.4rem;
}

/* ----- Contact ----- */
.contact {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}
.contact-lead {
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.contact-button {
  display: inline-block;
  text-decoration: none;
  font-family: var(--serif-body);
  letter-spacing: 0.08em;
  font-size: 1.1rem;
  padding: 0.85rem 2.25rem;
  border: 1px solid var(--text-muted);
  border-radius: 2px;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.contact-button:hover,
.contact-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}
/* Row of plain links (YouTube, SoundCloud). Change `row` to `column`
   below if you'd rather have them stacked one per line. */
.contact-links {
  list-style: none;
  padding: 0;
  margin: 3rem 0 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 2.5rem;
}
.contact-links .contact-label {
  display: inline-block;
  width: 110px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.contact-links a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.contact-links a:hover { border-bottom-color: var(--accent); }

/* =========================================================================
   Compositions list (rendered from data/compositions.json)
   ========================================================================= */
/* ----- "Works: Multi Media | Acousmatic | ..." jump links -----
   Normal capitalisation (not ALL CAPS). To make them uppercase again, add
   text-transform: uppercase; to the rule below. */
.works-nav {
  max-width: var(--content-width);
  margin: 0 auto 3.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.6rem;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}
.works-nav-label { color: var(--text); }
.works-nav a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.works-nav a:hover,
.works-nav a:focus-visible {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.works-nav-sep { color: var(--line); }

/* ----- One section per category ----- */
.works-section {
  max-width: var(--content-width);
  margin: 0 auto 4rem;
  /* so a jumped-to heading isn't flush against the top of the window */
  scroll-margin-top: 2rem;
}
/* Section headings are deliberately DIMMER than the piece titles, so the
   works themselves are what your eye lands on and the headings read as
   quiet labels. ✏️ To make them stand out instead, change `color` below to
   var(--text) (bright cream) or var(--accent) (the red). */
.works-heading {
  font-family: var(--serif-display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1.75rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}

.compositions {
  list-style: none;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0;
}

/* Each entry: text on the left, optional cover photo on the right. */
.compositions > li.comp-item {
  display: grid;
  grid-template-columns: 1fr;   /* text only, unless it has a cover */
  gap: 1.75rem;
  align-items: start;
  padding: 0 0 2.25rem 0;
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--line);
}
.compositions > li.comp-item:last-child {
  border-bottom: none;
}

/* Entries WITH a cover photo get a second column.
   ✏️ Change --cover-width to make every cover bigger or smaller. */
.compositions > li.comp-item.has-cover {
  --cover-width: 360px;
  grid-template-columns: 1fr var(--cover-width);
  gap: 2.25rem;
}

.comp-cover { margin: 0; }
.comp-cover img {
  width: 100%;
  border: 1px solid var(--line);
}

.comp-title {
  font-family: var(--serif-display);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.4;
  margin: 0;
}
.comp-title .comp-name { font-style: italic; }

/* the "(for cello and electronics)" descriptor after the title */
.comp-medium {
  color: var(--text-muted);
  font-weight: 400;
  font-style: normal;
  font-size: 0.95rem;
}

/* the "(2026)" shown after the title on pieces that use a tags line */
.comp-yearlabel {
  color: var(--text-muted);
  font-weight: 400;
  font-style: normal;
}

/* second line, e.g. "Immersive | audiovisual | multiscreen".
   Same colour as the piece title. */
.comp-tags {
  color: var(--text);
  font-family: var(--serif-display);
  font-size: 0.8rem;        /* ✏️ tags line size */
  font-style: normal;
  letter-spacing: 0.03em;
  margin: 0.35rem 0 0;
}

/* optional duration, e.g. 8':43" */
.comp-duration {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: normal;
}

/* the [Video, Audio] links */
.comp-media {
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: var(--accent);
  font-style: normal;
  white-space: nowrap;
}
.comp-link {
  color: var(--accent);
  text-decoration: none;
}
.comp-link:hover,
.comp-link:focus-visible { text-decoration: underline; }

/* awards / prizes — sit above the performances, in the bright text colour
   so they stand out from the muted performance list */
.comp-awards {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  color: var(--text);
  font-size: 0.95rem;   /* ✏️ awards line size */
  line-height: 1.6;
}
.comp-awards li { margin-bottom: 0.25rem; }

/* performances sub-list */
.comp-performances {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
}
.comp-performances li {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}
/* Performance years match the rest of the line (not bright white). */
.comp-performances .perf-year { color: inherit; }
.comp-performances .perf-date { font-style: italic; }
.comp-performances .perf-performers {
  display: block;
  font-size: 0.9rem;
  opacity: 0.75;
}

.comp-loading,
.comp-error {
  list-style: none;
  text-align: center;
  color: var(--text-muted);
}
.comp-error { color: var(--accent); }

/* =========================================================================
   Page photo backdrop on the LEFT & RIGHT edges only (edge-bg)
   -------------------------------------------------------------------------
   A photo sits behind the page, but a black band down the middle keeps the
   text area fully black/readable. The photo shows only in the side margins,
   fading into the black. On narrow screens (viewport <= the black band width)
   the band covers everything, so it's automatically all black there.

   Used on:  Compositions (bg4.png), About (bg1.png), Contact (bg5.png).

   ╔═══════════════════════════════════════════════════════════════════════╗
   ║  ✏️ HOW TO EDIT THESE BACKGROUNDS                                      ║
   ║                                                                         ║
   ║  • CHANGE A PAGE'S PHOTO: edit that page's url(...) in the per-page     ║
   ║      list below (e.g. body.about-bg). Drop your image in assets/img/.   ║
   ║                                                                         ║
   ║  • GO BACK TO COMPLETELY BLACK for a page: either                       ║
   ║      (a) delete that page's `--edge-photo:` line below, OR              ║
   ║      (b) remove the body class (comp-bg / about-bg / contact-bg) from   ║
   ║          that page's <body>. The plain black background stays.          ║
   ║                                                                         ║
   ║  • HOW MUCH PHOTO SHOWS: change --edge-band (bigger = wider black       ║
   ║      center = less photo at the edges). Keep it >= the content width    ║
   ║      (~960px) so text never sits on the photo.                          ║
   ╚═══════════════════════════════════════════════════════════════════════╝ */

/* Per-page: which photo each page uses (this is the line to edit/remove). */
body.comp-bg    { --edge-photo: url("../assets/img/bg4.png"); }
body.about-bg   { --edge-photo: url("../assets/img/bg1.png"); }
body.contact-bg { --edge-photo: url("../assets/img/bg5.png"); }

/* Shared backdrop: paints --edge-photo masked to the left/right edges. */
body.comp-bg::before,
body.about-bg::before,
body.contact-bg::before {
  content: "";
  position: fixed;          /* stays put while the page scrolls */
  inset: 0;                 /* cover the whole viewport */
  z-index: -1;              /* sit behind all page content */
  background-color: var(--bg);

  /* --edge-band (the black centre band that masks the photo) is set at the
     top of this file, and overridden for the Compositions page. */

  /* Layer 1 (top): a black band down the middle, transparent at the edges,
     which masks the photo so it only peeks out on the left & right.
     Layer 2 (bottom): the page's photo (--edge-photo, set per page above). */
  background-image:
    linear-gradient(to right,
      rgba(10, 10, 10, 0) 0,
      var(--bg) calc((100% - var(--edge-band)) / 2),
      var(--bg) calc((100% + var(--edge-band)) / 2),
      rgba(10, 10, 10, 0) 100%),
    var(--edge-photo);
  background-repeat: no-repeat, no-repeat;
  background-position: center center, center center;
  background-size: cover, cover;
}

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  padding: 2rem var(--gutter);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.site-footer p { margin: 0; }

/* =========================================================================
   Responsive — collapse nav into a hamburger on small screens
   ========================================================================= */
@media (max-width: 720px) {
  .nav { justify-content: space-between; align-items: center; }

  .site-id-name { font-size: 1.1rem; }
  .site-id-role { font-size: 0.6rem; letter-spacing: 0.12em; }

  .nav-toggle { display: flex; }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    background: var(--bg);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 1.5rem 0;
    /* hidden by default; .open reveals it */
    display: none;
  }
  .nav-links.open { display: flex; }

  /* open-state hamburger -> X */
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

  /* ╔═══════════════════════════════════════════════════════════════════╗
     ║  ✏️ EDIT: BACKGROUND PHOTO ON PHONES                               ║
     ║                                                                    ║
     ║  On wide screens the photo shows only at the far left and right,   ║
     ║  because a black band covers the middle where the text sits.       ║
     ║  A phone screen is narrower than that band, so the photo would be  ║
     ║  completely hidden — which is why it used to look all black.       ║
     ║                                                                    ║
     ║  The rule below fixes that: on phones the photo fills the whole    ║
     ║  screen, with a dark veil over it so the text stays readable.      ║
     ║                                                                    ║
     ║  • MORE of the photo showing: lower BOTH 0.85 values (e.g. 0.75).  ║
     ║  • LESS of the photo showing: raise them (e.g. 0.92).              ║
     ║  • Plain black on phones again: delete this whole rule.            ║
     ╚═══════════════════════════════════════════════════════════════════╝ */
  body.comp-bg::before,
  body.about-bg::before,
  body.contact-bg::before {
    background-image:
      linear-gradient(rgba(10, 10, 10, 0.85), rgba(10, 10, 10, 0.85)),
      var(--edge-photo);
    background-position: center center, center center;
    background-size: cover, cover;
  }

  /* Cover photos stack under the text instead of sitting beside it. */
  .compositions > li.comp-item.has-cover {
    grid-template-columns: 1fr;
  }
  .comp-cover { max-width: 100%; }

  .works-heading { font-size: 1rem; }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .portrait {
    max-width: 240px;
    margin: 0 auto;
  }
}

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