/* ==========================================================================
   Michelle Alemi — site stylesheet
   One file, four pages. Edit colours and type in :root and the whole site
   follows. Nothing else in here needs touching day to day.
   ========================================================================== */

/* --- 1. Tokens ----------------------------------------------------------- */

:root {
  /* Colour — warm neutrals with two accents. Change these six lines to
     re-skin the entire site. */
  --bone:      #f6f1e8;  /* page background */
  --paper:     #ece3d5;  /* alternating section background */
  --paper-deep:#e2d7c5;  /* cards on paper, image placeholders */
  --ink:       #2b211c;  /* espresso — headlines and body */
  --ink-soft:  #5f5148;  /* secondary text */
  --sage:      #7d8b73;  /* quiet accent */
  --rust:      #a9502f;  /* loud accent — links, underlines, one button */

  --line:      rgba(43, 33, 28, 0.14);
  --line-firm: rgba(43, 33, 28, 0.26);

  /* Type */
  --display: "Fraunces", "Young Serif", "Instrument Serif", Georgia, serif;
  --sans: "Karla", "Familjen Grotesk", "Nimbus Sans", -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Rhythm */
  --gutter: 24px;
  --max: 1120px;
  --max-prose: 660px;
  --section-y: clamp(72px, 11vw, 140px);

  --radius: 2px;
}

/* --- 2. Reset ------------------------------------------------------------ */

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

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

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.68;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; height: auto; }
button { font: inherit; }

/* Paper grain. Sits above everything, catches no clicks. Lower the opacity
   if it ever reads as noise rather than texture. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.38;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

/* --- 3. Layout ----------------------------------------------------------- */

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

.wrap--prose { max-width: var(--max-prose); }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(48px, 7vw, 88px); }
.section--paper { background: var(--paper); }
.section--ink { background: var(--ink); color: var(--bone); }

.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* --- 4. Type ------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.018em;
  margin: 0 0 0.4em;
  font-variation-settings: "SOFT" 20, "WONK" 1;
}

h1 { font-size: clamp(2.6rem, 7.2vw, 5rem); }
h2 { font-size: clamp(2rem, 4.6vw, 3.1rem); }
h3 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); line-height: 1.2; }
h4 { font-size: 1.1rem; line-height: 1.3; }

p { margin: 0 0 1.15em; max-width: 62ch; }
p:last-child { margin-bottom: 0; }

.lede {
  font-size: clamp(1.1rem, 1.9vw, 1.33rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 54ch;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--sage);
  margin: 0 0 1.4em;
}

.eyebrow--rust { color: var(--rust); }

.pull {
  font-family: var(--display);
  font-size: clamp(1.45rem, 3.1vw, 2.15rem);
  line-height: 1.26;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 24ch;
  margin: 0;
}

.small {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

a { color: var(--rust); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }

.section--ink a { color: var(--bone); }
.section--ink .eyebrow { color: var(--sage); }
.section--ink .lede,
.section--ink .small { color: rgba(246, 241, 232, 0.72); }

/* --- 5. Buttons ---------------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 15px 30px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bone);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.btn:hover { background: var(--rust); border-color: var(--rust); color: var(--bone); }

.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--bone); border-color: var(--ink); }

.btn--light { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.btn--light:hover { background: var(--rust); border-color: var(--rust); color: var(--bone); }

/* A link that behaves like a button's quieter sibling */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--line-firm);
  padding-bottom: 4px;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.link-arrow::after { content: "\2192"; transition: transform 0.18s ease; }
.link-arrow:hover { color: var(--rust); border-color: var(--rust); }
.link-arrow:hover::after { transform: translateX(4px); }

/* --- 6. Header ----------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 241, 232, 0.9);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 70px;
}

.wordmark {
  font-family: var(--display);
  font-size: 1.22rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}

.wordmark span { color: var(--rust); }

.nav { display: flex; align-items: center; gap: 30px; }

.nav a {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding-block: 4px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.nav a:hover { border-color: var(--line-firm); }
.nav a[aria-current="page"] { border-color: var(--rust); color: var(--rust); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-firm);
  border-radius: var(--radius);
  padding: 9px 14px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
}

/* --- 7. Hero ------------------------------------------------------------- */

.hero { padding-block: clamp(64px, 10vw, 128px) clamp(56px, 8vw, 104px); }

.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(36px, 6vw, 76px);
  align-items: center;
}

.hero h1 { margin-bottom: 0.32em; }

.hero__sub { margin-bottom: 2.2em; }

/* --- 8. Images ----------------------------------------------------------- */

/* Drop a real file in /images and swap the <div> for an <img> with the same
   class. The placeholder keeps the layout honest until then. */
.frame {
  position: relative;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.frame--portrait { aspect-ratio: 4 / 5; }
.frame--square   { aspect-ratio: 1 / 1; }
.frame--wide     { aspect-ratio: 16 / 10; }
.frame--tall     { aspect-ratio: 3 / 4; }

.frame img { width: 100%; height: 100%; object-fit: cover; }

.frame__hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 24px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(43, 33, 28, 0.42);
  line-height: 1.7;
}

/* --- 9. Grids and cards -------------------------------------------------- */

