/* =========================================================================
   davidfeldt.com, design system
   "Founder documentary universe": cinematic, warm, editorial, intelligent.
   Netflix doc meets Monocle. Mexico-dusk palette.
   ========================================================================= */

:root {
  /* Surfaces */
  --warm-black:   #15110E;
  --ink:          #110D0A;
  --panel:        #1C1611;
  --panel-2:      #241C16;
  --navy:         #13243F;
  --navy-soft:    #18293f;

  /* Accents */
  --terracotta:   #C0623C;
  --terracotta-2: #D67A4E;
  --gold:         #C9A24B;
  --gold-soft:    #D8B868;
  --dusk:         #E0894B;

  /* Text */
  --cream:        #ECE4D6;
  --cream-dim:    #CFC6B6;
  --muted:        #A0937F;
  --muted-2:      #786E60;
  --line:         rgba(236,228,214,0.12);
  --line-strong:  rgba(236,228,214,0.22);

  /* Type */
  --display: "Oswald", "Arial Narrow", sans-serif;
  --ui:      "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --serif:   "Spectral", Georgia, "Times New Roman", serif;

  /* Rhythm */
  --maxw: 1200px;
  --readw: 720px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--warm-black);
  color: var(--cream);
  font-family: var(--ui);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-soft); text-decoration: none; transition: color .25s var(--ease); }
a:hover { color: var(--terracotta-2); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.02; margin: 0 0 .4em; letter-spacing: .01em; }
p { margin: 0 0 1.1em; }
hr { border: none; border-top: 1px solid var(--line); margin: 3rem 0; }

::selection { background: var(--terracotta); color: #fff; }

/* ---------- layout helpers ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.narrow { max-width: 860px; }
.section { padding-block: clamp(64px, 9vw, 140px); }
.section--tight { padding-block: clamp(48px, 6vw, 90px); }
.center { text-align: center; }
.eyebrow {
  font-family: var(--ui);
  font-size: 12.5px; font-weight: 600;
  letter-spacing: .28em; text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1.1rem;
  display: inline-flex; align-items: center;
}
.lede { font-family: var(--serif); font-size: clamp(1.15rem, 2.2vw, 1.4rem); color: var(--cream-dim); line-height: 1.55; }

/* dotted/dusk background texture */
.bg-texture { position: relative; }
.bg-texture::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(192,98,60,0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(19,36,63,0.55), transparent 60%);
}
.bg-texture > * { position: relative; }

/* ===========================================================
   NAV
   =========================================================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  transition: background .4s var(--ease), padding .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: rgba(17,13,10,0.82);
  backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid var(--line);
  padding-block: 12px;
}
.nav__brand {
  font-family: var(--display); font-weight: 700; font-size: 1.25rem;
  letter-spacing: .04em; color: var(--cream); text-transform: uppercase;
}
.nav__brand:hover { color: var(--cream); }
.nav__brand span { color: var(--terracotta-2); }
.nav__links { display: flex; align-items: center; gap: 28px; }
.nav__links a {
  font-size: 14px; font-weight: 500; letter-spacing: .04em;
  color: var(--cream-dim); text-transform: uppercase;
  position: relative;
}
.nav__links a:hover { color: var(--cream); }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1px; width: 0;
  background: var(--terracotta-2); transition: width .3s var(--ease);
}
.nav__links a:hover::after, .nav__links a.is-active::after { width: 100%; }
.nav__cta {
  border: 1px solid var(--line-strong); padding: 9px 18px; border-radius: 100px;
  color: var(--cream) !important; font-size: 13px;
}
.nav__cta:hover { background: var(--terracotta); border-color: var(--terracotta); }
.nav__toggle { display: none; background: none; border: 0; color: var(--cream); cursor: pointer; }

/* ===========================================================
   HERO, showcases the cinematic banner (text is baked into it)
   =========================================================== */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hero {
  position: relative; overflow: hidden;
  padding: clamp(120px, 16vh, 190px) 0 clamp(70px, 9vh, 120px);
  background:
    radial-gradient(70% 60% at 50% 0%, #1d1812 0%, var(--warm-black) 70%);
}
.hero__glow {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 360px at 78% 22%, rgba(192,98,60,0.16), transparent 60%),
    radial-gradient(800px 420px at 12% 78%, rgba(19,36,63,0.5), transparent 60%);
}
.hero__inner { position: relative; z-index: 2; }
.hero__banner {
  margin: 0; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 50px 120px -50px rgba(0,0,0,0.85), 0 0 0 1px rgba(0,0,0,0.3);
}
.hero__banner img { width: 100%; height: auto; display: block; }
.hero__cta {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
  margin-top: clamp(28px, 4vw, 44px);
}
.hero__scroll {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 2; color: var(--muted); font-size: 11px; letter-spacing: .25em;
  text-transform: uppercase; display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: floaty 2.4s ease-in-out infinite;
}
.hero__scroll span { width: 1px; height: 30px; background: linear-gradient(var(--gold), transparent); }
@keyframes floaty { 0%,100%{ transform: translate(-50%,0);} 50%{ transform: translate(-50%,6px);} }
@media (max-width: 620px) { .hero__scroll { display: none; } }

