/* ==========================================================================
   Agostino Ruggiero — personal site
   Design direction: editorial / quiet-luxury. Dark hero, warm cream body,
   serif display + grotesk body pairing, gold-bronze accent used semantically
   (links, active states, numerals) rather than decoratively.
   ========================================================================== */

:root {
  /* Palette */
  --ink: #171310;
  --ink-soft: #3a332b;
  --cream: #f6f1e9;
  --cream-deep: #ede4d4;
  --paper: #fbf8f3;
  --gold: #a9793f;
  --gold-light: #e9c988;
  --charcoal: #171310;
  --charcoal-2: #211b14;
  --line: rgba(23, 19, 16, 0.12);
  --line-on-dark: rgba(233, 201, 136, 0.25);

  /* Type */
  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, serif;
  --font-body: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --fs-h1: clamp(2.75rem, 1.6rem + 5.5vw, 6.25rem);
  --fs-h2: clamp(1.9rem, 1.5rem + 1.8vw, 3rem);
  --fs-h3: clamp(1.15rem, 1.05rem + 0.4vw, 1.5rem);
  --fs-lede: clamp(1.15rem, 1.05rem + 0.4vw, 1.4rem);
  --fs-body: clamp(1rem, 0.95rem + 0.15vw, 1.09rem);
  --fs-small: 0.85rem;

  /* Spacing rhythm (intentionally non-uniform) */
  --sp-xs: 0.5rem;
  --sp-sm: 1rem;
  --sp-md: 1.75rem;
  --sp-lg: clamp(2.5rem, 2rem + 2vw, 4rem);
  --sp-xl: clamp(4rem, 3rem + 4vw, 7rem);
  --sp-2xl: clamp(6rem, 4rem + 8vw, 11rem);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 220ms;

  --max-w: 1180px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 var(--sp-sm); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; margin: 0; line-height: 1.05; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--cream);
  padding: 0.75rem 1.25rem;
  z-index: 200;
}
.skip-link:focus {
  left: var(--sp-sm);
  top: var(--sp-sm);
}

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

/* ---------- Layout helpers ---------- */
.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.grid-editorial {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: var(--sp-lg);
}

.section {
  padding-block: var(--sp-2xl);
  border-bottom: 1px solid var(--line);
}
.section-alt { background: var(--cream-deep); }

.section-label {
  display: flex;
  align-items: baseline;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-lg);
}
.section-index {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--gold);
  letter-spacing: 0.08em;
}
.section h2 { font-size: var(--fs-h2); }

.lede { font-size: var(--fs-lede); color: var(--ink); max-width: 62ch; }
.section-body p { max-width: 66ch; }
.section-body strong { color: var(--gold); font-weight: 600; }

/* ---------- Scroll reveal (progressive enhancement) ----------
   Content is fully visible by default (.reveal alone = opacity:1, no
   transform). Only once script.js confirms IntersectionObserver support
   does it add "js-reveal-ready" to <html>, which is what switches .reveal
   elements to a hidden starting state before they animate in. If JS never
   runs, nothing here ever hides content. */
.reveal {
  opacity: 1;
  transform: none;
}
.js-reveal-ready .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.js-reveal-ready .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.role-item:nth-child(1) { --reveal-delay: 0ms; }
.role-item:nth-child(2) { --reveal-delay: 100ms; }
.role-item:nth-child(3) { --reveal-delay: 200ms; }

.milestone-list li:nth-child(1) { --reveal-delay: 0ms; }
.milestone-list li:nth-child(2) { --reveal-delay: 80ms; }
.milestone-list li:nth-child(3) { --reveal-delay: 160ms; }
.milestone-list li:nth-child(4) { --reveal-delay: 240ms; }

.section-body.reveal { --reveal-delay: 90ms; }
.pull-quote-caption.reveal { --reveal-delay: 120ms; }

