/* ===========================================================
   Randall Ettinger — shared stylesheet
   Plain static CSS. No framework, no build step.
   =========================================================== */

:root {
  --bg:        #0c0d10;
  --bg-elev:   #131519;
  --bg-card:   #15171c;
  --fg:        #f3efe9;
  --muted:     #a0a4ad;
  --muted-2:   #6d727b;
  --accent:    #e07a4f;
  --accent-2:  #ef8d62;
  --line:      rgba(243, 239, 233, 0.12);
  --line-soft: rgba(243, 239, 233, 0.07);

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --wrap: 68rem;
  --section-y: clamp(4.5rem, 10vw, 9rem);
}

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

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* subtle warm glow at the top of the page */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 60vh;
  background: radial-gradient(60% 70% at 50% -10%, rgba(224, 122, 79, 0.10), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.04;
  color: var(--fg);
}

h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }

p { color: var(--muted); }
a { color: inherit; text-decoration: none; }

.eyebrow {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.lead {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--muted);
  max-width: 42rem;
}

.accent { color: var(--accent); }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.95rem 1.7rem;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: #12130f;
}
.btn-primary:hover { background: var(--accent-2); }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 13, 16, 0.72);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--fg);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.9rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-block: 0.2rem;
  position: relative;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--fg); }

.nav-links a.active { color: var(--fg); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -0.35rem;
  height: 2px;
  background: var(--accent);
}

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

main { position: relative; z-index: 1; }

.section { padding-block: var(--section-y); }
.section + .section { border-top: 1px solid var(--line-soft); }

.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head .eyebrow { display: block; margin-bottom: 1rem; }

/* Hero */
.hero {
  min-height: min(88vh, 46rem);
  display: flex;
  align-items: center;
  padding-block: clamp(5rem, 12vh, 9rem) var(--section-y);
}

/* Full-bleed photo hero (home) */
.hero--photo {
  position: relative;
  isolation: isolate;
  min-height: min(92vh, 52rem);
  margin-top: -1px; /* tuck under the sticky header */
  padding-block: clamp(6rem, 14vh, 11rem) clamp(4rem, 9vh, 7rem);
  background-image: url("/images/terrace.webp");
  background-size: cover;
  background-position: center 42%;
  background-repeat: no-repeat;
}
/* legibility scrim: dark at left + bottom, clearing toward the ocean */
.hero--photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg,
      rgba(9, 10, 13, 0.88) 0%,
      rgba(9, 10, 13, 0.62) 30%,
      rgba(9, 10, 13, 0.20) 58%,
      rgba(9, 10, 13, 0.00) 85%),
    linear-gradient(0deg,
      rgba(9, 10, 13, 0.80) 0%,
      rgba(9, 10, 13, 0.12) 34%,
      rgba(9, 10, 13, 0.00) 60%);
}
.hero--photo .lead { color: #d9dadf; }
.hero .eyebrow { display: block; margin-bottom: 1.6rem; }
.hero h1 {
  font-size: clamp(3rem, 9.5vw, 6.5rem);
  margin-bottom: 1.6rem;
}
.hero .lead { margin-bottom: 2.6rem; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

/* "How I work" cards */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 2rem 1.8rem;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.card:hover { border-color: var(--line); transform: translateY(-3px); }
.card .num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 1.1rem;
}
.card h3 { margin-bottom: 0.7rem; }
.card p { font-size: 0.98rem; }

/* Generic note / empty state */
.note {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: clamp(2rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.8rem;
}
.note .eyebrow { margin-bottom: 0.2rem; }
.note p { max-width: 36rem; }

/* Closing CTA band */
.cta-band { text-align: center; }
.cta-band h2 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: 1.4rem; }
.cta-band p { margin: 0 auto 2.4rem; max-width: 34rem; }

/* ----------------------------- Quotes / aphorisms ------------------------- */

/* Centered quote band (Home, Contact) */
.quote-band { text-align: center; }
.quote-band .mark {
  display: block;
  width: 2.5rem;
  height: 2px;
  background: var(--accent);
  margin: 0 auto 1.9rem;
}
.quote-band blockquote {
  max-width: 46rem;
  margin: 0 auto;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 3.1vw, 2.2rem);
  line-height: 1.32;
  letter-spacing: -0.015em;
  color: var(--fg);
}