/* ===========================================================
   BUTTONS
   =========================================================== */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--ui); font-weight: 600; font-size: 14px;
  letter-spacing: .04em; padding: 13px 24px; border-radius: 100px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--terracotta); color: #fff; }
.btn--primary:hover { background: var(--terracotta-2); color: #fff; }
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: var(--gold-soft); color: var(--ink); }
.btn--ghost { border-color: var(--line-strong); color: var(--cream); }
.btn--ghost:hover { border-color: var(--gold); color: var(--cream); background: rgba(201,162,75,0.08); }
.btn .arw { transition: transform .25s var(--ease); }
.btn:hover .arw { transform: translateX(3px); }
.btn--block { width: 100%; justify-content: center; }

/* ===========================================================
   SECTION HEADERS
   =========================================================== */
.shead { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: clamp(28px, 4vw, 52px); flex-wrap: wrap; }
.shead__title { font-size: clamp(2rem, 5vw, 3.4rem); text-transform: uppercase; color: var(--cream); max-width: 18ch; }
.shead__title em { font-style: normal; color: var(--terracotta-2); }
.shead p { color: var(--muted); max-width: 42ch; margin: 0; }
.link-more { font-family: var(--ui); font-weight: 600; font-size: 14px; letter-spacing: .05em; text-transform: uppercase; color: var(--gold); white-space: nowrap; }

/* ===========================================================
   ARTICLE CARDS (Field Notes)
   =========================================================== */
.cards { display: grid; gap: clamp(20px, 2.5vw, 34px); }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
.cards--2 { grid-template-columns: repeat(2, 1fr); }

.acard {
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .4s var(--ease), border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.acard:hover { transform: translateY(-5px); border-color: var(--line-strong); box-shadow: 0 30px 60px -30px rgba(0,0,0,0.7); }
.acard__media { aspect-ratio: 16/10; overflow: hidden; background: var(--panel-2); position: relative; }
.acard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.acard:hover .acard__media img { transform: scale(1.05); }
.acard__media--ph { display: grid; place-items: center; background:
  radial-gradient(120% 120% at 20% 10%, var(--navy-soft), var(--panel-2)); }
.acard__body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.acard__cat {
  font-size: 11.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--terracotta-2); margin-bottom: 12px;
}
.acard__title { font-family: var(--display); font-weight: 600; font-size: 1.5rem; line-height: 1.05; color: var(--cream); margin: 0 0 .5rem; }
.acard:hover .acard__title { color: #fff; }
.acard__excerpt { font-family: var(--serif); font-size: .98rem; color: var(--cream-dim); margin: 0 0 18px; }
.acard__meta { margin-top: auto; font-size: 12.5px; color: var(--muted); letter-spacing: .04em; display: flex; gap: 14px; }

/* feature row (homepage hero article) */
.feature {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.feature__media { aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; background:
  radial-gradient(120% 120% at 20% 10%, var(--navy-soft), var(--panel-2)); border: 1px solid var(--line); }
.feature__media img { width: 100%; height: 100%; object-fit: cover; }
.feature h3 { font-size: clamp(1.8rem, 4vw, 3rem); text-transform: none; }

/* ===========================================================
   PROJECTS
   =========================================================== */
.pcard {
  position: relative; display: block; padding: 34px 30px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .4s var(--ease), border-color .4s var(--ease);
}
.pcard::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--terracotta); transform: scaleY(0); transform-origin: top; transition: transform .4s var(--ease);
}
.pcard:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.pcard:hover::after { transform: scaleY(1); }
.pcard__name { font-family: var(--display); font-weight: 600; font-size: 1.7rem; color: var(--cream); margin: 0 0 .35rem; text-transform: uppercase; letter-spacing: .02em; }
.pcard__tag { font-family: var(--serif); color: var(--cream-dim); margin: 0 0 1.2rem; }
.pcard__cta { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); display: inline-flex; gap: .5em; }
.pcard:hover .pcard__cta { color: var(--gold-soft); }

/* ===========================================================
   NEWSLETTER
   =========================================================== */