@media (prefers-reduced-motion: reduce) {
  .js-reveal-ready .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 241, 233, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.9rem clamp(1.25rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  background: var(--ink);
  color: var(--gold-light);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.brand-name { white-space: nowrap; }

.primary-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
  font-size: 0.95rem;
}
.primary-nav a {
  text-decoration: none;
  position: relative;
  padding-block: 0.25rem;
}
.primary-nav a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 1px;
  background: var(--gold);
  transition: right var(--dur) var(--ease);
}
.primary-nav a:not(.nav-cta):hover::after,
.primary-nav a:not(.nav-cta):focus-visible::after {
  right: 0;
}
.nav-cta {
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-cta:hover, .nav-cta:focus-visible {
  background: var(--ink);
  color: var(--gold-light);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 0.4rem;
  cursor: pointer;
}
.nav-toggle-bar {
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(ellipse 55% 60% at 84% 46%, rgba(233, 201, 136, 0.14), transparent 70%),
    radial-gradient(circle at 30% 20%, var(--charcoal-2), var(--charcoal) 70%);
  color: var(--cream);
  overflow: hidden;
}
/* Film-grain texture: tiny tiled feTurbulence SVG, no external request */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.07;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-2xl) clamp(1.25rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  align-items: center;
}
.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: var(--sp-sm);
}
.hero-copy {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  z-index: 2;
  max-width: 620px;
}
.hero h1 {
  font-size: var(--fs-h1);
  line-height: 0.92;
  color: var(--cream);
  margin-bottom: var(--sp-md);
}
.hero-name-line { display: block; }
.hero-name-accent {
  color: var(--gold-light);
  transform: translateX(clamp(0px, 6vw, 90px));
  text-shadow: 0 6px 32px rgba(0, 0, 0, 0.55);
}
.hero-headline {
  font-size: var(--fs-lede);
  color: var(--cream-deep);
  max-width: 46ch;
  margin-bottom: var(--sp-lg);
}
.hero-actions {
  display: flex;
  gap: var(--sp-sm);
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-size: 0.95rem;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn-primary {
  background: var(--gold-light);
  color: var(--ink);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--gold);
  transform: translateY(-2px);
}
.btn-ghost {
  border: 1px solid var(--line-on-dark);
  color: var(--cream);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  border-color: var(--gold-light);
  color: var(--gold-light);
  transform: translateY(-2px);
}

.hero-visual {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  z-index: 1;
  justify-self: end;
  align-self: center;
  width: min(46%, 420px);
}
.hero-visual::before {
  /* layered glow behind the photo — depth instead of a flat backdrop */
  content: "";
  position: absolute;
  inset: -14% -12%;
  background: radial-gradient(circle at 58% 40%, rgba(233, 201, 136, 0.35), transparent 65%);
  filter: blur(18px);
  z-index: -1;
}
.hero-gem {
  position: absolute;
  top: -12%;
  right: -8%;
  z-index: 2;
  pointer-events: none;
  perspective: 600px;
}
.hero-gem-rotor {
  width: 170px;
  height: 170px;
  position: relative;
  transform-style: preserve-3d;
  animation: gemSpin 16s linear infinite;
}
.gem-dot {
  position: absolute;
  border-radius: 50%;
  background: var(--gold-light);
}
.gem-dot--1 { width: 32px; height: 32px; top: 0px;   left: 70px;  transform: translateZ(45px);  box-shadow: 0 0 34px 10px rgba(233, 201, 136, 0.9); }
.gem-dot--2 { width: 20px; height: 20px; top: 108px; left: 14px;  transform: translateZ(-30px); box-shadow: 0 0 26px 7px rgba(233, 201, 136, 0.8); }
.gem-dot--3 { width: 26px; height: 26px; top: 122px; left: 118px; transform: translateZ(15px);  box-shadow: 0 0 30px 8px rgba(233, 201, 136, 0.85); }
.gem-dot--4 { width: 15px; height: 15px; top: 38px;  left: 144px; transform: translateZ(-15px); box-shadow: 0 0 20px 5px rgba(233, 201, 136, 0.75); }
@keyframes gemSpin {
  from { transform: rotateY(0deg) rotateX(-10deg); }
  to   { transform: rotateY(360deg) rotateX(-10deg); }
}
.hero-photo-frame {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  aspect-ratio: 3 / 4;
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--line-on-dark);
}
.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  display: block;
}
.hero-photo-frame::after {
  /* darkens the seam where the name bleeds over the photo, for legibility */
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(20, 17, 13, 0.85) 0%, rgba(20, 17, 13, 0) 42%),
    linear-gradient(to top, rgba(20, 17, 13, 0.5), transparent 38%);
  pointer-events: none;
}

/* ---------- Track record ----------
   Editorial timeline: a thin gold rail with a dot per role, plus deliberately
   uneven visual weight (origin role quieter, flagship role emphasized in a
   card, current role mid-weight) instead of three uniform blocks. */
