/* ============================================================
   marianopeluso.com · style.css
   Palette: cream · violet · navy · gold (editorial accent)
   Fonts: DM Serif Display (headings) + DM Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,700;0,9..40,900;1,9..40,400&display=swap');

/* ── Design tokens ───────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:          #F7F3EA;
  --paper:       #FFFDF8;
  --card:        #FFFFFF;

  /* Text */
  --text:        #172033;
  --muted:       #667085;

  /* Brand */
  --accent:      #7B4FE0;
  --accent-dark: #5A32C9;
  --blue:        #223A5E;
  --blue-soft:   #F0ECFF;

  /* Editorial accent */
  --gold:        #B8872A;
  --gold-soft:   #F5EDD8;

  /* Utility */
  --green:       #4A7A52;
  --green-soft:  #E8F0E9;
  --border:      #E3D8EA;
  --border-soft: #EDE7F4;

  /* Elevation */
  --shadow-sm:   0 2px 8px rgba(34,58,94,.07);
  --shadow-md:   0 8px 24px rgba(34,58,94,.09);
  --shadow-lg:   0 18px 45px rgba(90,50,201,.10);

  /* Radius scale */
  --radius-sm:   10px;
  --radius-md:   18px;
  --radius-lg:   26px;
  --radius-xl:   32px;

  /* Layout */
  --max:         1120px;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box }
html  { scroll-behavior: smooth; overflow-x: hidden }
body  { overflow-x: hidden }
body  {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 40% at 5% 0%, rgba(123,79,224,.11), transparent),
    linear-gradient(180deg, var(--bg) 0%, #FBF8F0 60%, #F2ECF7 100%);
  color: var(--text);
  font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img  { max-width: 100%; height: auto; display: block }
a    { color: inherit; text-decoration: none }

/* ── Headings ────────────────────────────────────────────── */
h1, h2, h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  line-height: 1.05;
}
h1 {
  font-size: clamp(32px, 5.5vw, 68px);
  letter-spacing: -.04em;
  margin: 16px 0;
}
h2 {
  font-size: clamp(24px, 3.5vw, 42px);
  letter-spacing: -.035em;
  margin: 0;
}
h3 {
  font-size: clamp(17px, 2vw, 22px);
  letter-spacing: -.025em;
  margin: 0 0 8px;
}

/* ── Layout helpers ──────────────────────────────────────── */
.container {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}
.section { padding: 52px 0 }
.grid    { display: grid; gap: 16px }
.grid-2  { grid-template-columns: repeat(2, 1fr) }
.grid-3  { grid-template-columns: repeat(3, 1fr) }

/* ── Skip link ───────────────────────────────────────────── */
.skip-link {
  position: absolute; left: -999px; top: 10px;
  background: var(--blue); color: #fff;
  padding: 10px 14px; border-radius: 999px; z-index: 99;
}
.skip-link:focus { left: 10px }

/* ── Site header ─────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(247,243,234,.90);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(227,216,234,.80);
}
.nav {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Brand mark */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  color: #fff;
  font-family: 'DM Serif Display', serif;
  font-size: 17px;
  box-shadow: 0 8px 20px rgba(34,58,94,.18);
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-name {
  font-family: 'DM Serif Display', serif;
  font-size: 16px;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -.02em;
}
.brand-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .01em;
  margin-top: 1px;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-links a {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
  background: var(--blue-soft);
  color: var(--accent-dark);
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  padding: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 100%; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg) }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0 }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg) }

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--muted);
  font-size: 13px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-links { display: flex; gap: 4px; flex-wrap: wrap }
