/* ============================================================
   Michael Matushek — shared stylesheet
   Modern minimal, generous spacing. All sans-serif.
   Edit the variables below to retheme quickly.
   ============================================================ */

:root {
  --ink:        #1b1a18;   /* primary text */
  --ink-soft:   #57544e;   /* secondary text */
  --line:       #e7e4dd;   /* hairline borders */
  --bg:         #ffffff;
  --bg-alt:     #f8f7f3;   /* section tint */
  --accent:     #8b6737;   /* warm brass accent — September default */

  --max:        1080px;
  --measure:    68ch;      /* comfortable reading width for prose */
  --gap:        clamp(6rem, 13vw, 12rem);    /* vertical space between sections */

  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --serif: var(--sans);    /* headings use the same face — swap in a serif here to change that */
}

/* ============================================================
   SEASONAL PALETTES
   A one-line script in each page's <head> stamps the current month
   onto <html> as data-month="1" … "12". Each block below repaints
   the site by overriding the variables above. It changes by itself
   at midnight on the first of every month.

   To preview any month, add ?month=7 to the URL.
   To switch it off, delete the script tag in each <head>; the site
   falls back to the September palette defined in :root.
   ============================================================ */

:root[data-month="1"] {   /* January — frost, cold light, bare trees */
  --accent: #3f6288; --bg: #fdfdfe; --bg-alt: #f2f5f8; --line: #e2e8ee;
  --ink: #171b20; --ink-soft: #545c66;
}
:root[data-month="2"] {   /* February — garnet, candlelight, interiors */
  --accent: #8d3a4d; --bg: #fffdfd; --bg-alt: #f9f2f3; --line: #ece0e2;
  --ink: #1d1719; --ink-soft: #5e5153;
}
:root[data-month="3"] {   /* March — first green, wet ground, thaw */
  --accent: #47703c; --bg: #fdfefd; --bg-alt: #f2f6f0; --line: #e2e9df;
  --ink: #171a16; --ink-soft: #535a4f;
}
:root[data-month="4"] {   /* April — rain, wisteria, cool blossom */
  --accent: #565da2; --bg: #fdfdff; --bg-alt: #f3f3fa; --line: #e4e4f0;
  --ink: #18181f; --ink-soft: #545465;
}
:root[data-month="5"] {   /* May — chartreuse, long light, pollen */
  --accent: #66752a; --bg: #fefefc; --bg-alt: #f6f7ee; --line: #e8ead9;
  --ink: #1a1b14; --ink-soft: #585a4b;
}
:root[data-month="6"] {   /* June — Pride. See the rainbow rules below. */
  --accent: #8a2be2; --bg: #ffffff; --bg-alt: #f8f5fb; --line: #e9e3ef;
  --ink: #191519; --ink-soft: #575059;
}
:root[data-month="7"] {   /* July — vermilion, heat, fireworks */
  --accent: #b8412a; --bg: #fffdfb; --bg-alt: #faf3ef; --line: #eee1da;
  --ink: #1e1815; --ink-soft: #605450;
}
:root[data-month="8"] {   /* August — Gulf teal, humidity, deep shade */
  --accent: #146a67; --bg: #fdfefe; --bg-alt: #eff6f5; --line: #dde9e8;
  --ink: #141a19; --ink-soft: #4f5b5a;
}
:root[data-month="9"] {   /* September — brass, season openers, back to work */
  --accent: #8b6737; --bg: #ffffff; --bg-alt: #f8f7f3; --line: #e7e4dd;
  --ink: #1b1a18; --ink-soft: #57544e;
}
:root[data-month="10"] {  /* October — rust, dry leaves, low sun */
  --accent: #9c5620; --bg: #fffdfa; --bg-alt: #f9f4ec; --line: #ece2d5;
  --ink: #1d1913; --ink-soft: #5f574c;
}
:root[data-month="11"] {  /* November — plum, dusk at five, wool */
  --accent: #6a3757; --bg: #fefdfe; --bg-alt: #f7f2f6; --line: #e9e0e7;
  --ink: #1b171a; --ink-soft: #575055;
}
:root[data-month="12"] {  /* December — pine, evergreen, candlelight */
  --accent: #2b5c46; --bg: #fdfefd; --bg-alt: #f1f6f3; --line: #dfe9e4;
  --ink: #151a17; --ink-soft: #505a55;
}

