/* ============================================================
   CHRIS D'ALESSANDRO — Portfolio
   Aesthetic: brutalist editorial (Alloy-inspired)
   ============================================================ */

/* -------- THEME TOKENS -------- */
:root {
  --sage:      #939c90;
  --sage-2:    #9aa397;
  --sage-3:    #8b9488;
  --ink:       #131410;
  --ink-soft:  #2a2c24;
  --paper:     #edeee6;
  --paper-2:   #e2e3d8;
  --green:     #2f3d1c;
  --green-2:   #3c4d24;
  --acid:      #c3e84a;
  --red:       #e23a2e;
  --line:      rgba(19, 20, 16, 0.28);
  --line-hard: #131410;

  --bg:        var(--sage);
  --fg:        var(--ink);

  --font-display: "Archivo Black", "Archivo", system-ui, sans-serif;
  --font-head:    "Archivo", system-ui, sans-serif;
  --font-body:    "Space Grotesk", system-ui, sans-serif;
  --font-mono:    "Space Mono", ui-monospace, monospace;

  --pad: clamp(18px, 5vw, 84px);
  --maxw: 1360px;
}

[data-theme="night"] {
  --sage:   #14150f;
  --sage-2: #1c1d15;
  --sage-3: #101109;
  --ink:    #e9eadf;
  --ink-soft: #c9cbbc;
  --paper:  #1b1c14;
  --paper-2:#22241a;
  --green:  #c3e84a;
  --green-2:#d3f36a;
  --acid:   #c3e84a;
  --line:      rgba(233, 234, 223, 0.22);
  --line-hard: #3a3c2e;
  --bg: var(--sage);
  --fg: var(--ink);
}

/* -------- RESET -------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background 0.5s ease, color 0.5s ease;
}

a { color: inherit; text-decoration: none; }
em { font-style: italic; }

/* subtle film grain / texture */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
}
[data-theme="night"] .grain { mix-blend-mode: screen; opacity: 0.28; }

/* -------- SHARED -------- */
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
}
.kicker__idx {
  background: var(--ink); color: var(--sage);
  padding: 3px 7px 2px; font-size: 11px; letter-spacing: 0.05em;
}
.section--dark .kicker__idx { background: var(--acid); color: var(--ink); }

.arr { display: inline-block; transition: transform 0.25s ease; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-weight: 700; font-size: 13px;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 13px 20px; border: 1.5px solid var(--line-hard);
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--line-hard); }
.btn:hover .arr { transform: translate(2px, -2px); }
.btn--solid { background: var(--ink); color: var(--sage); }
.btn--solid:hover { box-shadow: 4px 4px 0 var(--green); }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--ink); color: var(--sage); }
.btn--resume { background: var(--green); color: var(--paper); border-color: var(--green); }
.btn--resume:hover { box-shadow: 4px 4px 0 var(--ink); }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--pad);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1.5px solid var(--line-hard);
}
.brand { position: relative; display: flex; align-items: flex-start; }
.brand__mark {
  font-family: var(--font-display); font-size: 26px; line-height: 0.8;
  letter-spacing: -0.02em;
}
.brand__flag { width: 9px; height: 9px; background: var(--red); margin-left: 3px; margin-top: 2px; }

.nav__links { display: flex; gap: 22px; margin-left: auto; }
.nav__links a {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 6px 0; position: relative; color: var(--fg);
  transition: opacity 0.2s ease;
}
.nav__links .idx { color: var(--red); font-size: 9px; vertical-align: super; margin-right: 3px; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--ink); transition: width 0.25s ease;
}
.nav__links a:hover::after, .nav__links a.is-active::after { width: 100%; }
.nav__links a.is-active { opacity: 1; }

.nav__actions { display: flex; align-items: center; gap: 14px; }
.theme-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 1.5px solid var(--line-hard); color: var(--fg);
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 8px 11px; cursor: pointer; transition: background 0.2s ease, color 0.2s ease;
}
.theme-toggle:hover { background: var(--ink); color: var(--sage); }
.theme-toggle__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); border: 1.5px solid var(--line-hard); }
[data-theme="night"] .theme-toggle__dot { background: var(--acid); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; z-index: 2;
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(48px, 9vw, 120px) var(--pad) 0;
}
.hero__meta {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.06em;
  text-transform: uppercase; margin-bottom: clamp(24px, 5vw, 48px);
}
.hero__meta .dot { color: var(--red); }
.hero__seeking { background: var(--ink); color: var(--sage); padding: 5px 10px 4px; font-weight: 700; }

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(44px, 11.2vw, 158px);
  line-height: 0.86; letter-spacing: -0.035em; text-transform: uppercase;
}
.hero__title .line { display: block; }
.hero__title .line--fill {
  color: transparent; -webkit-text-stroke: 2px var(--ink-soft); text-stroke: 2px var(--ink-soft);
}
@supports not (-webkit-text-stroke: 1px black) { .hero__title .line--fill { color: var(--ink-soft); } }