.footer-links a {
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.footer-links a:hover { background: var(--blue-soft); color: var(--accent-dark) }

/* ── Buttons ─────────────────────────────────────────────── */
.button {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border-radius: 999px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700; font-size: 14px;
  border: 1.5px solid var(--border);
  transition: transform .18s, box-shadow .18s, background .15s;
  cursor: pointer;
  text-align: center;
}
.button:hover { transform: translateY(-2px); box-shadow: var(--shadow-md) }

.button-primary {
  background: rgba(123,79,224,.10);
  color: var(--accent-dark);
  border-color: rgba(123,79,224,.20);
}
.button-primary:hover { background: rgba(123,79,224,.18); }

.button-navy {
  background: rgba(29,114,184,.12);
  color: #1D72B8;
  border-color: rgba(29,114,184,.22);
}
.button-navy:hover { background: rgba(29,114,184,.20); }

.button-ghost {
  background: rgba(255,255,255,.70);
  color: var(--text);
}

.button-green {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(0,0,0,.06);
}
.button-green:hover { background: var(--green-soft); filter: brightness(.95); }

.button-gold {
  background: var(--gold-soft);
  color: var(--gold);
  border-color: rgba(185,143,50,.25);
}
.button-gold:hover { filter: brightness(.95); }

.button-white {
  background: #fff;
  color: var(--blue);
  border-color: #fff;
}

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.badge-violet { background: rgba(123,79,224,.10); color: var(--accent-dark) }
.badge-navy   { background: rgba(34,58,94,.09);   color: var(--blue) }
.badge-gold   { background: var(--gold-soft);     color: var(--gold) }
.badge-green  { background: var(--green-soft);    color: var(--green) }
.badge-blue   { background: rgba(29,114,184,.12); color: #1D72B8 }
.badge-dark   { background: rgba(36,41,46,.09);   color: #24292e }
.badge-x      { background: #000;                 color: #fff }
.badge-orange { background: rgba(214,107,30,.12); color: #C4621A }

/* ── Kicker & eyebrow ────────────────────────────────────── */
.kicker {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 8px;
}
.eyebrow {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(123,79,224,.09);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: rgba(255,255,255,.80);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
a.card:hover,
.card.hoverable:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #C9B7F4;
}
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 13px;
  margin-top: 14px;
}

/* Wide card */
.card-wide {
  background: linear-gradient(135deg, #fff, #F6F1FF);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}
.card-wide h3 { font-size: clamp(18px, 2.5vw, 28px) }
.card-wide p  { color: var(--muted); margin: 8px 0 0 }

/* ── Split layout ────────────────────────────────────────── */
.split {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 16px;
  align-items: start;
}

/* ── Section head ────────────────────────────────────────── */
.section-head {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}
.section-head p { margin: 0; color: var(--muted); font-size: 16px }

/* ── Hero (homepage) ─────────────────────────────────────── */
.hero {
  padding: 80px 0 52px;
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 24px;
  align-items: stretch;
}
.hero-card {
  background: rgba(255,253,248,.80);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 44px;
  box-shadow: var(--shadow-lg);
}
.hero-card h1 { font-size: clamp(32px, 6vw, 72px); max-width: 14ch }
.hero-card .lead {
  font-size: clamp(16px, 1.9vw, 21px);
  color: #38445A;
  max-width: 680px;
  margin: 0;
}
.hero-card .lead strong { color: var(--blue) }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px }

/* Side card */
.side-card {
  background: linear-gradient(160deg, #fff 0%, #FAF6FF 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}
.side-card h2 { font-size: clamp(22px, 2.5vw, 30px); margin-bottom: 10px }
.side-card p  { color: var(--muted); margin: 0 }

/* Signal grid (homepage side card) */
.signal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}
.signal {
  background: var(--blue-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.signal b    { display: block; font-size: 13px; color: var(--blue) }
.signal span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px }

/* ── Page hero (inner pages) ─────────────────────────────── */
.page-hero { padding: 56px 0 28px }
.page-hero-full {
  width: 100%;
  padding: 56px clamp(16px, 5vw, 80px) 28px;
}
.page-hero h1,
.page-hero-full h1 { font-size: clamp(36px, 5vw, 58px) }
.page-hero .subtitle,
.page-hero-full .subtitle {
  font-size: clamp(15px, 1.8vw, 18px);
  color: var(--muted);
  margin: 8px 0 0;
}



/* ── Pills ───────────────────────────────────────────────── */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px }
.pill  {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  border: 1px solid var(--border-soft);
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
}

/* ── List items (research papers) ────────────────────────── */
.list     { display: grid; gap: 10px }
.list-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  transition: box-shadow .18s, border-color .18s;
}
.list-item:hover { box-shadow: var(--shadow-md); border-color: #C9B7F4 }
.list-item strong { display: block; letter-spacing: -.015em; font-size: 15px }
.list-item span   { display: block; color: var(--muted); font-size: 13px; margin-top: 3px }
.list-item em     {
  font-style: normal;
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Latest feed ─────────────────────────────────────────── */
.latest-grid { display: grid; gap: 12px }
.latest-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: box-shadow .18s, border-color .18s;
}
.latest-item:hover { box-shadow: var(--shadow-md); border-color: #C9B7F4 }
.datebox {
  width: 58px; height: 58px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--blue));
  color: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.1;
  flex-shrink: 0;
}
.datebox small {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,.75);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.latest-item h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: -.02em }
.latest-item p  { margin: 0; color: var(--muted); font-size: 13px }

/* ── Book covers ─────────────────────────────────────────── */
.book-cover {
  aspect-ratio: 2/3;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow-md);
}
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.book-cover-fallback {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #182233, var(--accent));
  display: grid;
  place-items: center;
  color: #fff;
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  text-align: center;
  padding: 20px;
}

/* ── Contact box ─────────────────────────────────────────── */
.contact-box {
  background: linear-gradient(135deg, var(--accent), var(--blue));
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 36px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 24px;
  align-items: center;
  box-shadow: 0 22px 55px rgba(34,58,94,.18);
}
.contact-box h2 { color: #fff }
.contact-box p  { color: rgba(255,255,255,.80); margin: 8px 0 0 }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end }
.contact-box .button {
  background: rgba(255,255,255,.15);
  color: #fff;
  border-color: rgba(255,255,255,.30);
  backdrop-filter: blur(8px);
}
.contact-box .button:hover {
  background: rgba(255,255,255,.25);
  border-color: rgba(255,255,255,.50);
}
.contact-box .button-white {
  background: #fff;
  color: var(--blue);
  border-color: #fff;
}

/* ── Note block ──────────────────────────────────────────── */
.note {
  background: var(--blue-soft);
  border: 1px solid #CDBCF4;
  color: var(--accent-dark);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-size: 14px;
}

/* ── Gold highlight ──────────────────────────────────────── */
.gold-label {
  color: var(--gold);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.gold-line {
  display: block;
  width: 32px; height: 2px;
  background: var(--gold);
  margin-bottom: 12px;
}

/* ── Responsive — tablet (960px) ────────────────────────── */
@media (max-width: 960px) {
  .hero,
  .section-head,
  .split,
  .contact-box { grid-template-columns: 1fr }
  .grid-3      { grid-template-columns: repeat(2, 1fr) }
  .contact-actions { justify-content: flex-start }
}

/* ── Responsive — mobile (680px) ────────────────────────── */
@media (max-width: 680px) {
  .container { width: calc(100% - 24px) }

  /* Nav: show hamburger, hide links by default */
  .nav { min-height: 60px; flex-wrap: wrap; gap: 0; padding: 8px 0 }
  .nav-toggle { display: flex }
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding: 8px 0 12px;
    gap: 2px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
  }
  .nav-links.is-open { display: flex }
  .nav-links a {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    text-align: left;
  }

  /* Typography */
  h1 { letter-spacing: -.03em }

  /* Sections */
  .section    { padding: 32px 0 }
  .page-hero  { padding: 32px 0 16px }

  /* Hero */
  .hero       { padding: 28px 0 24px }
  .hero-card  { padding: 22px; border-radius: var(--radius-lg) }
  .actions    { margin-top: 20px }
  .actions .button { font-size: 13px; padding: 9px 15px; min-height: 40px }

  /* Grids */
  .grid-2,
  .grid-3,
  .signal-grid { grid-template-columns: 1fr }

  /* Cards */
  .card-wide { padding: 20px; border-radius: var(--radius-md) }

  /* List & feed */
  .list-item   { grid-template-columns: 1fr }
  .list-item em { margin-top: 6px }
  .latest-item { grid-template-columns: auto 1fr; gap: 12px }
  .latest-item .card-link { display: none }
  .datebox     { width: 48px; height: 48px; font-size: 12px }

  /* Contact box */
  .contact-box {
    padding: 24px 20px;
    border-radius: var(--radius-lg);
    gap: 16px;
  }
  .contact-actions { justify-content: flex-start }
  .contact-actions .button { font-size: 13px }

  /* Footer */
  .footer-inner { flex-direction: column; gap: 12px; text-align: center }
  .footer-links { gap: 0; justify-content: center }
}

/* ── Responsive — small mobile (400px) ──────────────────── */
@media (max-width: 400px) {
  .brand-sub { display: none }
  .contact-box { padding: 18px 16px }
}