/* Pull-quote inside prose (About) */
.pullquote {
  margin: 2.6rem 0;
  padding: 0.1rem 0 0.1rem 1.5rem;
  border-left: 3px solid var(--accent);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  line-height: 1.36;
  letter-spacing: -0.01em;
  color: var(--fg);
}

/* Epigraph (Blog) */
.epigraph {
  max-width: 42rem;
  margin: -0.4rem 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-style: normal;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.42;
  letter-spacing: -0.01em;
  color: var(--muted);
}

/* ----------------------------- Prose (About / posts) ---------------------- */

.prose { max-width: 42rem; }
.prose p { color: var(--muted); margin-bottom: 1.3rem; font-size: 1.08rem; }
.prose p.first {
  color: var(--fg);
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
}
.prose h2 { margin: 2.6rem 0 1.1rem; font-size: clamp(1.4rem, 3vw, 1.9rem); }
.prose strong { color: var(--fg); font-weight: 600; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* Credentials list */
.facts { list-style: none; margin-top: 2.6rem; max-width: 46rem; }
.facts li {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1.5rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--line-soft);
}
.facts li:last-child { border-bottom: 1px solid var(--line-soft); }
.facts .k {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 0.15rem;
}
.facts .v { color: var(--muted); font-size: 1rem; }
.facts .v strong { color: var(--fg); font-weight: 600; }

/* ----------------------------- Blog index --------------------------------- */

.post-list { list-style: none; max-width: 48rem; }
.post-list li { border-top: 1px solid var(--line-soft); }
.post-list li:last-child { border-bottom: 1px solid var(--line-soft); }
.post-list a {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1.5rem;
  padding: 1.8rem 0;
  align-items: start;
  transition: color 0.2s ease;
}
.post-list a:hover .post-title { color: var(--accent); }
.post-list .post-date {
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  padding-top: 0.3rem;
}
.post-body { display: flex; flex-direction: column; gap: 0.45rem; }
.post-list .post-title { font-family: var(--font-display); font-weight: 500; font-size: 1.2rem; line-height: 1.25; color: var(--fg); transition: color 0.2s ease; }
.post-list .post-excerpt { color: var(--muted); font-size: 0.98rem; line-height: 1.55; max-width: 38rem; }

/* Single post */
.post-header { max-width: 42rem; margin-bottom: 2.6rem; }
.post-header .post-meta {
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  display: block;
  margin-bottom: 1.1rem;
}
.post-header h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.back-link {
  display: inline-block;
  margin-top: 3rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }

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

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding-block: 2.6rem;
  position: relative;
  z-index: 1;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  align-items: center;
  font-size: 0.86rem;
  color: var(--muted-2);
}
.footer-inner .sep { color: var(--line); }
.footer-inner a { color: var(--muted); transition: color 0.2s ease; }
.footer-inner a:hover { color: var(--accent); }

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

@media (max-width: 640px) {
  .nav { justify-content: center; text-align: center; }
  .nav-links { gap: 1.3rem; }
  /* full-width text on phones sits over more of the photo — darken the scrim */
  .hero--photo { background-position: center 35%; }
  .hero--photo::before {
    background:
      linear-gradient(0deg,
        rgba(9, 10, 13, 0.88) 0%,
        rgba(9, 10, 13, 0.40) 46%,
        rgba(9, 10, 13, 0.10) 74%,
        rgba(9, 10, 13, 0.00) 100%),
      linear-gradient(90deg,
        rgba(9, 10, 13, 0.82) 0%,
        rgba(9, 10, 13, 0.45) 55%,
        rgba(9, 10, 13, 0.18) 100%);
  }
  .cards { grid-template-columns: 1fr; }
  .facts li { grid-template-columns: 1fr; gap: 0.35rem; }
  .facts .k { padding-top: 0; }
  .post-list a { grid-template-columns: 1fr; gap: 0.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
