/* ============================================================
   DEVEN MATKARI
   Clean, utilitarian, legible. Function > form.
   Flat "Gumroad" language: paper background, bold black borders,
   hard offset shadows, big readable type. Writing in the spotlight.
   ------------------------------------------------------------
   To recolour the whole site, change the variables below.
   e.g. --accent: #ff90e8;  (classic Gumroad pink)
   ============================================================ */
:root {
  --paper:    #f7f4ea;   /* background */
  --card:     #fffdf6;   /* card background */
  --ink:      #17140d;   /* text + borders (near-black) */
  --ink-soft: #4a4436;   /* secondary text */
  --accent:   #ff5941;   /* warm coral accent — used as bold fills with black text/borders */
  --accent-ink: #17140d; /* text on accent */
  --mark:     #ffe14d;   /* highlighter */

  --line: 2px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);

  --sans: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;

  --maxw: 900px;
  --read: 680px;
}

* , *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.05rem, 0.9rem + 0.5vw, 1.2rem);
  line-height: 1.65; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--mark); color: var(--ink); }

h1, h2, h3, .sans { font-family: var(--sans); }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.01em; font-weight: 700; }

.wrap { width: min(var(--maxw), 90vw); margin-inline: auto; }
.read { max-width: var(--read); }

.eyebrow {
  font-family: var(--sans); font-size: 0.74rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink);
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.85rem clamp(1rem, 5vw, 2.4rem);
  background: var(--paper); border-bottom: var(--line);
}
.brand {
  font-family: var(--sans); font-weight: 700; font-size: 1.05rem;
  letter-spacing: -0.01em; text-decoration: none; color: var(--ink);
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.brand .dot { width: 12px; height: 12px; background: var(--accent); border: 2px solid var(--ink); border-radius: 50%; }
.nav-links { display: flex; align-items: center; gap: clamp(0.75rem, 2vw, 1.6rem); }
.nav-links a:not(.btn) {
  font-family: var(--sans); font-size: 0.86rem; font-weight: 500;
  text-decoration: none; color: var(--ink); padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:not(.btn):hover { border-bottom-color: var(--ink); }
.nav-toggle { display: none; }

/* ============================================================
   BUTTONS (flat, hard shadow)
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--sans); font-weight: 700; font-size: 0.9rem;
  text-decoration: none; cursor: pointer;
  padding: 0.7rem 1.15rem; border: var(--line); border-radius: 4px;
  background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.btn:active { transform: translate(0, 0); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: clamp(3.2rem, 2rem + 5vw, 5.5rem) 0; border-bottom: var(--line); }
.section:last-of-type { border-bottom: none; }
.section-label {
  display: inline-block;
  font-family: var(--sans); font-weight: 700; font-size: 0.7rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent);
  border: var(--line); border-radius: 999px; box-shadow: var(--shadow-sm);
  padding: 0.3rem 0.8rem; margin: 0 0 1.1rem;
}
.section-title { font-size: clamp(1.9rem, 1.1rem + 2.8vw, 3.1rem); letter-spacing: -0.02em; margin: 0 0 1.6rem; }

/* ============================================================
   HERO — the Jung quote
   ============================================================ */
.hero { padding: clamp(3.5rem, 3rem + 6vw, 7rem) 0 clamp(3rem, 2rem + 4vw, 5rem); border-bottom: var(--line); text-align: center; }
.hero .eyebrow { display: inline-block; margin-bottom: 1.8rem; border: var(--line); border-radius: 999px; padding: 0.35rem 0.9rem; background: var(--card); box-shadow: var(--shadow-sm); }
.jung {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: clamp(1.7rem, 1rem + 3.4vw, 3.3rem); line-height: 1.22;
  letter-spacing: -0.01em; margin: 0 auto; max-width: 18ch; color: var(--ink);
}
.jung mark { background: linear-gradient(transparent 62%, var(--mark) 62%); color: inherit; padding: 0 0.05em; }
.jung-attr { font-family: var(--sans); font-size: 0.86rem; font-weight: 500; color: var(--ink-soft); margin-top: 1.6rem; }
.hero-tagline { font-family: var(--serif); font-style: italic; font-size: clamp(1.05rem, 0.9rem + 0.6vw, 1.3rem); color: var(--ink-soft); margin: 1.4rem auto 0; max-width: 40ch; }
.hero-cta { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; margin-top: 2.2rem; }

/* ============================================================
   ABOUT
   ============================================================ */
.about-text p { font-size: clamp(1.1rem, 0.95rem + 0.5vw, 1.32rem); margin: 0 0 1.1rem; }
.about-text p:first-child::first-letter {
  font-family: var(--sans); font-weight: 700; font-size: 3.4em; line-height: 0.7;
  float: left; padding: 0.05em 0.12em 0 0; color: var(--ink);
}
.about-quote { font-style: italic; border-left: 5px solid var(--ink); padding-left: 1rem; margin-top: 1.6rem; color: var(--ink-soft); }

/* ============================================================
   MY ARTICLES
   ============================================================ */
.articles-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 2.2rem; }

/* Gumroad-style product grid of article cards with cover art */
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 1.4rem; }
.articles-grid:not(.is-expanded) .article-card:nth-child(n+4) { display: none; }
.articles-more { display: flex; justify-content: center; margin-top: 1.8rem; }
.article-card {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  background: var(--card); border: var(--line); border-radius: 8px; overflow: hidden;
  box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease;
}
.article-card:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--ink); }
.ac-cover { position: relative; aspect-ratio: 3 / 2; border-bottom: var(--line); background: #e9e5d8; overflow: hidden; }
.ac-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ac-badge {
  position: absolute; top: 0.6rem; left: 0.6rem;
  font-family: var(--sans); font-weight: 700; font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--accent); color: var(--accent-ink); border: var(--line); border-radius: 999px;
  padding: 0.2rem 0.6rem; box-shadow: var(--shadow-sm);
}
.ac-body { display: flex; flex-direction: column; gap: 0.5rem; padding: 1rem 1.1rem 1.1rem; flex: 1 1 auto; }
.ac-title { font-family: var(--sans); font-weight: 700; font-size: 1.05rem; line-height: 1.2; margin: 0; }
.ac-note { font-family: var(--serif); font-style: italic; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.4; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ac-go { margin-top: auto; padding-top: 0.4rem; font-family: var(--sans); font-weight: 700; font-size: 0.82rem; }
.article-card:hover .ac-go { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 2px; }

/* ============================================================
   CLIPPINGS
   ============================================================ */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.filter-btn {
  font-family: var(--sans); font-weight: 700; font-size: 0.78rem;
  padding: 0.4rem 0.85rem; border: var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink); cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .1s ease, box-shadow .1s ease, background .1s ease;
}
.filter-btn:hover { transform: translate(-1px,-1px); }
.filter-btn.active { background: var(--ink); color: var(--paper); }

