/* =========================================================
   Maxwell Cohen — personal site
   Editorial / magazine aesthetic.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500;9..144,700;9..144,900&family=Source+Serif+4:opsz,wght@8..60,300;8..60,400;8..60,600&family=Inter:wght@400;500;600&family=Caveat:wght@500;600&display=swap');

:root {
  --bg: #F6F1E7;
  --bg-soft: #EFE9DC;
  --ink: #1C1C20;
  --ink-soft: #4A4A50;
  --ink-mute: #76767E;
  --rule: #D9D2C2;
  --accent: #B33A2C;            /* brick red — primary */
  --accent-2: #2E5046;           /* deep forest/teal — secondary (mountains, plants, that team) */
  --accent-soft: #A9785A;

  --serif-display: 'Fraunces', 'Iowan Old Style', 'Georgia', serif;
  --serif-body: 'Source Serif 4', 'Source Serif Pro', 'Iowan Old Style', 'Georgia', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --script: 'Caveat', 'Bradley Hand', 'Comic Sans MS', cursive;

  --container: 1180px;
  --container-narrow: 760px;
}

/* Subtle paper grain on the body — barely visible, gives warmth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
main, .site-header, .site-footer { position: relative; z-index: 1; }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: 19px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ink);
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 120ms ease;
}
a:hover { color: var(--accent); }

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

.container { max-width: var(--container); margin: 0 auto; padding: 0 32px; }
.container--narrow { max-width: var(--container-narrow); }

/* ----- Site header / nav ----- */
.site-header {
  padding: 28px 0 0;
}
.nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule);
}
.nav__brand {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.nav__brand:hover { color: var(--ink); }
.nav__brand .mark {
  display: inline-block;
  width: 32px;
  height: 22px;
  color: var(--accent);
  transform: translateY(1px);
}
.nav__brand .mark .sun { color: var(--accent-2); }
.nav__links {
  display: flex;
  gap: 28px;
}
.nav__links a {
  font-family: var(--sans);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-decoration: none;
  color: var(--ink-soft);
}
.nav__links a:hover,
.nav__links a.is-active {
  color: var(--accent);
}

/* ----- Hero ----- */
.hero {
  padding: 80px 0 56px;
  border-bottom: 1px solid var(--rule);
}
.hero__eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
}
.hero__title {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  max-width: 18ch;
}
.hero__sub {
  font-family: var(--serif-body);
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
  max-width: 56ch;
  font-style: italic;
}

/* Italic display title fallback */
.hero__title em {
  font-style: italic;
  font-weight: 400;
}

/* ----- Section ----- */
.section {
  padding: 72px 0;
  position: relative;
}
.section + .section { border-top: 1px solid var(--rule); }

/* Section break ornament — rendered as a centered mark sitting on the rule */
.section + .section::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 28px;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 28'><circle cx='29' cy='6' r='2.8' fill='%232E5046'/><path d='M2 25 L13 9 L20 18 L29 6 L38 25' fill='none' stroke='%23B33A2C' stroke-width='1.8' stroke-linejoin='round' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28px 18px;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 16px;
}
.section__eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.section__title {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 6px 0 0;
}
.section__intro {
  max-width: 60ch;
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 36px;
}

