:root {
  color-scheme: dark;
  --bg: #101212;
  --bg-deep: #0b0d0d;
  --surface: #1a1c1c;
  --surface-2: #202222;
  --surface-3: #303232;
  --text: #f3eeee;
  --muted: #cfc2c4;
  --subtle: #a99b9d;
  --outline: #544548;
  --garnet: #782f40;
  --garnet-bright: #a63e5a;
  --rose: #ffb2be;
  --gold: #dbc493;
  --gold-dim: #aa9569;
  --success: #76c893;
  --max: 1280px;
  --radius: 10px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --sans: Montserrat, "Avenir Next", Avenir, "Segoe UI", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 18% 10%, rgba(120, 47, 64, 0.13), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(219, 196, 147, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(219, 196, 147, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 55%);
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--gold);
  color: var(--bg-deep);
  font-weight: 800;
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  border-bottom: 1px solid rgba(219, 196, 147, 0.12);
  background: rgba(11, 13, 13, 0.88);
  backdrop-filter: blur(16px);
}

.nav-shell,
.page-shell,
.footer-shell {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
}

.nav-shell {
  min-height: 78px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
}

.brand {
  text-decoration: none;
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
}

.nav-links a {
  position: relative;
  padding: 8px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav-links a:hover { color: var(--gold); }

.nav-links a[aria-current="page"] {
  color: var(--gold);
}

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--gold);
}

.nav-actions { display: flex; align-items: center; gap: 10px; }

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--outline);
  border-radius: 7px;
  background: var(--surface);
  color: var(--gold);
  cursor: pointer;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 11px 20px;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--garnet); color: #fff; border-color: #9c4358; }
.button-primary:hover { background: var(--garnet-bright); }
.button-secondary { background: transparent; color: var(--gold); border-color: var(--gold-dim); }
.button-secondary:hover { background: rgba(219, 196, 147, 0.08); border-color: var(--gold); }
.button-large { min-height: 54px; padding-inline: 28px; }

.page-shell { padding: 132px 0 88px; }
.narrow { max-width: 900px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 38px;
  height: 2px;
  background: var(--garnet-bright);
}

h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { line-height: 1.16; letter-spacing: -0.025em; }
h1 { margin-bottom: 22px; font-size: clamp(2.45rem, 6vw, 4.8rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.35rem; }

.accent { color: var(--gold); }
.accent-garnet { color: var(--rose); }
.lede { max-width: 720px; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, 0.85fr);
  align-items: center;
  gap: clamp(38px, 7vw, 90px);
  margin-bottom: 82px;
}

.hero h1 {
  margin: 20px 0 12px;
  font-size: clamp(2.5rem, 5.3vw, 4.4rem);
  text-transform: uppercase;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.hero-tag::before { content: ">_"; color: var(--rose); }

.hero-subtitle { color: var(--muted); font-size: clamp(1.15rem, 2vw, 1.45rem); font-weight: 700; }

.quote {
  max-width: 680px;
  margin: 22px 0;
  border-left: 2px solid var(--garnet-bright);
  padding: 16px 20px;
  background: linear-gradient(90deg, rgba(120, 47, 64, 0.16), transparent);
  color: var(--muted);
  font-style: italic;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.profile-card {
  position: relative;
  min-height: 590px;
  overflow: hidden;
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.profile-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 13, 13, 0.95), transparent 55%);
}

.profile-card > img {
  width: 100%;
  height: 590px;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(1) contrast(1.08);
  transition: filter 400ms ease, transform 700ms ease;
}

.profile-card:hover > img { filter: grayscale(0.35); transform: scale(1.025); }

.profile-stats {
  position: absolute;
  z-index: 2;
  right: 22px;
  bottom: 22px;
  left: 22px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.stat {
  border: 1px solid var(--outline);
  border-radius: 6px;
  padding: 14px;
  background: rgba(32, 34, 34, 0.88);
  backdrop-filter: blur(10px);
}

.stat strong { display: block; color: var(--gold); font-family: var(--mono); font-size: 1.35rem; }
.stat span { color: var(--muted); font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(219, 196, 147, 0.18);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 36px);
  background: rgba(27, 29, 29, 0.94);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.12);
  transition: transform 180ms ease, border-color 180ms ease;
}

.card:hover { transform: translateY(-3px); border-color: rgba(219, 196, 147, 0.5); }
.card p:last-child { margin-bottom: 0; }

.icon-box {
  display: inline-grid;
  width: 44px;
  height: 44px;
  margin-bottom: 17px;
  place-items: center;
  border-radius: 7px;
  background: rgba(120, 47, 64, 0.34);
  color: var(--rose);
  font-family: var(--mono);
  font-weight: 900;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip {
  border: 1px solid var(--outline);
  border-radius: 5px;
  padding: 5px 9px;
  background: var(--surface-3);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}
.chip.gold { border-color: rgba(219, 196, 147, 0.4); background: rgba(219, 196, 147, 0.05); color: var(--gold); border-radius: 999px; }

.home-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  margin-bottom: 72px;
}
.home-grid .wide { grid-column: span 8; }
.home-grid .small { grid-column: span 4; }

