/* The Sleeping Edit stylesheet */

:root {
  --ivory:      #F5F0E8;
  --ivory-warm: #EFE8DC;
  --sage:       #4A5240;
  --sage-mid:   #6F7A62;
  --sage-pale:  #DCE0D4;
  --ink:        #2B2B27;
  --muted:      #6B6B61;
  --rule:       #DED6C7;

  --serif:  'Cormorant Garamond', 'Hoefler Text', Georgia, serif;
  --accent: 'Playfair Display', Georgia, serif;
  --sans:   'Montserrat', 'Helvetica Neue', Arial, sans-serif;

  --max: 1120px;
  --measure: 680px;
}

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

html { scroll-behavior: smooth; }

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

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

a { color: var(--sage); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 32px; }
.narrow { max-width: var(--measure); margin-left: auto; margin-right: auto; }

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--sage);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}

h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }

.subhead {
  font-family: var(--accent);
  font-style: italic;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  color: var(--sage-mid);
  line-height: 1.5;
  margin: 0 0 32px;
}

p { margin: 0 0 22px; }
p.lead { font-size: 1.12rem; color: var(--ink); }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage-mid);
  margin: 0 0 18px;
}

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

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--ivory);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 22px;
  padding-bottom: 22px;
}

.logo {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--sage);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.logo:hover { text-decoration: none; }

