/* ==========================================================================
   jonathanmalm.com — shared styles
   Palette + type translated from the Claude Design source (Layout A).
   ========================================================================== */

:root {
  --cream:   #F4EFE6;
  --ink:     #16160F;
  --green:   #2F4A2C;
  --accent:  #C0402C;
  --card:    #FFFDF8;
  --panel:   #EDE6D9;
  --row-hover:#F7F2E7;
  --muted:   #4A463C;
  --muted-2: #6E695C;
  --body:    #3A362E;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans:  'Karla', system-ui, -apple-system, sans-serif;
  --maxw: 1320px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; }
::selection { background: var(--accent); color: var(--cream); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.container { max-width: var(--maxw); margin: 0 auto; padding-left: 40px; padding-right: 40px; }

@keyframes floatIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Reveal-on-scroll ------------------------------------------------------- */
[data-reveal] { opacity: 1; }
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 700ms ease, transform 700ms cubic-bezier(.16,.84,.44,1); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1 !important; transform: none !important; transition: none; }
}

/* ==========================================================================
   Header / nav
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px 40px;
  background: rgba(244,239,230,0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(22,22,15,0.08);
}
.brand {
  display: block; width: 186px; height: 41px;
  background-color: var(--ink);
  -webkit-mask: url('assets/logo.png') left center / contain no-repeat;
          mask: url('assets/logo.png') left center / contain no-repeat;
  transition: background-color 200ms ease;
}
.brand:hover { background-color: var(--accent); }

.nav { display: flex; align-items: center; gap: 28px; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.nav a { color: var(--muted); padding: 4px 0; border-bottom: 1px solid transparent; transition: color 160ms ease, border-color 160ms ease; }
.nav a:hover, .nav a.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.nav .pill {
  background: var(--green); color: var(--cream);
  padding: 10px 18px; border-radius: 999px; font-size: 13px; border-bottom: none;
}
.nav .pill:hover { background: var(--ink); color: var(--cream); }

.nav-toggle { display: none; }

/* ==========================================================================
   Hero — Layout A (full-bleed photo, form in the light negative space)
   ========================================================================== */
.hero { position: relative; min-height: min(92vh, 860px); display: flex; align-items: center; isolation: isolate; overflow: hidden; }
.hero__bg {
  position: absolute; inset: 0; z-index: -2;
  background: url('assets/header-crop.jpg') right center / cover no-repeat;
}
.hero__scrim {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg,
    var(--cream) 0%,
    var(--cream) 40%,
    rgba(244,239,230,0.86) 52%,
    rgba(244,239,230,0.35) 62%,
    rgba(244,239,230,0) 72%);
}
.hero__inner { width: 100%; padding-top: 96px; padding-bottom: 96px; }
.hero__form {
  max-width: min(560px, 48vw);
  display: flex; flex-direction: column; gap: 26px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent);
}
.hero h1 {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: clamp(46px, 5.4vw, 82px); line-height: 0.98; letter-spacing: -0.015em; text-wrap: pretty;
}
.hero .lede { margin: 0; font-size: 19px; line-height: 1.6; color: var(--muted); max-width: 44ch; text-wrap: pretty; }

/* Newsletter form ------------------------------------------------------- */
.signup { display: flex; flex-wrap: wrap; gap: 10px; max-width: 540px; }
.signup input[type=email] {
  flex: 1 1 240px; min-width: 0; height: 56px; padding: 0 18px;
  font-family: var(--sans); font-size: 16px; color: var(--ink);
  background: var(--card); border: 1px solid rgba(22,22,15,0.18); border-radius: 10px;
}
.signup .btn { flex: 0 0 auto; }
.signup .fineprint { flex: 1 1 100%; font-size: 13px; color: var(--muted-2); margin: 0; }

.btn {
  height: 56px; padding: 0 30px; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 15px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--cream); background: var(--ink); border: none; border-radius: 10px; cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}
.btn:hover { background: var(--accent); color: var(--cream); transform: translateY(-2px); }