.image-card {
  min-height: 245px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background-position: center;
  background-size: cover;
}
.image-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 13, 13, 0.95), rgba(11, 13, 13, 0.16));
}
.image-card > * { position: relative; z-index: 1; }

.timeline { max-width: 920px; margin: 0 auto; }
.timeline h2 { margin-bottom: 34px; text-align: center; }
.timeline-item { position: relative; border-left: 2px solid var(--outline); padding: 0 0 34px 32px; }
.timeline-item::before {
  content: "";
  position: absolute;
  top: 2px;
  left: -9px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--garnet-bright);
  border-radius: 50%;
  background: var(--bg);
}
.timeline-item time { color: var(--rose); font-family: var(--mono); font-size: 0.78rem; }
.timeline-item h3 { margin: 8px 0; }

.page-intro { margin-bottom: 62px; }
.page-intro.center { text-align: center; }
.page-intro.center .lede { margin-inline: auto; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 54px;
}
.metric { min-height: 150px; display: grid; place-content: center; text-align: center; }
.metric strong { display: block; color: var(--gold); font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1; }
.metric span { margin-top: 13px; color: var(--muted); font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}
.skills-grid .span-7 { grid-column: span 7; }
.skills-grid .span-5 { grid-column: span 5; }
.skills-grid .span-6 { grid-column: span 6; }

.progress-row { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin: 24px 0; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 7px; font-family: var(--mono); font-size: 0.78rem; }
.progress-label span:last-child { color: var(--gold); }
.progress-track { height: 5px; overflow: hidden; border-radius: 5px; background: var(--surface-3); }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--garnet), var(--rose)); }

.credential-list { display: grid; gap: 10px; }
.credential { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 12px; padding: 12px; border-radius: 6px; background: var(--surface-2); }
.credential-mark { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 5px; background: rgba(120, 47, 64, 0.25); color: var(--gold); font-family: var(--mono); font-size: 0.78rem; font-weight: 800; }
.credential strong { display: block; font-family: var(--mono); font-size: 0.82rem; }
.credential small { display: block; color: var(--muted); font-size: 0.68rem; text-transform: uppercase; }

.split-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 26px; }
.note { border-left: 4px solid var(--garnet-bright); padding: 11px 12px; background: var(--bg-deep); }
.note strong { display: block; font-family: var(--mono); font-size: 0.8rem; }
.note span { color: var(--muted); font-size: 0.72rem; }

.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 64px;
  border-style: dashed;
}
.cta p { margin-bottom: 0; color: var(--muted); }

.project-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}
.project-grid .span-8 { grid-column: span 8; }
.project-grid .span-4 { grid-column: span 4; }
.project-grid .span-5 { grid-column: span 5; }
.project-grid .span-7 { grid-column: span 7; }

.project-feature { padding: 0; display: grid; grid-template-columns: 1fr 1fr; }
.project-image { min-height: 390px; width: 100%; height: 100%; object-fit: cover; }
.project-body { padding: 34px; }
.project-label { display: block; margin: 18px 0 4px; color: var(--gold); font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; }
.project-metric { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-top: 28px; border-top: 1px solid var(--outline); padding-top: 18px; }
.project-metric span { color: var(--muted); font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; }
.project-metric strong { color: var(--gold); font-size: 1.8rem; }
.security-card { padding: 0; }
.security-card img { width: 100%; height: 230px; object-fit: cover; }
.security-card .project-body { padding: 30px; }
.automation-card { display: grid; grid-template-columns: 1fr 210px; gap: 28px; }
.code-panel { margin: 0; border: 1px solid var(--outline); border-radius: 6px; padding: 18px; background: var(--surface-3); color: var(--gold); font-family: var(--mono); font-size: 0.75rem; white-space: pre-wrap; }
.duo-metric { display: flex; gap: 28px; margin-top: 25px; }
.duo-metric strong { display: block; color: var(--gold); font-size: 1.65rem; }
.duo-metric small { color: var(--muted); font-family: var(--mono); font-size: 0.65rem; text-transform: uppercase; }