/* ---------- June: Pride ----------
   The accent variable can only hold one color, so the pieces that
   read as "the accent" get a gradient treatment instead. Stops are
   darkened from the flag so text still passes contrast on white. */

:root[data-month="6"] .eyebrow,
:root[data-month="6"] .cv-head {
  background: linear-gradient(95deg, #cc0e18, #d96a00, #b99000, #00802b, #0a44c4, #6d2196);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

:root[data-month="6"] .site-header { border-bottom: 0; position: sticky; }
:root[data-month="6"] .site-header::after {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #e40303 0 16.6%, #ff8c00 0 33.3%, #ffed00 0 50%,
                                     #008026 0 66.6%, #004dff 0 83.3%, #750787 0);
}

:root[data-month="6"] .nav-links a[aria-current="page"] {
  border-bottom-color: transparent;
  border-image: linear-gradient(90deg, #e40303, #ff8c00, #ffed00, #008026, #004dff, #750787) 1;
}

:root[data-month="6"] .btn-primary:hover {
  background: linear-gradient(95deg, #cc0e18, #d96a00, #b99000, #00802b, #0a44c4, #6d2196);
  border-color: transparent;
  color: #fff;
}

:root[data-month="6"] blockquote.pull {
  border-left-color: transparent;
  border-image: linear-gradient(180deg, #e40303, #ff8c00, #ffed00, #008026, #004dff, #750787) 1;
}

@media (prefers-reduced-motion: no-preference) {
  body { transition: background-color .4s ease, color .4s ease; }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.95;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 clamp(1.5rem, 5vw, 3rem); }

/* ---------- Typography ---------- */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 .55em;
}
h1 { font-size: clamp(2.7rem, 6.5vw, 4.25rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.02rem; font-weight: 600; line-height: 1.5; letter-spacing: 0; }

p { margin: 0 0 1.5em; max-width: var(--measure); }
p.lead { font-size: clamp(1.12rem, 2vw, 1.32rem); color: var(--ink-soft); line-height: 1.7; }

.eyebrow {
  font-family: var(--sans);
  font-size: .84rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  line-height: 1.8;
  margin: 0 0 1.6rem;
  max-width: none;
}

.muted { color: var(--ink-soft); }

/* ---------- Header / nav ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  z-index: 50;
}

.nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  /* vertical only — .nav is also .wrap, and a padding shorthand here
     would wipe out the horizontal page margins it inherits */
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  flex-wrap: wrap;
}

.brand {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand span { font-size: .9rem; font-weight: 400; color: var(--ink-soft); letter-spacing: .04em; }

.nav-links { display: flex; gap: 2.25rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav-links a {
  text-decoration: none;
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* Hamburger button — hidden on desktop, shown by the phone block below */
.nav-toggle {
  display: none;
  width: 40px;
  height: 32px;
  padding: 8px 6px;
  margin-right: -6px;
  background: none;
  border: 0;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--ink);
  transition: transform .22s ease, opacity .18s ease;
}
/* Bars fold into an X when the menu is open */
.nav[data-open="true"] .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav[data-open="true"] .nav-toggle span:nth-child(2) { opacity: 0; }
.nav[data-open="true"] .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Sections ---------- */

/* Anchor targets stop below the sticky header rather than under it */
[id] { scroll-margin-top: 6rem; }

section { padding: var(--gap) 0; }
section + section { border-top: 1px solid var(--line); }
.tint { background: var(--bg-alt); }

/* Vertical only, for the same reason as .nav above */
.page-head {
  padding-top: clamp(2.75rem, 6vw, 4.5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}
.page-head p.lead { max-width: 48ch; }

/* ---------- Hero (landing) ----------
   Name block sits above a full-bleed landscape photograph.
   The photo is cropped to 16:9 on desktop; object-position keeps
   the head near the top of the frame. Adjust the percentage if you
   swap in a photo with a different composition.                    */

.hero-intro {
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3.5rem, 7vw, 5.5rem);
  max-width: 62ch;
}
.hero-intro h1 { margin-bottom: .3em; }
.hero-intro p.lead { max-width: 46ch; }

.hero-photo { width: 100%; margin: 0; }

.hero-photo img {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 78vh;
  object-fit: cover;
  object-position: center 15%;
  background: var(--bg-alt);
  display: block;
}

.hero-photo figcaption,
.photo-band figcaption {
  font-size: .78rem;
  letter-spacing: .04em;
  color: var(--ink-soft);
  padding-top: .9rem;
  text-align: right;
}

@media (max-width: 760px) {
  /* On phones show the whole frame — any crop zooms the subject, and on a
     narrow screen a cropped close-up ends up enormous. */
  .hero-photo img { aspect-ratio: auto; height: auto; max-height: none; }
}

/* Full-bleed bands stacked with a hairline of space between them */
.photo-stack { display: grid; gap: clamp(.75rem, 2vw, 1.25rem); }

/* Full-bleed photo band, reusable on any page */
.photo-band { margin: 0; }
.photo-band img {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 70vh;
  object-fit: cover;
  object-position: center 15%;
  display: block;
}
@media (max-width: 760px) { .photo-band img { aspect-ratio: auto; height: auto; max-height: none; } }

/* ---------- Buttons ---------- */

.btn-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2.75rem; }

.btn {
  display: inline-block;
  padding: .95rem 1.9rem;
  border: 1px solid var(--ink);
  border-radius: 1px;
  text-decoration: none;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }

/* ---------- Generic grid + cards ---------- */

.grid { display: grid; gap: clamp(2rem, 4vw, 3rem); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card { border: 1px solid var(--line); border-radius: 1px; padding: 2.75rem 2.25rem; background: var(--bg); }
.card h3 { margin-bottom: .9rem; }
.card p { font-size: .96rem; max-width: none; }
.card p:last-child { margin-bottom: 0; }

/* Card sections that belong together — close the gap and drop the
   hairline so they read as one run rather than three separate ideas */
.section-tight { padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-tight + section { padding-top: clamp(2.5rem, 5vw, 4rem); border-top: 0; }

/* Two-language note under a section */
.bilingual {
  margin: clamp(4rem, 8vw, 6rem) 0 0;
  max-width: none;
  font-size: 1.05rem;
  line-height: 1.7;
}
.bilingual span { color: var(--ink-soft); }

/* ---------- Split layout ---------- */

.split { display: grid; grid-template-columns: 240px 1fr; gap: clamp(2rem, 6vw, 5rem); }
.split h2 { margin-top: 0; }
/* Stack early — below ~900px the fixed heading column leaves the prose
   in a cramped ribbon, which is what an iPad in portrait looks like */
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 1.5rem; } }

/* ---------- Video embeds ---------- */

.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: clamp(2rem, 4vw, 3rem); }

.video figure { margin: 0; }
.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 1px;
  overflow: hidden;
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video h3 { margin: 1rem 0 .25rem; }
.video .meta { font-size: .88rem; color: var(--ink-soft); margin: 0; }

.video-feature { grid-column: 1 / -1; }

/* Streaming player embed (Spotify, Bandcamp, etc.) */
.embed-audio { max-width: 660px; }
.embed-audio + .embed-audio { margin-top: 1.75rem; }
.embed-audio iframe { display: block; width: 100%; border: 0; }

/* ---------- CV / résumé rows ---------- */

.resume-block { margin-bottom: 3.5rem; }
.resume-block:last-child { margin-bottom: 0; }

.cv-head {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: .8rem;
}

.entry {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2rem;
  padding: 2.1rem 0;
  border-top: 1px solid var(--line);
}
.entry:last-child { border-bottom: 1px solid var(--line); }
.entry .when { color: var(--ink-soft); font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; padding-top: .35rem; }
.entry .what h3 { margin-bottom: .3rem; }
.entry .what p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.entry .what ul { margin: .5rem 0 0; padding-left: 1.1rem; color: var(--ink-soft); font-size: .95rem; }
@media (max-width: 640px) { .entry { grid-template-columns: 1fr; gap: .35rem; } }

.tag-list { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; padding: 0; margin: 0; }
.tag-list li { border: 1px solid var(--line); border-radius: 999px; padding: .4rem 1rem; font-size: .86rem; color: var(--ink-soft); }

/* ---------- Pull quote ---------- */

blockquote.pull {
  margin: 0;
  padding-left: 2rem;
  border-left: 1px solid var(--accent);
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  max-width: 30ch;
}
blockquote.pull cite {
  display: block;
  margin-top: 1.4rem;
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-style: normal;
  color: var(--ink-soft);
}

/* ---------- Contact / footer ---------- */

.contact-line {
  font-size: clamp(1.35rem, 3.2vw, 1.9rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.contact-line a { text-decoration-thickness: 1px; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 3rem 0;
  font-size: .8rem;
  letter-spacing: .04em;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-footer a { color: var(--ink-soft); }

/* ============================================================
   Phones — the desktop spacing is deliberately large, which on a
   small screen turns into scrolling through emptiness. This block
   tightens everything and simplifies the header.
   ============================================================ */

@media (max-width: 640px) {
  :root { --gap: 3.5rem; }

  body { font-size: 16px; line-height: 1.75; }

  .wrap { padding: 0 1.5rem; }

  [id] { scroll-margin-top: 4.5rem; }

  h1 { font-size: clamp(2.1rem, 10vw, 2.8rem); }
  h2 { font-size: 1.45rem; }

  /* Header collapses to brand + hamburger. The brand keeps its full
     wording and wraps to a second line if the phone is narrow. */
  .nav { padding-top: .9rem; padding-bottom: .9rem; gap: 0 .5rem; align-items: center; }
  .brand { flex: 1 1 auto; min-width: 0; font-size: .92rem; line-height: 1.35; }
  .brand span { font-size: .78rem; }

  /* margin-right: 0 cancels the desktop nudge so the button keeps
     the same breathing room from the edge as the name has */
  .nav-toggle { display: flex; flex: 0 0 auto; margin-right: 0; }

  .nav-links {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    gap: 0;
    margin-top: .9rem;
  }
  .nav[data-open="true"] .nav-links { display: flex; }

  .nav-links li { border-top: 1px solid var(--line); }
  .nav-links a {
    display: block;
    padding: .95rem 0;
    font-size: .74rem;
    letter-spacing: .14em;
    border-bottom: 0;
  }
  .nav-links a[aria-current="page"] { color: var(--accent); border-bottom: 0; }

  .hero-intro { padding: 1.9rem 0 2.25rem; }
  .page-head  { padding-top: 1.9rem; padding-bottom: 2rem; }

  .eyebrow { font-size: .74rem; letter-spacing: .14em; line-height: 1.7; margin-bottom: 1.1rem; }

  .card { padding: 1.6rem 1.4rem; }
  .grid { gap: 1rem; }

  .btn-row { gap: .6rem; margin-top: 2rem; }
  .btn { padding: .85rem 1.35rem; font-size: .68rem; letter-spacing: .1em; }

  .contact-line { font-size: 1.25rem; }

  .site-footer { padding: 2rem 0; }
  .site-footer .wrap { flex-direction: column; gap: .4rem !important; }

  /* Photos sit inside the text margins on phones rather than full-bleed */
  .hero-photo,
  .photo-band { padding: 0 1.5rem; }

  .hero-photo figcaption,
  .photo-band figcaption {
    font-size: .72rem;
    padding: .6rem 0 0;
    max-width: none;
  }
}

/* ============================================================
   Tablets — wide enough for the desktop layout, not wide enough
   for three columns. Two columns, with a lone third card spanning
   the full width instead of sitting orphaned in a corner.
   ============================================================ */

@media (min-width: 641px) and (max-width: 1000px) {
  :root { --gap: clamp(4.5rem, 9vw, 7rem); }

  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }

  .card { padding: 2rem 1.75rem; }

  .hero-intro { padding: clamp(2.5rem, 5vw, 3.5rem) 0 clamp(2.5rem, 5vw, 3.5rem); }
  .page-head  { padding-top: clamp(2.5rem, 5vw, 3.5rem); padding-bottom: clamp(2.5rem, 5vw, 3.5rem); }
}

@media print {
  .site-header, .site-footer, .btn-row { display: none; }
  body { font-size: 12px; }
}