.hero__lede {
  max-width: 60ch; margin: clamp(28px, 5vw, 44px) 0 0;
  font-size: clamp(19px, 2.4vw, 27px); line-height: 1.4; font-weight: 500;
}
.hero__lede em { font-style: italic; border-bottom: 3px solid var(--red); }

.hero__roles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.chip {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 7px 12px; border: 1.5px solid var(--line-hard); background: var(--paper-2);
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.ticker {
  margin-top: clamp(52px, 8vw, 90px);
  border-top: 1.5px solid var(--line-hard); border-bottom: 1.5px solid var(--line-hard);
  padding: 14px 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker__track {
  display: inline-flex; align-items: center; gap: 22px; white-space: nowrap;
  font-family: var(--font-mono); font-size: 15px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  animation: marquee 34s linear infinite;
}
.ticker__track .sep { color: var(--red); font-size: 11px; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker__track { animation: none; } }

/* ============================================================
   SECTION SCAFFOLD
   ============================================================ */
.section {
  position: relative; z-index: 2;
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(64px, 10vw, 140px) var(--pad);
  border-top: 1.5px solid var(--line-hard);
}
.section--tint { background: color-mix(in srgb, var(--paper) 22%, transparent); }
.section--dark {
  background: var(--ink); color: var(--paper);
  max-width: none; margin: 0; border-top: 1.5px solid var(--line-hard);
}
.section--dark .section__intro { color: color-mix(in srgb, var(--paper) 78%, transparent); }

.section__head { max-width: 62ch; margin-bottom: clamp(40px, 6vw, 72px); }
.section__title {
  font-family: var(--font-display);
  font-size: clamp(38px, 7vw, 88px); line-height: 0.92;
  letter-spacing: -0.02em; text-transform: uppercase; margin-top: 20px;
}
.section__intro { margin-top: 22px; font-size: clamp(16px, 2vw, 20px); line-height: 1.5; max-width: 54ch; }

/* ============================================================
   BUILDING GRID
   ============================================================ */
.build-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5px;
  background: var(--line-hard); border: 1.5px solid var(--line-hard);
}
.build { background: var(--bg); padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; }
.build--lead { grid-column: 1 / -1; background: var(--paper-2); }
.build__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 10px; border: 1.5px solid var(--line-hard);
}
.tag--live { background: var(--green); color: var(--paper); border-color: var(--green); }
.tag--build { background: transparent; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); animation: pulse 1.6s ease-in-out infinite; }
.tag--build .pulse { background: var(--red); }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: 0.3; transform: scale(0.7);} }
.build__site, .build__no { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.05em; opacity: 0.7; }
.build__name {
  font-family: var(--font-display); font-size: clamp(30px, 4vw, 52px);
  line-height: 0.9; letter-spacing: -0.02em; text-transform: uppercase; margin-bottom: 16px;
}
.build--lead .build__name { font-size: clamp(40px, 6vw, 76px); }
.build__desc { font-size: 16.5px; line-height: 1.55; max-width: 60ch; }
.build--lead .build__desc { font-size: clamp(17px, 1.8vw, 21px); }
.build__desc strong { border-bottom: 2px solid var(--red); }
.build__points { list-style: none; margin-top: 20px; display: grid; gap: 8px; }
.build__points li {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.02em;
  padding-left: 20px; position: relative;
}
.build__points li::before { content: "→"; position: absolute; left: 0; color: var(--red); }
.build__engine {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.build__engine span { border: 1.5px solid var(--line-hard); padding: 6px 9px; background: var(--bg); }
.build__engine i { color: var(--red); font-style: normal; }
.build__note { margin-top: auto; padding-top: 18px; font-size: 13.5px; line-height: 1.45; opacity: 0.78; }

/* ============================================================
   STATS
   ============================================================ */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5px; background: var(--line-hard); border: 1.5px solid var(--line-hard); }
.stat { background: var(--ink); padding: clamp(24px, 3vw, 44px); }
.stat__num {
  font-family: var(--font-display); font-size: clamp(40px, 5.5vw, 74px);
  line-height: 0.92; letter-spacing: -0.02em; color: var(--acid);
}
.stat__num .stat__unit { font-size: 0.4em; color: var(--paper); margin-left: 2px; }
.stat__label { margin-top: 16px; font-size: 14.5px; line-height: 1.45; color: color-mix(in srgb, var(--paper) 82%, transparent); max-width: 34ch; }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { list-style: none; border-top: 1.5px solid var(--line-hard); }
.job {
  display: grid; grid-template-columns: 200px 1fr; gap: clamp(16px, 4vw, 60px);
  padding: clamp(24px, 3.4vw, 40px) 0; border-bottom: 1.5px solid var(--line-hard);
  transition: padding-left 0.25s ease, background 0.25s ease;
}
.job:hover { padding-left: 14px; background: color-mix(in srgb, var(--paper) 26%, transparent); }
.job__when { font-family: var(--font-mono); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; padding-top: 6px; }
.job__role { font-family: var(--font-head); font-weight: 800; font-size: clamp(19px, 2.4vw, 27px); line-height: 1.12; letter-spacing: -0.01em; }
.job__tag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  vertical-align: middle; margin-left: 8px; padding: 3px 7px; border: 1.5px solid var(--line-hard); font-weight: 700;
}
.job__co { font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0.03em; margin: 8px 0 12px; }
.job__loc { opacity: 0.62; }
.job p { font-size: 16px; line-height: 1.55; max-width: 68ch; }
.job p strong { border-bottom: 2px solid var(--red); }
.job--earlier { opacity: 0.9; }