.clips { display: grid; gap: 1.3rem; }
.clip {
  background: var(--card); border: var(--line); border-radius: 6px;
  box-shadow: var(--shadow); padding: 1.5rem 1.6rem;
}
.clip.hidden { display: none; }
.clip-genre {
  display: inline-block; font-family: var(--sans); font-weight: 700;
  font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--accent); color: var(--accent-ink);
  border: 2px solid var(--ink); border-radius: 999px; padding: 0.2rem 0.7rem; margin-bottom: 1rem;
}
.clip-text { font-family: var(--serif); font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem); line-height: 1.5; margin: 0 0 1.1rem; }
.clip-text::before { content: "\201C"; }
.clip-text::after { content: "\201D"; }
.clip-src {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--sans); font-weight: 500; font-size: 0.85rem;
  text-decoration: none; color: var(--ink-soft); border-top: 2px solid var(--ink); padding-top: 0.9rem;
}
.clip-src b { font-weight: 700; color: var(--ink); }
.clip-src:hover b { text-decoration: underline; text-decoration-color: var(--accent); }
.clips-empty { font-family: var(--sans); color: var(--ink-soft); }
@media (min-width: 760px) { .clips { grid-template-columns: 1fr 1fr; } }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { padding: 3rem 0; text-align: center; }
.footer-name { font-family: var(--sans); font-weight: 700; font-size: 1.1rem; }
.footer-tag { font-style: italic; color: var(--ink-soft); margin: 0.5rem 0 1.3rem; }
.socials { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.4rem; }
.social {
  font-family: var(--sans); font-weight: 700; font-size: 0.82rem; text-decoration: none;
  color: var(--ink); border: var(--line); border-radius: 4px; padding: 0.45rem 0.9rem;
  background: var(--card); box-shadow: var(--shadow-sm); transition: transform .1s ease, background .1s ease;
}
.social:hover { transform: translate(-2px,-2px); background: var(--mark); }
.footer-fine { font-family: var(--sans); font-size: 0.78rem; color: var(--ink-soft); }

/* ============================================================
   RESPONSIVE NAV
   ============================================================ */
@media (max-width: 640px) {
  .nav-toggle {
    display: inline-flex; flex-direction: column; gap: 4px; cursor: pointer;
    background: var(--card); border: var(--line); border-radius: 4px; padding: 8px; box-shadow: var(--shadow-sm);
  }
  .nav-toggle span { width: 20px; height: 2px; background: var(--ink); }
  .nav-links {
    position: absolute; top: 100%; right: 0; left: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--paper); border-bottom: var(--line);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .nav-links.open { max-height: 340px; }
  .nav-links a:not(.btn) { width: 100%; padding: 0.9rem clamp(1rem, 5vw, 2.4rem); border-bottom: 2px solid var(--ink); }
  .nav-links a:not(.btn):hover { background: var(--mark); border-bottom-color: var(--ink); }
  .nav-links .btn { margin: 0.9rem clamp(1rem, 5vw, 2.4rem); }
}
