/* ============================================================
   karlozone.com — Renaissance / literary design system
   Parchment & ink. Classical serifs. One gold accent.
   Refined and restrained: type and proportion carry it.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

:root {
  /* Paper & ink */
  --bg:          #F6F1E6;   /* warm parchment */
  --surface:     #FBF8F0;   /* lifted paper (cards) */
  --surface-2:   #F1EAD9;   /* faint panel */
  --ink:         #211C15;   /* deep warm ink (body text) */
  --ink-strong:  #14100A;   /* near-black for titles */
  --ink-soft:    #57503F;   /* secondary text */
  --ink-faint:   #8C8168;   /* muted / captions */
  --ink-ghost:   #B4A98C;   /* very faint */
  --rule:        #E1D8C2;   /* hairline rules & borders */
  --rule-strong: #C9BB9C;

  /* One accent: gold leaf */
  --gold:        #9A7B3F;
  --gold-deep:   #7A5E2C;
  --gold-soft:   #B79A5E;

  /* Muted "old-master" pigments — desaturated, harmonious.
     The markup references these var names for section labels;
     here they resolve to restrained classical tones, not neon. */
  --teal:   #4F6B5D;   /* verdigris  */
  --green:  #5B6E4E;   /* olive      */
  --blue:   #3F5670;   /* muted lapis*/
  --purple: #6B5568;   /* aubergine  */
  --gold-a: #9A7B3F;
  --red:    #8A4B3B;   /* oxblood    */
  --orange: #9E6B37;   /* sienna     */
  --rose:   #93666A;   /* dusty rose */

  /* Aliases kept so existing markup keeps working */
  --text: var(--ink);
  --text-bright: var(--ink-strong);
  --text-dim: var(--ink-faint);
  --text-ghost: var(--ink-ghost);
  --border: var(--rule);
  --border-subtle: var(--rule);

  --max: 860px;   /* a book-like measure */
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 1.22rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }

.mono { font-family: 'EB Garamond', serif; } /* neutralize old mono hooks */

/* Small-caps helper used throughout for a classical voice */
.sc, .section-label, .eyebrow, .nav a, .card .k, .role, .press .outlet, .cv-row .when {
  font-variant: small-caps;
  letter-spacing: 0.06em;
}