.notice {
  background: var(--green); color: var(--cream);
  padding: 22px 26px; border-radius: 14px; max-width: 520px; animation: floatIn 400ms ease both;
}
.notice strong { display: block; font-family: var(--serif); font-size: 26px; font-weight: 400; margin-bottom: 4px; }
.notice span { font-size: 15px; opacity: 0.85; }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding-top: clamp(72px, 9vw, 140px); padding-bottom: clamp(72px, 9vw, 140px); }
.section--tight { padding-top: clamp(64px, 8vw, 120px); padding-bottom: clamp(64px, 8vw, 120px); }

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: clamp(32px, 5vw, 64px); }
.section-head h2 { margin: 0; font-family: var(--serif); font-size: clamp(32px, 3.2vw, 46px); font-weight: 400; }
.section-head .meta { font-size: 14px; color: var(--muted-2); }

/* About teaser ---------------------------------------------------------- */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: clamp(32px, 5vw, 80px); align-items: start; }
.about-grid .label { font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted-2); }
.about-grid h2 { margin: 14px 0 0; font-family: var(--serif); font-size: clamp(34px, 3.4vw, 50px); line-height: 1.05; font-weight: 400; text-wrap: pretty; }
.prose { display: flex; flex-direction: column; gap: 20px; font-size: 18px; line-height: 1.7; color: var(--body); max-width: 56ch; }
.prose p { margin: 0; }
.arrow-link { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; letter-spacing: 0.04em; color: var(--green); transition: gap 160ms ease, color 160ms ease; }
.arrow-link:hover { color: var(--accent); gap: 16px; }
.arrow-link .arrow { font-family: var(--serif); font-size: 20px; }

/* Projects (Layout A: index rows) --------------------------------------- */
.section--projects { background: var(--panel); border-top: 1px solid rgba(22,22,15,0.08); border-bottom: 1px solid rgba(22,22,15,0.08); }
.project-list { display: flex; flex-direction: column; border-top: 1px solid rgba(22,22,15,0.14); }
.project-row {
  display: grid; grid-template-columns: 64px minmax(0,1.1fr) minmax(0,1.4fr) 40px; gap: 24px; align-items: center;
  padding: 30px 12px; border-bottom: 1px solid rgba(22,22,15,0.14);
  transition: background 200ms ease, padding-left 200ms ease;
}
.project-row:hover { background: var(--row-hover); padding-left: 24px; }
.project-row .num { font-family: var(--serif); font-size: 20px; color: var(--accent); }
.project-row .name { font-family: var(--serif); font-size: clamp(26px, 2.6vw, 38px); line-height: 1.05; color: var(--ink); }
.project-row .desc { font-size: 17px; line-height: 1.55; color: var(--muted); }
.project-row .go { font-family: var(--serif); font-size: 24px; color: var(--green); justify-self: end; }

/* Books ----------------------------------------------------------------- */
.book-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: clamp(20px, 3vw, 36px); }
.book { display: flex; flex-direction: column; gap: 14px; transition: transform 240ms cubic-bezier(.16,.84,.44,1); }
.book:hover { transform: translateY(-10px); }
.book__cover { aspect-ratio: 2/3; border-radius: 6px; overflow: hidden; box-shadow: 0 10px 26px rgba(22,22,15,0.16); background: var(--panel); }
.book__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book h3 { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 400; line-height: 1.15; color: var(--ink); }
.book p { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--muted-2); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--ink); color: var(--cream); }
.site-footer .container { padding-top: clamp(56px, 7vw, 96px); padding-bottom: clamp(56px, 7vw, 96px); }
.footer-cta { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 40px; align-items: end; }
.footer-cta h2 { margin: 0 0 10px; font-family: var(--serif); font-size: clamp(30px, 3vw, 44px); font-weight: 400; line-height: 1.05; }
.footer-cta p { margin: 0; font-size: 16px; color: rgba(244,239,230,0.68); max-width: 40ch; }
.footer-side { display: flex; flex-direction: column; gap: 18px; }
.pill-accent { align-self: start; background: var(--accent); color: var(--cream); padding: 16px 30px; border-radius: 999px; font-weight: 700; font-size: 15px; letter-spacing: 0.04em; transition: background 160ms ease, color 160ms ease; }
.pill-accent:hover { background: var(--cream); color: var(--ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; font-size: 14px; letter-spacing: 0.04em; }
.footer-links a { color: rgba(244,239,230,0.7); }
.footer-links a:hover { color: var(--cream); }
.footer-logo { width: 200px; height: auto; opacity: 0.9; }
.copyright { font-size: 13px; color: rgba(244,239,230,0.4); }

.footer--slim .container { padding-top: clamp(44px,5vw,72px); padding-bottom: clamp(44px,5vw,72px); display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }

/* ==========================================================================
   About page
   ========================================================================== */
.page-head { padding-top: clamp(56px, 7vw, 100px); padding-bottom: clamp(32px, 4vw, 56px); }
.page-head h1 { margin: 16px 0 0; font-family: var(--serif); font-size: clamp(44px, 5.2vw, 80px); line-height: 0.98; font-weight: 400; max-width: 20ch; text-wrap: pretty; }
.about-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: clamp(32px, 5vw, 72px); align-items: center; padding-bottom: clamp(48px, 6vw, 88px); }
.about-portrait { aspect-ratio: 1/1; border-radius: 20px; overflow: hidden; background: var(--ink); max-width: 560px; width: 100%; }
.about-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prose--lg { font-size: 19px; line-height: 1.72; gap: 22px; }