.news {
  background:
    radial-gradient(900px 400px at 80% 0%, rgba(192,98,60,0.18), transparent 60%),
    linear-gradient(180deg, var(--navy), var(--ink));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.news__inner { max-width: 760px; margin: 0 auto; text-align: center; }
.news h2 { font-size: clamp(2rem, 5vw, 3.4rem); text-transform: uppercase; color: var(--cream); }
.news p { color: var(--cream-dim); font-family: var(--serif); font-size: 1.1rem; }
.news__form { display: flex; gap: 10px; max-width: 460px; margin: 28px auto 12px; }
.news__form input[type=email] {
  flex: 1; background: rgba(0,0,0,0.3); border: 1px solid var(--line-strong);
  color: var(--cream); padding: 14px 18px; border-radius: 100px; font-family: var(--ui); font-size: 15px;
}
.news__form input::placeholder { color: var(--muted); }
.news__form input:focus { outline: none; border-color: var(--gold); }
.news__note { font-size: 12.5px; color: var(--muted); letter-spacing: .03em; }
.news__msg { min-height: 1.4em; margin-top: 12px; font-size: 14px; font-weight: 500; }
.news__msg.ok { color: #7FB08A; }
.news__msg.err { color: var(--terracotta-2); }

/* ===========================================================
   NOW / EDITORIAL PROSE
   =========================================================== */
.prose { font-family: var(--serif); font-size: 1.18rem; line-height: 1.75; color: var(--cream-dim); max-width: var(--readw); }
.prose h2 { font-family: var(--display); color: var(--cream); font-size: 1.9rem; margin-top: 2.2em; text-transform: uppercase; }
.prose h3 { font-family: var(--display); color: var(--cream); font-size: 1.4rem; margin-top: 1.8em; }
.prose a { color: var(--gold-soft); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(201,162,75,0.4); }
.prose blockquote { border-left: 3px solid var(--terracotta); margin: 1.6em 0; padding: .2em 0 .2em 1.4em; color: var(--cream); font-style: italic; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .5em; }
.prose img { border-radius: var(--radius); margin: 2em 0; border: 1px solid var(--line); }
.prose code { background: var(--panel-2); padding: .15em .45em; border-radius: 3px; font-size: .9em; }

.now-list { list-style: none; padding: 0; margin: 0; }
.now-list li {
  font-family: var(--serif); font-size: 1.25rem; color: var(--cream);
  padding: 16px 0 16px 34px; border-bottom: 1px solid var(--line); position: relative;
}
.now-list li::before { content: "→"; position: absolute; left: 0; color: var(--terracotta-2); }

/* ===========================================================
   ARTICLE PAGE
   =========================================================== */
.post-hero { padding: 150px 0 0; }
.post-meta { display: flex; gap: 16px; align-items: center; color: var(--muted); font-size: 13px; letter-spacing: .04em; margin-bottom: 1.4rem; }
.post-cat { color: var(--terracotta-2); font-weight: 700; text-transform: uppercase; letter-spacing: .16em; }
.post-title { font-size: clamp(2.2rem, 6vw, 4.2rem); line-height: .98; text-transform: none; color: var(--cream); margin-bottom: 1.2rem; }
.post-dek { font-family: var(--serif); font-size: 1.3rem; color: var(--cream-dim); font-style: italic; max-width: var(--readw); }
.post-cover { margin: 48px 0; aspect-ratio: 21/9; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-body { padding-bottom: 40px; }
/* Hairline delimiter between the excerpt/dek and the body copy. */
.post-body .prose {
  border-top: 1px solid var(--line);
  margin-top: clamp(30px, 4vw, 44px);
  padding-top: clamp(30px, 4vw, 44px);
}

/* ===========================================================
   CHIPS / FILTER
   =========================================================== */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.chip {
  font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 8px 16px; border-radius: 100px; border: 1px solid var(--line-strong); color: var(--cream-dim);
}
.chip:hover, .chip.is-active { background: var(--terracotta); border-color: var(--terracotta); color: #fff; }

/* ===========================================================
   MEDIA LIST
   =========================================================== */
.media-row {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 24px; align-items: center;
  padding: 24px 0; border-bottom: 1px solid var(--line);
}
.media-row .mtype { font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.media-row h3 { font-family: var(--display); font-size: 1.35rem; margin: 0 0 .25rem; text-transform: none; color: var(--cream); }
.media-row p { margin: 0; color: var(--muted); font-size: .95rem; }
.media-empty { color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 1.15rem; }

/* ===========================================================
   FOOTER
   =========================================================== */
.foot { background: var(--ink); border-top: 1px solid var(--line); padding-block: 64px 40px; }
.foot__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.foot__brand { font-family: var(--display); font-weight: 700; font-size: 1.6rem; text-transform: uppercase; color: var(--cream); letter-spacing: .03em; }
.foot__brand span { color: var(--terracotta-2); }
.foot p { color: var(--muted); font-size: .95rem; max-width: 36ch; }
.foot h4 { font-family: var(--ui); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 16px; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.foot ul a { color: var(--cream-dim); font-size: 14.5px; }
.foot ul a:hover { color: var(--cream); }
.foot__bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--muted-2); font-size: 13px; }

/* ===========================================================
   MOTION
   =========================================================== */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__scroll { animation: none; }
  html { scroll-behavior: auto; }
}

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 900px) {
  .cards--3, .cards--2 { grid-template-columns: 1fr 1fr; }
  .feature { grid-template-columns: 1fr; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
  .nav__links { display: none; }
  .nav__toggle { display: inline-flex; }
  .nav.is-open .nav__links {
    display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column;
    background: rgba(17,13,10,0.97); backdrop-filter: blur(14px); padding: 22px var(--gutter); gap: 18px;
    border-bottom: 1px solid var(--line);
  }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .cards--3, .cards--2 { grid-template-columns: 1fr; }
  .foot__grid { grid-template-columns: 1fr; }
  .news__form { flex-direction: column; }
  .news__form input[type=email] { width: 100%; }
  .media-row { grid-template-columns: 1fr; gap: 8px; }
  .hero { padding-bottom: 48px; }
}