.contact-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr); gap: 24px; align-items: start; }
.contact-form { display: grid; gap: 22px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { display: grid; gap: 7px; }
.field label { color: var(--muted); font-family: var(--mono); font-size: 0.82rem; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--outline);
  border-radius: 5px;
  padding: 13px 14px;
  background: var(--bg);
  color: var(--text);
}
.field textarea { min-height: 170px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); outline: 2px solid rgba(219, 196, 147, 0.22); outline-offset: 0; }
.form-note { margin: -8px 0 0; color: var(--subtle); font-size: 0.85rem; }
.contact-stack { display: grid; gap: 20px; }
.contact-list { display: grid; gap: 19px; }
.contact-row { display: grid; grid-template-columns: 43px 1fr; gap: 14px; align-items: center; text-decoration: none; }
.contact-row .icon-box { width: 43px; height: 43px; margin: 0; }
.contact-row span { display: block; color: var(--muted); font-family: var(--mono); font-size: 0.78rem; }
.contact-row strong { display: block; overflow-wrap: anywhere; }
.availability { background: var(--surface-3); }
.availability-line { display: flex; align-items: center; gap: 10px; color: var(--gold); font-family: var(--mono); font-size: 0.8rem; }
.availability-line::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 14px rgba(219, 196, 147, 0.7); }
.contact-image { width: 100%; min-height: 300px; border-radius: var(--radius); object-fit: cover; filter: grayscale(1); }

.resume-paper { padding: 44px; }
.resume-header { display: flex; justify-content: space-between; gap: 25px; border-bottom: 2px solid var(--garnet); padding-bottom: 25px; }
.resume-header h1 { margin-bottom: 3px; font-size: 2.5rem; }
.resume-contact { text-align: right; font-family: var(--mono); font-size: 0.8rem; }
.resume-section { margin-top: 32px; }
.resume-section h2 { margin-bottom: 16px; color: var(--gold); font-size: 1rem; font-family: var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.resume-entry { margin-bottom: 23px; }
.resume-entry h3 { margin-bottom: 3px; }
.resume-entry .date { color: var(--rose); font-family: var(--mono); font-size: 0.78rem; }
.resume-actions { display: flex; justify-content: flex-end; margin-bottom: 18px; }

.not-found { min-height: 65vh; display: grid; place-items: center; text-align: center; }
.not-found strong { display: block; color: var(--gold); font-family: var(--mono); font-size: clamp(4rem, 14vw, 9rem); line-height: 1; }

.site-footer { border-top: 1px solid var(--outline); background: var(--bg-deep); }
.footer-shell { min-height: 120px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; }
.footer-copy { color: var(--subtle); text-align: center; font-family: var(--mono); font-size: 0.72rem; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--gold); text-decoration: none; font-family: var(--mono); font-size: 0.75rem; }

@media (max-width: 900px) {
  .nav-shell { grid-template-columns: 1fr auto; }
  .nav-links {
    position: absolute;
    top: 78px;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-bottom: 1px solid var(--outline);
    padding: 14px 20px 20px;
    background: rgba(11, 13, 13, 0.98);
  }
  .nav-links[data-open="true"] { display: flex; }
  .nav-links a { padding: 12px 4px; }
  .nav-links a[aria-current="page"]::after { right: auto; width: 44px; }
  .menu-toggle { display: inline-grid; place-items: center; }
  .nav-hire { display: none; }
  .hero { grid-template-columns: 1fr; }
  .profile-card, .profile-card > img { min-height: 540px; height: 540px; }
  .home-grid .wide, .home-grid .small { grid-column: span 12; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .skills-grid .span-7, .skills-grid .span-5, .skills-grid .span-6,
  .project-grid .span-8, .project-grid .span-4, .project-grid .span-5, .project-grid .span-7 { grid-column: span 12; }
  .project-feature { grid-template-columns: 1fr; }
  .project-image { min-height: 310px; }
  .automation-card { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .cta { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 620px) {
  .nav-shell, .page-shell, .footer-shell { width: min(calc(100% - 28px), var(--max)); }
  .page-shell { padding-top: 112px; }
  .hero { margin-bottom: 54px; }
  .hero h1 { font-size: clamp(2.15rem, 12vw, 3.1rem); }
  .profile-card, .profile-card > img { min-height: 455px; height: 455px; }
  .profile-stats { right: 12px; bottom: 12px; left: 12px; }
  .stat { padding: 10px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 125px; padding: 18px 10px; }
  .progress-row, .split-notes, .field-grid { grid-template-columns: 1fr; }
  .actions .button { width: 100%; }
  .card, .project-body { padding: 23px; }
  .project-feature { padding: 0; }
  .security-card { padding: 0; }
  .project-image { min-height: 250px; }
  .resume-paper { padding: 23px; }
  .resume-header { display: block; }
  .resume-contact { margin-top: 14px; text-align: left; }
  .footer-shell { grid-template-columns: 1fr; justify-items: center; padding: 28px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #111; }
  body::before, .site-header, .site-footer, .resume-actions { display: none !important; }
  .page-shell { width: 100%; padding: 0; }
  .resume-paper { border: 0; box-shadow: none; background: #fff; color: #111; }
  .resume-paper .muted, .resume-paper p { color: #333; }
  .resume-section h2 { color: #782f40; }
  a { color: #111; text-decoration: none; }
}