.role-list {
  --rail-x: clamp(1.5rem, 4vw, 2.75rem);
  position: relative;
  padding-left: var(--rail-x);
}
.role-list::before {
  content: "";
  position: absolute;
  left: calc(var(--rail-x) / 2);
  top: 2.6rem;
  bottom: 2.6rem;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--gold) 10%, var(--gold) 90%, transparent);
  opacity: 0.4;
}
.role-item {
  position: relative;
  padding-block: var(--sp-lg);
}
.role-item::before {
  /* rail dot */
  content: "";
  position: absolute;
  left: calc(var(--rail-x) / -2);
  top: 2.6rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--gold);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 5px var(--cream-deep);
}
.role-kicker {
  font-size: var(--fs-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.5rem;
}
.role-meta { margin-bottom: 0.6rem; }
.role-meta h3 {
  font-size: var(--fs-h3);
  margin-bottom: 0.35rem;
}
.role-company {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.role-company:hover, .role-company:focus-visible {
  border-color: var(--gold);
}
.role-content p:not(.role-kicker) { max-width: 66ch; margin: 0; }
.ext-arrow { font-size: 0.8em; }

/* Origin role — quieter, smaller: the proving ground, not the headline */
.role-item--origin h3 {
  font-size: calc(var(--fs-h3) * 0.9);
  color: var(--ink-soft);
}
.role-item--origin .role-company { font-weight: 500; }

/* Flagship role — the emphasized, "current main act" treatment */
.role-item--flagship::before {
  width: 15px;
  height: 15px;
  box-shadow: 0 0 0 6px var(--cream-deep), 0 0 18px 2px rgba(169, 121, 63, 0.4);
}
.role-item--flagship .role-content {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: var(--sp-md) var(--sp-lg);
  box-shadow: 0 24px 48px -30px rgba(23, 19, 16, 0.4);
}
.role-item--flagship .role-kicker { color: var(--gold); }
.role-item--flagship h3 { font-size: calc(var(--fs-h3) * 1.2); }

/* Current role — mid-weight */
.role-item--current .role-kicker { color: var(--gold); opacity: 0.8; }

/* ---------- Capabilities ---------- */
.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.skill-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-size: 0.92rem;
  background: var(--paper);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.skill-list li:hover {
  border-color: var(--gold);
  background: var(--cream-deep);
}

/* ---------- Milestones ---------- */
.milestone-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-lg) var(--sp-xl);
}
.milestone-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-sm);
  align-items: start;
}
.milestone-num {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold);
  line-height: 1;
}
.milestone-list p { margin: 0; max-width: 44ch; }

/* ---------- Philosophy ---------- */
.philosophy {
  background: var(--charcoal);
  color: var(--cream);
  text-align: center;
  border-bottom: none;
}
.pull-quote {
  margin: 0 auto var(--sp-md);
  max-width: 46ch;
}
.pull-quote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.5rem, 1.2rem + 2vw, 2.6rem);
  line-height: 1.25;
  color: var(--gold-light);
  margin: 0;
}
.pull-quote-caption {
  max-width: 52ch;
  margin: 0 auto;
  color: var(--cream-deep);
  font-size: 0.95rem;
}

/* ---------- Connect ---------- */
.connect-list {
  display: flex;
  flex-direction: column;
}
.connect-list li { border-top: 1px solid var(--line); }
.connect-list li:last-child { border-bottom: 1px solid var(--line); }
.connect-list a {
  display: flex;
  align-items: baseline;
  gap: var(--sp-sm);
  padding-block: var(--sp-md);
  text-decoration: none;
  transition: padding-left var(--dur) var(--ease), color var(--dur) var(--ease);
}
.connect-list a:hover, .connect-list a:focus-visible {
  padding-left: 0.6rem;
  color: var(--gold);
}
.connect-label {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  min-width: 11ch;
}
.connect-desc {
  color: var(--ink-soft);
  font-size: 0.92rem;
  flex: 1;
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: var(--sp-lg);
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-sm);
}

/* ==========================================================================
   Responsive: 320 / 768 / 1024 / 1440
   ========================================================================== */

@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    row-gap: var(--sp-lg);
    text-align: left;
  }
  .hero-copy { grid-row: 1; max-width: none; }
  .hero-visual {
    grid-row: 2;
    justify-self: start;
    align-self: auto;
    width: min(100%, 300px);
  }
  .hero-name-accent { transform: none; text-shadow: none; }
  .grid-editorial { grid-template-columns: 1fr; gap: var(--sp-md); }
  .hero-gem { transform: scale(0.75); top: -5%; right: -3%; }
}

@media (max-width: 640px) {
  .hero-gem { display: none; }
}

@media (max-width: 768px) {
  .primary-nav {
    position: fixed;
    inset: 64px 0 auto 0;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem clamp(1.25rem, 4vw, 3rem) 1rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
  }
  .primary-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .primary-nav a { width: 100%; padding-block: 0.75rem; }
  .nav-toggle { display: inline-flex; }
  .nav-cta { align-self: flex-start; margin-top: 0.5rem; }

  .milestone-list { grid-template-columns: 1fr; }
}

@media (min-width: 1440px) {
  .hero-inner { gap: var(--sp-2xl); }
}

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