/* writing.html — externalized from inline <style>. */


    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
    body { font-family: var(--font-body); background: var(--ivory); color: var(--slate); line-height: 1.65; overflow-x: hidden; }
    a { color: inherit; text-decoration: none; }

    /* ══ SCROLL REVEAL ══ */
    .reveal {
      opacity: 0;
      transform: translateY(24px);
      transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                  transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .reveal.visible { opacity: 1; transform: translateY(0); }
    .reveal-delay-1 { transition-delay: 0.08s; }
    .reveal-delay-2 { transition-delay: 0.16s; }
    .reveal-delay-3 { transition-delay: 0.24s; }
    .reveal-delay-4 { transition-delay: 0.32s; }
    .reveal-delay-5 { transition-delay: 0.40s; }
    .reveal-delay-6 { transition-delay: 0.48s; }
    .reveal-delay-7 { transition-delay: 0.56s; }

    /* ══ NAV ══ */
    nav {
      position: sticky; top: 0; z-index: 50;
      background: rgba(250,247,242,0.94); backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--ivory-mid);
      display: flex; align-items: center; justify-content: space-between;
      padding: 1.2rem 3rem;
    }
    .nav-links { display: flex; align-items: center; gap: 2rem; list-style: none; }
    .nav-links a { font-size: 0.78rem; font-weight: 400; letter-spacing: 0.09em; text-transform: uppercase; color: var(--slate-mid); transition: color var(--transition); position: relative; }
    .nav-links a::after { content: ''; position: absolute; bottom: -3px; left: 0; right: 0; height: 1px; background: var(--burgundy-hover); transform: scaleX(0); transform-origin: left; transition: transform 280ms ease; }
    .nav-links a:hover { color: var(--slate); }
    .nav-links a:hover::after { transform: scaleX(1); }
    .nav-links a.active { color: var(--burgundy); font-weight: 500; }
    .nav-hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px; background: none; border: none; }
    .nav-hamburger span { display: block; width: 22px; height: 1.5px; background: var(--slate); border-radius: 2px; transition: transform 300ms ease, opacity 300ms ease; }
    .nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
    .nav-hamburger.open span:nth-child(2) { opacity: 0; }
    .nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
    .nav-mobile { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--burgundy); z-index: 99; flex-direction: column; align-items: center; justify-content: center; gap: 2.5rem; }
    .nav-mobile.open { display: flex; }
    .nav-mobile a { font-family: var(--font-display); font-size: 2.2rem; font-weight: 300; color: var(--ivory); opacity: 0.85; transition: opacity var(--transition); }
    .nav-mobile a:hover { opacity: 1; }
    @media (max-width: 640px) { nav { padding: 1.2rem 1.4rem; } .nav-links { display: none; } .nav-hamburger { display: flex; } }

    /* ══ PAGE HEADER ══ */
    .page-header {
      background: var(--ivory);
      padding: 5.5rem 0 4rem;
      position: relative; overflow: hidden;
    }
    .page-header::before {
      content: 'Writing';
      position: absolute; bottom: -0.1em; right: -0.02em;
      font-family: var(--font-display); font-weight: 600;
      font-size: clamp(9rem, 18vw, 16rem);
      line-height: 0.85; letter-spacing: -0.04em;
      color: var(--ivory-mid);
      user-select: none; pointer-events: none;
      white-space: nowrap;
    }
    .page-header::after {
      content: '';
      position: absolute; bottom: 0; left: 0; right: 0;
      height: 3px; background: var(--burgundy);
    }
    .header-inner {
      max-width: 860px; margin: 0 auto; padding: 0 2rem;
      position: relative; z-index: 1;
    }
    .header-eyebrow {
      font-family: var(--font-sc); font-size: 1rem; font-weight: 500;
      letter-spacing: 0.2em; text-transform: uppercase; color: var(--sage);
      display: flex; align-items: center; gap: 0.75rem;
      margin-bottom: 1.6rem;
      opacity: 0; animation: fadeUp 0.8s 0.1s cubic-bezier(0.22,1,0.36,1) forwards;
    }
    .header-eyebrow::before { content: ''; display: block; width: 28px; height: 1px; background: var(--sage); }
    .header-title {
      font-family: var(--font-display);
      font-size: clamp(3.8rem, 8vw, 7rem);
      font-weight: 300; line-height: 0.95; letter-spacing: -0.025em;
      color: var(--slate); margin-bottom: 1.8rem;
      opacity: 0; animation: fadeUp 0.9s 0.22s cubic-bezier(0.22,1,0.36,1) forwards;
    }
    .header-title em { font-style: italic; color: var(--burgundy); display: block; }
    .header-desc {
      font-size: 0.95rem; color: var(--slate-mid); line-height: 1.85;
      max-width: 520px;
      opacity: 0; animation: fadeUp 0.9s 0.34s cubic-bezier(0.22,1,0.36,1) forwards;
    }

    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(22px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    /* ══ PAGE BODY ══ */
    .page { max-width: 860px; margin: 0 auto; padding: 4.5rem 2rem 8rem; }

    /* ══ SECTION LABEL ══ */
    .section-label {
      font-family: var(--font-sc); font-size: 1rem; font-weight: 500;
      letter-spacing: 0.2em; text-transform: uppercase; color: var(--sage);
      display: flex; align-items: center; gap: 0.75rem;
      margin-bottom: 1.8rem; margin-top: 3.5rem;
    }
    .section-label::after { content: ''; flex: 1; height: 1px; background: var(--ivory-mid); max-width: 60px; }
    .section-label:first-child { margin-top: 0; }

    /* ══ SUBSTACK CTA ══ */
    .substack-cta {
      background: var(--burgundy); border-radius: 2px;
      padding: 2.6rem 2.8rem; margin-bottom: 0;
      display: flex; align-items: center; justify-content: space-between;
      gap: 2rem; flex-wrap: wrap;
      position: relative; overflow: hidden;
    }
    .substack-cta::before {
      content: '';
      position: absolute; inset: 0;
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
      opacity: 0.04; pointer-events: none;
    }
    .substack-cta-inner { position: relative; z-index: 1; }
    .substack-cta-eyebrow {
      font-family: var(--font-sc); font-size: 0.85rem; font-weight: 500;
      letter-spacing: 0.18em; text-transform: uppercase;
      color: var(--gold); margin-bottom: 0.6rem;
      display: flex; align-items: center; gap: 0.6rem;
    }
    .substack-cta-eyebrow::before { content: ''; display: block; width: 18px; height: 1px; background: var(--gold); opacity: 0.6; }
    .substack-cta-title {
      font-family: var(--font-display); font-size: clamp(1.3rem, 2.5vw, 1.8rem);
      font-weight: 300; color: var(--ivory); line-height: 1.2; margin-bottom: 0.6rem;
    }
    .substack-cta-title em { font-style: italic; color: rgba(250,247,242,0.6); }
    .substack-cta-desc { font-size: 0.84rem; color: rgba(250,247,242,0.55); line-height: 1.65; max-width: 440px; }
    .substack-btn {
      position: relative; z-index: 1;
      display: inline-flex; align-items: center; gap: 0.5rem;
      background: transparent; color: var(--ivory);
      font-family: var(--font-sc); font-size: 0.7rem; font-weight: 500;
      letter-spacing: 0.14em; text-transform: uppercase;
      padding: 0.85rem 1.8rem; border-radius: 2px;
      border: 1px solid rgba(250,247,242,0.3);
      transition: background var(--transition), border-color var(--transition), transform var(--transition);
      white-space: nowrap; flex-shrink: 0;
    }
    .substack-btn:hover { background: rgba(250,247,242,0.1); border-color: rgba(250,247,242,0.6); transform: translateY(-1px); }

    /* ══ FEATURED ESSAY ══ */
    /* The first published essay gets its own card — not just a list item */
    .essay-featured {
      margin-top: 0;
      border: 1px solid var(--ivory-mid);
      border-radius: 2px;
      padding: 2.4rem 2.6rem;
      background: #fff;
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 1.5rem;
      align-items: start;
      cursor: pointer;
      transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
      position: relative; overflow: hidden;
    }
    .essay-featured::before {
      content: '';
      position: absolute; left: 0; top: 0; bottom: 0;
      width: 3px; background: var(--burgundy);
      border-radius: 2px 0 0 2px;
    }
    .essay-featured:hover {
      border-color: rgba(40,1,8,0.2);
      box-shadow: 0 6px 32px rgba(46,52,64,0.09);
      transform: translateY(-2px);
    }
    .essay-featured:hover .featured-essay-title { color: var(--burgundy); }
    .featured-essay-eyebrow {
      font-family: var(--font-sc); font-size: 0.85rem; font-weight: 500;
      letter-spacing: 0.16em; text-transform: uppercase; color: var(--sage);
      margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem;
    }
    .featured-essay-eyebrow::before { content: ''; display: block; width: 16px; height: 1px; background: var(--sage); }
    .featured-essay-num {
      font-family: var(--font-display); font-size: 3.5rem; font-weight: 300;
      color: var(--ivory-mid); line-height: 1; margin-bottom: 0.5rem;
      transition: color var(--transition);
    }
    .essay-featured:hover .featured-essay-num { color: rgba(40,1,8,0.12); }
    .featured-essay-title {
      font-family: var(--font-display); font-size: clamp(1.4rem, 2.5vw, 1.9rem);
      font-weight: 400; color: var(--slate); line-height: 1.2;
      margin-bottom: 0.7rem; transition: color var(--transition);
    }
    .featured-essay-subtitle {
      font-size: 0.88rem; color: var(--slate-mid); line-height: 1.75;
      margin-bottom: 1rem; max-width: 520px;
    }
    .featured-essay-meta {
      font-family: var(--font-sc); font-size: 0.6rem; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--slate-light);
      display: flex; align-items: center; gap: 0.75rem;
    }
    .featured-essay-meta span { display: flex; align-items: center; gap: 0.4rem; }
    .essay-tag-live {
      font-family: var(--font-sc); font-size: 0.58rem; font-weight: 500;
      letter-spacing: 0.08em; text-transform: uppercase;
      background: var(--sage-muted); color: #3a4e28;
      border: 1px solid #b4c0a8; padding: 4px 10px; border-radius: 2px;
      align-self: flex-start;
    }
    .featured-essay-read {
      display: flex; align-items: center; gap: 0.4rem;
      font-family: var(--font-sc); font-size: 0.6rem; letter-spacing: 0.12em;
      text-transform: uppercase; color: var(--burgundy);
      margin-top: 1.2rem; opacity: 0;
      transition: opacity var(--transition), gap var(--transition);
    }
    .essay-featured:hover .featured-essay-read { opacity: 1; gap: 0.65rem; }

    /* ══ ESSAY LIST ══ */
    .essay-list { display: flex; flex-direction: column; }
    .essay-item {
      display: grid; grid-template-columns: 52px 1fr auto;
      gap: 1.3rem; align-items: start;
      padding: 1.6rem 0; border-bottom: 1px solid var(--ivory-mid);
    }
    .essay-item:first-child { border-top: 1px solid var(--ivory-mid); }

    /* Upcoming items — clickable when linked */
    .essay-item.linked { cursor: pointer; }
    .essay-item.linked:hover { background: var(--ivory-dark); margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; border-radius: 2px; }
    .essay-item.linked:hover .essay-title { color: var(--burgundy); }

    .essay-num {
      font-family: var(--font-display); font-size: 1.8rem; font-weight: 300;
      color: var(--ivory-mid); line-height: 1; padding-top: 2px;
      transition: color var(--transition);
    }
    .essay-item:hover .essay-num { color: rgba(40,1,8,0.15); }
    .essay-title {
      font-family: var(--font-display); font-size: 1.15rem; font-weight: 400;
      color: var(--slate); line-height: 1.3; margin-bottom: 0.3rem;
      transition: color var(--transition);
    }
    .essay-subtitle { font-size: 0.82rem; color: var(--slate-light); line-height: 1.6; margin-bottom: 0.45rem; }
    .essay-date {
      font-family: var(--font-sc); font-size: 0.6rem; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--slate-light);
    }
    .essay-tag {
      font-family: var(--font-sc); font-size: 0.58rem; font-weight: 500;
      letter-spacing: 0.08em; text-transform: uppercase;
      padding: 3px 9px; border-radius: 2px;
      white-space: nowrap; align-self: start; margin-top: 4px;
    }
    .tag-soon { background: var(--lavender-pale); color: #4a4a7a; border: 1px solid var(--lavender); }
    .tag-dev  { background: var(--ivory-mid);    color: var(--slate-mid); border: 1px solid #d4cfc7; }

    /* "Grief" — set apart visually */
    .essay-item.essay-grief .essay-subtitle {
      font-family: var(--font-display); font-style: italic;
      font-size: 0.88rem; color: var(--slate-mid);
    }

    /* ══ PAGE FOOTER ══ */
    .page-footer {
      margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--ivory-mid);
      display: flex; align-items: center; justify-content: space-between;
      font-size: 0.78rem; color: var(--slate-light); flex-wrap: wrap; gap: 0.5rem;
    }
    .page-footer a { color: var(--sage); }
    .page-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

    /* ══ SITE FOOTER ══ */
    .site-footer {
      background: var(--slate); color: rgba(250,247,242,0.45);
      padding: 3rem 4rem;
      display: flex; align-items: center;
      justify-content: space-between; flex-wrap: wrap; gap: 1.5rem;
    }
    .footer-name { font-family: var(--font-display); font-size: 1.1rem; font-weight: 400; color: var(--ivory); }
    .footer-links { display: flex; flex-wrap: wrap; gap: 1.8rem; list-style: none; }
    .footer-links a { font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; color: rgba(250,247,242,0.4); transition: color var(--transition); }
    .footer-links a:hover { color: var(--ivory); }
    .footer-copy { font-size: 0.7rem; width: 100%; padding-top: 1.5rem; border-top: 1px solid rgba(250,247,242,0.06); }
    @media (max-width: 640px) { .site-footer { padding: 2.5rem 1.5rem; } .footer-links { gap: 1rem; flex-wrap: wrap; } }
  
    /* ── Accessibility: honor the reduced-motion preference ── */
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
      }
      .reveal { opacity: 1 !important; transform: none !important; }
    }
  
/* ───────────────────────────────────────────── */
html.no-js .reveal { opacity: 1 !important; transform: none !important; }