.factbox {
  background: var(--panel); border-radius: 18px; padding: clamp(28px, 3vw, 40px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; align-items: start;
  margin-bottom: clamp(56px, 7vw, 104px);
}
.factbox .label { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); }
.factbox p { margin: 6px 0 0; font-size: 17px; line-height: 1.6; color: var(--body); }
.factbox .lg { font-family: var(--serif); font-size: 26px; }
.factbox .stack { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; font-size: 17px; }
.btn-dark { align-self: start; background: var(--ink); color: var(--cream); padding: 14px 26px; border-radius: 999px; font-weight: 700; font-size: 14px; letter-spacing: 0.04em; transition: background 160ms ease; }
.btn-dark:hover { background: var(--accent); color: var(--cream); }

/* ==========================================================================
   Contact page
   ========================================================================== */
.contact-wrap { max-width: 1120px; }
.contact-head h1 { margin: 16px 0 12px; font-family: var(--serif); font-size: clamp(40px, 4.8vw, 68px); line-height: 1; font-weight: 400; max-width: 22ch; text-wrap: pretty; }
.contact-head .lede { margin: 0 0 clamp(36px, 4vw, 56px); font-size: 19px; line-height: 1.65; color: var(--muted); max-width: 52ch; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: clamp(28px, 4vw, 56px); align-items: start; }

.field { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
.field input, .field select, .field textarea {
  font-family: var(--sans); font-size: 16px; font-weight: 400; letter-spacing: normal; text-transform: none;
  color: var(--ink); background: var(--card); border: 1px solid rgba(22,22,15,0.18); border-radius: 10px;
}
.field input, .field select { height: 54px; padding: 0 16px; }
.field select { padding: 0 14px; }
.field textarea { padding: 14px 16px; line-height: 1.55; resize: vertical; }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.contact-form .btn { height: 56px; }

.contact-aside { display: flex; flex-direction: column; gap: 22px; background: var(--panel); border-radius: 18px; padding: 32px; }
.contact-aside .label { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); }
.contact-aside p { margin: 6px 0 0; font-size: 17px; line-height: 1.6; color: var(--body); }
.contact-aside .links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 16px; }
.notice--lg { padding: 36px; }
.notice--lg h2 { margin: 0 0 8px; font-family: var(--serif); font-size: 32px; font-weight: 400; }
.notice--lg p { margin: 0; font-size: 16px; line-height: 1.6; opacity: 0.85; }
.hidden { display: none !important; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .hero { min-height: min(88vh, 720px); }
  .hero__bg { background-position: 74% center; }
  .hero__scrim {
    background: linear-gradient(180deg,
      rgba(244,239,230,0.93) 0%,
      rgba(244,239,230,0.86) 42%,
      rgba(244,239,230,0.72) 100%);
  }
  .hero__inner { padding-top: 44px; padding-bottom: 56px; }
  .hero__form { max-width: 100%; }
  .hero h1 { font-size: clamp(40px, 9vw, 58px); }
  .project-row { grid-template-columns: 40px 1fr; grid-auto-rows: min-content; row-gap: 6px; }
  .project-row .desc { grid-column: 2; }
  .project-row .go { display: none; }
}

@media (max-width: 620px) {
  .container, .site-header { padding-left: 22px; padding-right: 22px; }
  .site-header { padding-top: 14px; padding-bottom: 14px; }
  .nav { gap: 16px; font-size: 12px; }
  .nav .books-link { display: none; }
  .brand { width: 150px; height: 33px; }
}