/* ============================================================
   CAPABILITIES
   ============================================================ */
.caps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5px; background: var(--line-hard); border: 1.5px solid var(--line-hard); }
.cap { background: var(--bg); padding: clamp(24px, 3vw, 40px); position: relative; }
.cap__no {
  position: absolute; top: clamp(20px,3vw,34px); right: clamp(20px,3vw,34px);
  font-family: var(--font-display); font-size: 34px; color: transparent;
  -webkit-text-stroke: 1.5px var(--line); line-height: 1;
}
.cap h3 { font-family: var(--font-head); font-weight: 800; font-size: clamp(20px, 2.6vw, 28px); line-height: 1.1; letter-spacing: -0.01em; max-width: 14ch; margin-bottom: 14px; }
.cap p { font-size: 15.5px; line-height: 1.55; max-width: 46ch; }

.stack { margin-top: 40px; border: 1.5px solid var(--line-hard); padding: clamp(20px,3vw,32px); }
.stack__label { display: block; font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 18px; }
.stack__list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.stack__list li { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.03em; padding: 7px 12px; border: 1.5px solid var(--line); }

/* ============================================================
   RESUMES
   ============================================================ */
.resumes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5px; background: var(--line-hard); border: 1.5px solid var(--line-hard); }
@media (max-width: 1080px) { .resumes { grid-template-columns: repeat(2, 1fr); } }
.resume-card { background: var(--bg); padding: clamp(24px, 3vw, 38px); display: flex; flex-direction: column; min-height: 260px; transition: background 0.2s ease, color 0.2s ease; }
.resume-card:hover { background: var(--ink); color: var(--sage); }
.resume-card:hover .resume-card__no { -webkit-text-stroke-color: var(--sage); }
.resume-card__no { font-family: var(--font-display); font-size: 40px; color: transparent; -webkit-text-stroke: 1.5px var(--line-hard); line-height: 1; }
.resume-card h3 { font-family: var(--font-head); font-weight: 800; font-size: clamp(21px, 2.4vw, 27px); margin-top: 18px; letter-spacing: -0.01em; }
.resume-card p { font-size: 15px; line-height: 1.5; margin-top: 12px; opacity: 0.85; }
.resume-card__dl { margin-top: auto; padding-top: 22px; font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px; }
.resume-card:hover .arr { transform: translateY(3px); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact { position: relative; z-index: 2; background: var(--ink); color: var(--paper); border-top: 1.5px solid var(--line-hard); }
.contact__inner { max-width: var(--maxw); margin: 0 auto; padding: clamp(64px, 10vw, 150px) var(--pad); }
.kicker--light .kicker__idx { background: var(--acid); color: var(--ink); }
.contact__title { font-family: var(--font-display); font-size: clamp(46px, 11vw, 150px); line-height: 0.88; letter-spacing: -0.03em; text-transform: uppercase; margin: 26px 0 30px; }
.contact__avail { max-width: 52ch; margin: 0 0 48px; font-size: clamp(16px, 2vw, 21px); line-height: 1.5; color: color-mix(in srgb, var(--paper) 82%, transparent); }
.contact__avail-role { display: inline-block; background: var(--acid); color: var(--ink); font-family: var(--font-mono); font-weight: 700; font-size: 0.82em; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 9px 3px; }
.contact__links { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1.5px solid var(--line-hard); }
.contact__link { display: flex; flex-direction: column; gap: 12px; padding: 28px 24px 28px 0; border-bottom: 1.5px solid var(--line-hard); transition: padding-left 0.25s ease, color 0.2s ease; }
.contact__link:hover { padding-left: 14px; color: var(--acid); }
.contact__k { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.6; }
.contact__v { font-family: var(--font-head); font-weight: 700; font-size: clamp(17px, 2vw, 23px); letter-spacing: -0.01em; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  padding: 26px var(--pad); background: var(--ink); color: var(--paper);
  border-top: 1.5px solid var(--line-hard);
}
.footer__mark { font-family: var(--font-display); font-size: 16px; letter-spacing: 0.02em; }
.footer__meta { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em; opacity: 0.72; }
.footer__top { font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.footer__top:hover { color: var(--acid); }

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .stats, .build-grid, .caps, .resumes, .contact__links { grid-template-columns: 1fr; }
  .build--lead { grid-column: auto; }
  .job { grid-template-columns: 1fr; gap: 6px; }
  .job__when { padding-top: 0; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav { gap: 12px; }
  .btn--resume { padding: 10px 14px; }
  .theme-toggle__label { display: none; }
  .hero__title .line--fill { -webkit-text-stroke-width: 1.5px; }
}