/* ----- Work grid (homepage) ----- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 36px;
}
@media (max-width: 720px) {
  .work-grid { grid-template-columns: 1fr; }
}

.clip {
  display: block;
  text-decoration: none;
  color: inherit;
}
.clip__media {
  display: block;
  overflow: hidden;
  background: var(--ink);
  margin-bottom: 18px;
  aspect-ratio: 3 / 2;
}
.clip__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms ease;
}
.clip:hover .clip__media img { transform: scale(1.02); }
.clip__meta {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
}
.clip__meta .dot { color: var(--rule); }
.clip__meta .cat { color: var(--accent); }
.clip__title {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--ink);
}
.clip__dek {
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
}
.clip:hover .clip__title { color: var(--accent); }

/* ----- Work page: categorized list ----- */
.category {
  padding: 56px 0;
  border-bottom: 1px solid var(--rule);
}
.category:last-child { border-bottom: none; }
.category__head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 32px;
}
.category__title {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: 30px;
  letter-spacing: -0.01em;
  margin: 0;
}
.category__count {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.work-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
  align-items: start;
}
.work-row:last-child { border-bottom: 1px solid var(--rule); }
@media (max-width: 720px) {
  .work-row { grid-template-columns: 1fr; gap: 16px; }
}
.work-row__media {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--ink);
}
.work-row__media img { width: 100%; height: 100%; object-fit: cover; }
.work-row__body { display: flex; flex-direction: column; }
.work-row__meta {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
}
.work-row__meta .cat { color: var(--accent); }
.work-row__title {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.work-row__title a { text-decoration: none; }
.work-row__title a:hover { color: var(--accent); }
.work-row__dek {
  font-size: 17.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
  max-width: 60ch;
}

/* ----- About / prose blocks ----- */
.prose {
  max-width: 62ch;
}

/* Floated figure inside .prose — e.g. the kindergarten letter alongside the lede */
.prose-figure {
  float: right;
  width: 300px;
  margin: 4px 0 16px 32px;
  padding: 0;
  transform: rotate(1.4deg);
  filter: drop-shadow(0 8px 18px rgba(28,28,32,0.18));
}
.prose-figure img {
  width: 100%;
  display: block;
  background: #fff;
  border: 1px solid var(--rule);
}
.prose-figure figcaption {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 10px;
  line-height: 1.45;
  transform: rotate(-1.4deg);  /* counter-rotate caption so it sits flat */
}
.prose-figure figcaption em {
  font-family: var(--serif-body);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  color: var(--ink-soft);
}
@media (max-width: 720px) {
  .prose-figure {
    float: none;
    width: 78%;
    max-width: 320px;
    margin: 0 auto 28px;
    transform: rotate(1deg);
  }
}
.prose p {
  font-size: 19px;
  line-height: 1.7;
  margin: 0 0 1.3em;
  color: var(--ink);
}
.prose p:first-of-type::first-line {
  font-variant: small-caps;
  letter-spacing: 0.06em;
}
.prose .lede {
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  line-height: 1.45;
  color: var(--ink-soft);
  margin-bottom: 1.4em;
}

/* ----- About preview on home ----- */
.about-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
@media (max-width: 820px) {
  .about-preview { grid-template-columns: 1fr; gap: 24px; }
}
.about-preview__lede {
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
}
.about-preview__body p {
  margin: 0 0 1em;
  color: var(--ink-soft);
  line-height: 1.65;
}

/* ----- Contact ----- */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 720px) {
  .contact { grid-template-columns: 1fr; gap: 24px; }
}
.contact__pitch {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.3;
  margin: 0;
}
.contact__list { list-style: none; padding: 0; margin: 0; }
.contact__list li {
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  display: flex;
  gap: 14px;
}
.contact__list .label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  min-width: 80px;
  padding-top: 3px;
}
.contact__list a {
  font-family: var(--serif-body);
  font-size: 18px;
  letter-spacing: 0;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
}
.contact__list a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ----- CTA button-ish links ----- */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 4px;
}
.cta:hover { color: var(--ink); border-bottom-color: var(--ink); }
.cta::after { content: "→"; transform: translateY(-1px); }

/* ----- Footer ----- */
.site-footer {
  padding: 48px 0 56px;
  border-top: 1px solid var(--rule);
  color: var(--ink-mute);
}
.site-footer__row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  align-items: baseline;
}
.site-footer__note {
  font-family: var(--serif-body);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 18px;
  max-width: 64ch;
}
.site-footer__row span,
.site-footer__row a {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.site-footer a { color: var(--ink-mute); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer .mark { width: 28px; height: 18px; color: var(--accent); }
.site-footer .mark .sun { color: var(--accent-2); }

/* ----- Signoff (handwritten) ----- */
.signoff {
  margin: 56px 0 0;
  font-family: var(--script);
  font-size: 40px;
  line-height: 1;
  color: var(--accent-2);
  letter-spacing: 0.005em;
  transform: rotate(-2deg);
  display: inline-block;
}

/* ----- Right now aside ----- */
.rightnow {
  margin: 40px 0 8px;
  padding: 20px 24px;
  background: var(--bg-soft);
  border-left: 3px solid var(--accent-2);
  font-family: var(--serif-body);
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.rightnow .label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
  display: block;
  margin-bottom: 6px;
}

/* ----- Utilities ----- */
.text-accent { color: var(--accent); }
.italic { font-style: italic; }
.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ----- Page-specific hero variants ----- */
.page-hero {
  padding: 80px 0 32px;
}
.page-hero__title {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: clamp(44px, 6vw, 84px);
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 8px 0 28px;
}
.page-hero__intro {
  max-width: 62ch;
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-soft);
}