/* Faint warm vignette instead of the old neon field */
.field {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 50% -12%, #FFFDF7, transparent 70%),
    radial-gradient(900px 900px at 100% 120%, #EFE7D3, transparent 70%);
  opacity: 0.7;
}

/* ---------------- Top navigation ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246,241,230,0.82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 66px; max-width: 1040px;
}
.brand {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600; font-size: 1.35rem; letter-spacing: 0.12em;
  font-variant: small-caps;
  color: var(--ink-strong); text-decoration: none;
  display: flex; align-items: center; gap: 12px;
}
.brand .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 3px #9A7B3F22;
}
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a {
  font-family: 'EB Garamond', serif;
  font-size: 1rem; text-decoration: none; color: var(--ink-soft);
  padding: 6px 12px; border-radius: 3px;
  border-bottom: 1px solid transparent;
  transition: color .18s, border-color .18s;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--gold-deep); border-bottom-color: var(--gold); }

/* ---------------- Hero — a title page ---------------- */
.hero { padding: 104px 0 76px; position: relative; }
.hero .eyebrow {
  font-size: 0.95rem; color: var(--gold-deep); letter-spacing: 0.2em;
  margin-bottom: 20px;
}
.hero .eyebrow::after {
  content: ""; display: block; width: 54px; height: 1px;
  background: var(--gold); margin-top: 14px;
}
.hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(3rem, 8vw, 5.4rem); line-height: 1.02; font-weight: 600;
  color: var(--ink-strong); letter-spacing: 0.005em; margin-bottom: 24px;
}
.hero h1 .accent { color: var(--gold-deep); font-style: italic; font-weight: 500; }
.roles {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0;
  margin-bottom: 30px; font-size: 1.15rem; color: var(--ink-soft);
}
.role {
  padding: 0; border: none; background: none; color: var(--ink-soft);
  font-size: 1.15rem; font-weight: 500;
}
.role:not(:last-child)::after {
  content: "·"; color: var(--gold); margin: 0 0.7em; font-variant: normal;
}
.hero .lede { font-size: 1.34rem; max-width: 40em; color: var(--ink); line-height: 1.6; }
.hero .lede::first-letter {
  initial-letter: 3;
  -webkit-initial-letter: 3;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600; color: var(--gold-deep);
  margin-right: 0.08em;
}
.hero em { font-style: italic; }
.hero .cta { margin-top: 40px; display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------------- Buttons ---------------- */
.btn {
  font-family: 'EB Garamond', serif; font-size: 1.05rem; font-variant: small-caps;
  letter-spacing: 0.05em; text-decoration: none;
  padding: 10px 22px; border-radius: 3px;
  border: 1px solid var(--rule-strong); color: var(--ink-strong); background: transparent;
  transition: border-color .18s, background .18s, color .18s;
}
.btn:hover { border-color: var(--gold); color: var(--gold-deep); }
.btn.primary {
  background: var(--ink-strong); color: var(--bg); border-color: var(--ink-strong);
}
.btn.primary:hover { background: var(--gold-deep); border-color: var(--gold-deep); color: #fff; }

/* ---------------- Sections ---------------- */
.section { padding: 62px 0; border-top: 1px solid var(--rule); }
.section-head { margin-bottom: 34px; }
.section-label {
  font-size: 0.9rem; letter-spacing: 0.14em; color: var(--gold-deep);
  margin-bottom: 10px;
}
.section h2 {
  font-family: 'Cormorant Garamond', serif; font-size: clamp(1.9rem, 4vw, 2.6rem);
  color: var(--ink-strong); font-weight: 600; letter-spacing: 0.005em;
}
.section .sub { color: var(--ink-faint); font-size: 1.08rem; margin-top: 6px; font-style: italic; }

/* ---------------- Cards ---------------- */
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 4px;
  padding: 26px 28px; transition: border-color .2s, box-shadow .2s;
}
.card:hover { border-color: var(--rule-strong); box-shadow: 0 2px 0 var(--rule); }
.card .k {
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.12em;
  color: var(--gold-deep); margin-bottom: 12px;
}
.card h3 { font-family: 'Cormorant Garamond', serif; color: var(--ink-strong); font-size: 1.5rem; margin-bottom: 8px; font-weight: 600; }
.card p { font-size: 1.08rem; color: var(--ink-soft); }
.card a.more {
  display: inline-block; margin-top: 16px; font-variant: small-caps; letter-spacing: 0.05em;
  font-size: 1rem; color: var(--gold-deep); text-decoration: none;
  border-bottom: 1px solid var(--gold-soft);
}
.card a.more:hover { color: var(--ink-strong); border-color: var(--ink-strong); }

/* ---------------- Callouts — quiet marginalia ---------------- */
.callout {
  border-radius: 3px; padding: 20px 26px; margin: 22px 0; font-size: 1.14rem;
  background: var(--surface); border: 1px solid var(--rule);
  border-left: 3px solid var(--gold); font-style: italic; color: var(--ink);
}
.callout strong { color: var(--ink-strong); font-style: normal; }
.callout.teal   { border-left-color: var(--teal); }
.callout.gold   { border-left-color: var(--gold); }
.callout.purple { border-left-color: var(--purple); }

/* ---------------- Image placeholders ---------------- */
.ph {
  position: relative; border-radius: 4px; overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--rule-strong);
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--ink-faint); font-variant: small-caps; letter-spacing: 0.08em; font-size: 0.95rem;
  aspect-ratio: 16 / 10;
}
.ph::before {
  content: ""; position: absolute; inset: 10px; border: 1px solid var(--rule); border-radius: 2px;
  pointer-events: none;
}
.ph.square { aspect-ratio: 1 / 1; }
.ph span { padding: 8px 12px; position: relative; }