.grid { display: grid; gap: clamp(28px, 4vw, 48px); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

.split {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}

.split--flip { grid-template-columns: 1.2fr 0.8fr; }

.card {
  border-top: 1px solid var(--line-firm);
  padding-top: 26px;
}

.card__num {
  font-family: var(--display);
  font-size: 0.9rem;
  color: var(--rust);
  display: block;
  margin-bottom: 14px;
  letter-spacing: 0.04em;
}

.card p { font-size: 0.97rem; color: var(--ink-soft); }

/* Offer / product blocks */
.offer {
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(28px, 4vw, 42px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section--paper .offer { background: var(--bone); }

.offer__tag {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 100px;
  background: var(--paper-deep);
  color: var(--ink-soft);
}

.offer__tag--free { background: var(--sage); color: var(--bone); }
.offer__tag--soon { background: transparent; border: 1px solid var(--line-firm); }

.offer h3 { margin-bottom: 0; }
.offer p { font-size: 0.97rem; color: var(--ink-soft); }
.offer ul { margin: 0; padding-left: 1.1em; color: var(--ink-soft); font-size: 0.95rem; }
.offer li { margin-bottom: 0.4em; }
.offer .btn, .offer .link-arrow { margin-top: auto; align-self: flex-start; }

/* Credibility strip */
.creds {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 40px;
  align-items: baseline;
}

.creds span {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Entry list — used for essays and episodes */
.entries { border-top: 1px solid var(--line); }

.entry {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 28px;
  align-items: baseline;
  padding-block: 26px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.18s ease;
}

.entry:hover { background: rgba(43, 33, 28, 0.035); }
.entry:hover .entry__title { color: var(--rust); }

.entry__meta {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
}

.entry__title {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  line-height: 1.22;
  letter-spacing: -0.015em;
  transition: color 0.18s ease;
}

.entry__note {
  display: block;
  font-size: 0.93rem;
  color: var(--ink-soft);
  margin-top: 8px;
  max-width: 58ch;
}

.entry__go { font-size: 1.1rem; color: var(--ink-soft); }

/* --- 10. Signup form ----------------------------------------------------- */

.signup { max-width: 520px; }

.signup__row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.signup input[type="email"] {
  flex: 1 1 240px;
  min-width: 0;
  font-family: var(--sans);
  font-size: 1rem;
  padding: 15px 16px;
  color: var(--ink);
  background: var(--bone);
  border: 1px solid var(--line-firm);
  border-radius: var(--radius);
}

.signup input[type="email"]:focus {
  outline: none;
  border-color: var(--rust);
  box-shadow: 0 0 0 3px rgba(169, 80, 47, 0.14);
}

.signup input::placeholder { color: rgba(43, 33, 28, 0.42); }

.signup__note { margin-top: 14px; font-size: 0.82rem; color: var(--ink-soft); }

.section--ink .signup input[type="email"] {
  background: rgba(246, 241, 232, 0.07);
  border-color: rgba(246, 241, 232, 0.26);
  color: var(--bone);
}
.section--ink .signup input::placeholder { color: rgba(246, 241, 232, 0.5); }
.section--ink .signup__note { color: rgba(246, 241, 232, 0.6); }

/* --- 11. Footer ---------------------------------------------------------- */

.site-footer {
  background: var(--ink);
  color: var(--bone);
  padding-block: clamp(56px, 7vw, 88px) 36px;
}

.site-footer a { color: var(--bone); text-decoration: none; }
.site-footer a:hover { color: var(--rust); }

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 44px;
}

.site-footer h4 {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 1.2em;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.7em; font-size: 0.93rem; }

.site-footer__base {
  border-top: 1px solid rgba(246, 241, 232, 0.16);
  padding-top: 26px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: rgba(246, 241, 232, 0.6);
}

.site-footer .wordmark { color: var(--bone); font-size: 1.5rem; }

/* --- 12. Page header (interior pages) ------------------------------------ */

.page-head { padding-block: clamp(56px, 8vw, 104px) clamp(36px, 5vw, 60px); }
.page-head h1 { max-width: 16ch; }
.page-head .lede { margin-top: 1.1em; }

/* --- 13. Responsive ------------------------------------------------------ */

@media (max-width: 900px) {
  .hero__grid,
  .split,
  .split--flip,
  .grid--2,
  .grid--3 { grid-template-columns: 1fr; }

  .hero__media { max-width: 420px; }

  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bone);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
  }

  .nav.is-open { display: flex; }

  .nav a {
    width: 100%;
    padding-block: 14px;
    border-bottom: 1px solid var(--line);
  }

  .nav a:last-child { border-bottom: 0; }
  .nav a[aria-current="page"] { border-color: var(--line); }

  .nav-toggle { display: block; }
  .site-header__inner { position: relative; }

  .entry { grid-template-columns: 1fr; gap: 10px; }
  .entry__go { display: none; }

  body { font-size: 16px; }
}

@media (max-width: 460px) {
  :root { --gutter: 20px; }
  .signup__row { flex-direction: column; }
  /* flex-basis applies to height once the row stacks — reset it or the
     input grows to 240px tall */
  .signup input[type="email"] { flex: 0 0 auto; width: 100%; }
  .signup .btn { width: 100%; text-align: center; }
  .site-footer__grid { grid-template-columns: 1fr; }
}

/* --- 14. Accessibility --------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bone);
  padding: 12px 20px;
  z-index: 200;
}

.skip:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