.nav {
  display: flex;
  gap: 34px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.nav a { color: var(--muted); }
.nav a:hover, .nav a.is-active { color: var(--sage); text-decoration: none; }
.nav a.is-active { border-bottom: 1px solid var(--sage); padding-bottom: 2px; }

/* ---------- Hero ---------- */

.hero { padding: clamp(72px, 12vw, 140px) 0 clamp(60px, 9vw, 110px); }
.hero h1 { max-width: 15ch; }
.hero .subhead { max-width: 44ch; }

/* ---------- Image hero with overlaid text ---------- */

.hero-image {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 78vh;
  background-color: var(--sage);
  background-image:
    linear-gradient(to top, rgba(26,24,20,0.74) 0%, rgba(26,24,20,0.20) 52%, rgba(26,24,20,0.24) 100%),
    url('../images/hero.jpg'),
    linear-gradient(145deg, #6F7A62 0%, #4A5240 55%, #343A2C 100%);
  background-size: cover;
  background-position: 65% 35%;
  background-repeat: no-repeat;
}

/* Home page sits at root, so its path has no ../ */
.hero-image.at-root {
  background-image:
    linear-gradient(to top, rgba(26,24,20,0.74) 0%, rgba(26,24,20,0.20) 52%, rgba(26,24,20,0.24) 100%),
    url('images/hero.jpg'),
    linear-gradient(145deg, #6F7A62 0%, #4A5240 55%, #343A2C 100%);
}

.hero-image .wrap {
  padding-top: 72px;
  padding-bottom: clamp(48px, 7vw, 88px);
  width: 100%;
}

.hero-image .eyebrow { color: var(--sage-pale); }

.hero-image h1 {
  color: #FBF8F2;
  max-width: 16ch;
  margin-bottom: 18px;
  text-shadow: 0 1px 24px rgba(0,0,0,0.3);
}

.hero-image .subhead {
  color: #EFEADF;
  max-width: 42ch;
  margin-bottom: 34px;
  text-shadow: 0 1px 18px rgba(0,0,0,0.35);
}

.hero-image .btn {
  background: #FBF8F2;
  color: var(--sage);
  border-color: #FBF8F2;
}
.hero-image .btn:hover { background: transparent; color: #FBF8F2; }

.hero-image .btn-ghost {
  background: transparent;
  color: #FBF8F2;
  border-color: rgba(251,248,242,0.6);
}
.hero-image .btn-ghost:hover { background: #FBF8F2; color: var(--sage); }

/* Shorter version for inner pages */
.hero-image.is-short {
  min-height: 46vh;
  align-items: flex-end;
}
.hero-image.is-short h1 { max-width: 20ch; }

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

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 16px 32px;
  background: var(--sage);
  color: var(--ivory);
  border: 1px solid var(--sage);
  transition: background 0.2s ease, color 0.2s ease;
}
.btn:hover { background: transparent; color: var(--sage); text-decoration: none; }

.btn-ghost { background: transparent; color: var(--sage); }
.btn-ghost:hover { background: var(--sage); color: var(--ivory); }

.btn-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }

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

section { padding: clamp(56px, 8vw, 96px) 0; }
.band { background: var(--ivory-warm); }
.band-sage { background: var(--sage); color: var(--ivory-warm); }
.band-sage h2, .band-sage h3 { color: var(--ivory); }
.band-sage .subhead { color: var(--sage-pale); }
.band-sage a { color: var(--ivory); border-bottom: 1px solid var(--sage-pale); }

.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

/* ---------- Grid of three ---------- */

.trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  margin-top: 56px;
}
.trio .num {
  font-family: var(--accent);
  font-style: italic;
  font-size: 1.6rem;
  color: var(--sage-mid);
  display: block;
  margin-bottom: 14px;
}
.trio h3 { margin-bottom: 12px; }
.trio p { color: var(--muted); margin: 0; font-size: 0.97rem; }

/* ---------- Article list ---------- */

.post-list { margin-top: 48px; border-top: 1px solid var(--rule); }

.post {
  display: block;
  padding: 34px 0;
  border-bottom: 1px solid var(--rule);
}
.post:hover { text-decoration: none; }
.post:hover h3 { color: var(--sage-mid); }
.post .meta {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage-mid);
  margin-bottom: 10px;
}
.post h3 { margin-bottom: 10px; transition: color 0.2s ease; }
.post p { color: var(--muted); margin: 0; max-width: 62ch; font-size: 0.97rem; }
.post.is-soon { opacity: 0.55; pointer-events: none; }

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

.pull {
  font-family: var(--accent);
  font-style: italic;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.45;
  color: var(--sage);
  border-left: 2px solid var(--sage-mid);
  padding-left: 32px;
  margin: 56px 0;
  max-width: 34ch;
}

/* ---------- Prose (article body) ---------- */

.prose { max-width: var(--measure); }
.prose h2 { margin-top: 56px; }
.prose h3 { margin-top: 40px; }
.prose ul, .prose ol { padding-left: 24px; margin: 0 0 22px; }
.prose li { margin-bottom: 10px; }
.prose .note {
  background: var(--ivory-warm);
  border-left: 2px solid var(--sage-mid);
  padding: 24px 28px;
  margin: 40px 0;
  font-size: 0.97rem;
}
.prose .note p:last-child { margin: 0; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 64px 0 48px;
  font-size: 0.88rem;
  color: var(--muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.site-footer h4 {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 16px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 10px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--sage); }
.footer-base {
  border-top: 1px solid var(--rule);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.78rem;
}
.disclaimer { max-width: 46ch; font-size: 0.82rem; line-height: 1.6; }

/* ---------- Form ---------- */

.form { max-width: 520px; margin-top: 40px; }
.field { margin-bottom: 24px; }
.field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 8px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--sans);
  font-size: 0.97rem;
  color: var(--ink);
  background: #FFFDF9;
  border: 1px solid var(--rule);
  border-radius: 0;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--sage-mid);
}
.field textarea { min-height: 150px; resize: vertical; }

/* ---------- Anchor offset for sticky header ---------- */

section[id], div[id].anchor { scroll-margin-top: 110px; }

/* ---------- Intro: photo + text side by side ---------- */

.intro {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 64px;
  align-items: start;
}

.portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--sage-pale);
  overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }

/* Shown only when no <img> has been added yet */
.portrait-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 24px;
  border: 1px solid var(--rule);
}
.portrait-empty .mono {
  font-family: var(--serif);
  font-size: 3.4rem;
  color: var(--sage);
  line-height: 1;
  margin-bottom: 14px;
}
.portrait-empty span {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage-mid);
  line-height: 1.7;
}

.intro .credential {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage-mid);
  margin: -8px 0 28px;
}

/* ---------- Claim / challenge blocks ---------- */

.claim {
  border-top: 2px solid var(--sage);
  padding-top: 26px;
  margin: 56px 0 0;
}
.claim .said {
  font-family: var(--accent);
  font-style: italic;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  line-height: 1.45;
  color: var(--sage);
  margin: 0 0 26px;
  max-width: 40ch;
}
.claim h4 {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage-mid);
  margin: 30px 0 12px;
}
.claim h4:first-of-type { margin-top: 0; }

/* ---------- Citation markers and reference list ---------- */

a.cite {
  font-size: 0.72em;
  vertical-align: super;
  line-height: 0;
  font-weight: 600;
  color: var(--sage-mid);
  text-decoration: none;
  padding: 0 1px;
}
a.cite:hover { color: var(--sage); text-decoration: underline; }

.refs {
  counter-reset: ref;
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  font-size: 0.9rem;
  line-height: 1.6;
}
.refs li {
  counter-increment: ref;
  position: relative;
  padding: 14px 0 14px 40px;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
}
.refs li:last-child { border-bottom: 0; }
.refs li::before {
  content: counter(ref) ".";
  position: absolute;
  left: 0;
  top: 14px;
  font-weight: 600;
  color: var(--sage);
}
.refs li em { color: var(--ink); }
.refs .verdict {
  display: block;
  margin-top: 6px;
  font-size: 0.86rem;
  color: var(--sage-mid);
}

/* ---------- Tidy bullet list ---------- */

ul.tidy {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  max-width: 54ch;
}
ul.tidy li {
  position: relative;
  padding: 12px 0 12px 26px;
  border-bottom: 1px solid var(--rule);
  font-size: 1.02rem;
}
ul.tidy li:last-child { border-bottom: 0; }
ul.tidy li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 21px;
  width: 7px;
  height: 7px;
  background: var(--sage-mid);
  border-radius: 50%;
}

/* ---------- Plain scannable list ---------- */

.plain-list {
  font-family: var(--accent);
  font-style: italic;
  font-size: clamp(1.15rem, 2.3vw, 1.55rem);
  line-height: 1.6;
  color: var(--sage);
  max-width: 50ch;
  margin: 0 0 32px;
}

/* ---------- Personal / lively block ---------- */

.personal {
  background: var(--ivory-warm);
  border-left: 2px solid var(--sage-mid);
  padding: 32px 36px;
  margin: 48px 0 0;
  max-width: 62ch;
}
.personal p:last-child { margin: 0; }

/* ---------- Numeric punch line ---------- */

.punch {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1.3;
  color: var(--sage);
  margin: 48px 0;
  max-width: 30ch;
}
.punch em {
  font-family: var(--accent);
  font-style: italic;
  color: var(--sage-mid);
}

/* ---------- Email-first contact block ---------- */

.email-block { margin: 36px 0 8px; }
.email-block a {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.6vw, 2.2rem);
  color: var(--sage);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 4px;
}
.email-block a:hover { text-decoration: none; border-color: var(--sage); }

.toggle-form {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sage-mid);
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--sans);
  margin-top: 8px;
}
.toggle-form:hover { color: var(--sage); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .trio { grid-template-columns: 1fr; gap: 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .intro { grid-template-columns: 1fr; gap: 40px; }
  .portrait { max-width: 260px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .wrap { padding: 0 22px; }
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 14px; }
  .nav { gap: 20px; flex-wrap: wrap; font-size: 0.74rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 36px; }
  .pull { padding-left: 22px; margin: 40px 0; }
  .personal { padding: 24px 24px; }
  section[id] { scroll-margin-top: 150px; }
}