/* ---------------- Publications ---------------- */
.pub { padding: 22px 0; border-bottom: 1px solid var(--rule); }
.pub:last-child { border-bottom: none; }
.pub .title { font-family: 'Cormorant Garamond', serif; color: var(--ink-strong); font-weight: 600; font-size: 1.35rem; line-height: 1.25; }
.pub .meta { color: var(--ink-faint); font-size: 0.98rem; margin-top: 6px; }
.pub .authors { font-size: 1.05rem; margin-top: 5px; color: var(--ink-soft); font-style: italic; }
.pub a.doi { color: var(--gold-deep); text-decoration: none; border-bottom: 1px solid var(--gold-soft); }
.pub a.doi:hover { color: var(--ink-strong); }
.badge {
  display: inline-block; font-variant: small-caps; letter-spacing: 0.08em; font-size: 0.8rem;
  padding: 1px 10px; border-radius: 2px; margin-left: 10px; vertical-align: middle;
  border: 1px solid var(--gold); color: var(--gold-deep); font-family: 'EB Garamond', serif;
}

/* ---------------- Press wall ---------------- */
.press-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.press {
  display: block; text-decoration: none; background: var(--surface);
  border: 1px solid var(--rule); border-radius: 4px; padding: 18px 20px;
  transition: border-color .18s, box-shadow .18s;
}
.press:hover { border-color: var(--gold); box-shadow: 0 2px 0 var(--rule); }
.press .outlet { font-family: 'Cormorant Garamond', serif; font-weight: 600; color: var(--ink-strong); font-size: 1.28rem; letter-spacing: 0.02em; }
.press .headline { font-size: 1.02rem; color: var(--ink-soft); margin-top: 6px; line-height: 1.4; font-style: italic; }
.press .date { font-variant: small-caps; letter-spacing: 0.08em; font-size: 0.85rem; color: var(--ink-faint); margin-top: 10px; }

/* ---------------- CV ---------------- */
.cv-row { display: grid; grid-template-columns: 190px 1fr; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.cv-row .when { font-size: 0.98rem; color: var(--gold-deep); letter-spacing: 0.06em; padding-top: 4px; }
.cv-row .what h4 { font-family: 'Cormorant Garamond', serif; color: var(--ink-strong); font-size: 1.4rem; font-weight: 600; }
.cv-row .what .org { color: var(--gold-deep); font-size: 1.06rem; font-style: italic; }
.cv-row .what .note { font-size: 1.02rem; color: var(--ink-faint); margin-top: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.chip { font-variant: small-caps; letter-spacing: 0.05em; font-size: 0.95rem; padding: 4px 13px; border-radius: 2px;
  background: var(--surface); border: 1px solid var(--rule); color: var(--ink-soft); }

/* ---------------- Footer ---------------- */
.footer { border-top: 1px solid var(--rule); margin-top: 56px; padding: 52px 0 68px; text-align: center; }
.footer::before {
  content: "\2767"; /* rotated floral heart — the one quiet flourish */
  display: block; color: var(--gold); font-size: 1.5rem; margin-bottom: 18px;
}
.footer .sig { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.5rem; color: var(--ink-strong); font-variant: small-caps; letter-spacing: 0.06em; }
.footer .ghost { font-size: 1.02rem; color: var(--ink-faint); font-style: italic; margin-top: 8px; }
.footer .social { margin-top: 20px; display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }
.footer .social a { font-variant: small-caps; letter-spacing: 0.05em; font-size: 1rem; color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid transparent; }
.footer .social a:hover { color: var(--gold-deep); border-color: var(--gold); }

/* ---------------- Reveal on scroll ---------------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 820px) {
  body { font-size: 1.16rem; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .cv-row { grid-template-columns: 1fr; gap: 4px; }
  .nav { display: none; }
}
