/* ============================================================
   Matt Calalay — Portfolio
   Bold editorial / neo-brutalist dark.  Plain CSS, no build step.
   ============================================================ */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "Anton";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("assets/fonts/anton-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("assets/fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("assets/fonts/space-grotesk-600.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("assets/fonts/jetbrains-mono-400.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  --bg: #0a0a0b;
  --surface: #141417;
  --surface-2: #1b1b20;
  --panel: #e9e9e3;
  --panel-line: rgba(10, 10, 11, 0.10);
  --fg: #f7f6f2;
  --fg-dim: #c7c7cd;
  --muted: #9a9aa3;
  --ink: #0a0a0b;
  --border: #2a2a31;
  --border-strong: #050507;

  --teal: #2dd4bf;
  --teal-soft: #5eead4;
  --blue: #60a5fa;
  --amber: #fbbf24;

  --font-display: "Anton", "Arial Narrow", Impact, sans-serif;
  --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --maxw: 1240px;
  --pad: clamp(1.1rem, 4vw, 3rem);
  --shadow-hard: 6px 6px 0 var(--border-strong);
  --radius: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; -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: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 3px;
}

.shell { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--teal); color: var(--ink);
  padding: 0.6rem 1rem; font-family: var(--font-head); font-weight: 600;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 0.7rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand__mark {
  font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.04em;
  color: var(--ink); background: var(--fg);
  width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: 8px;
}
.brand__name { font-family: var(--font-head); font-weight: 600; font-size: 0.82rem; line-height: 1.1; }
.brand__name span { display: block; color: var(--muted); font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.12em; }

.nav { display: flex; align-items: center; gap: clamp(1.1rem, 2.4vw, 2rem); }
.nav__links { display: inline-flex; align-items: center; gap: clamp(1rem, 2vw, 1.8rem); }
.nav a {
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.04em;
  text-decoration: none; color: var(--fg-dim); transition: color 0.18s var(--ease);
}
.nav a:hover { color: var(--fg); }
.nav a.is-active { color: var(--teal); }
.nav__cta {
  font-family: var(--font-head) !important; font-weight: 600;
  color: var(--ink) !important; background: var(--teal);
  padding: 0.5rem 0.9rem; border-radius: 999px;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease);
}
.nav__cta:hover { background: var(--teal-soft); transform: translateY(-1px); }
@media (max-width: 620px) { .nav__links { display: none; } }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(2rem, 6vw, 4.5rem); padding-bottom: 0; }
.hero__display {
  font-family: var(--font-display); text-transform: uppercase;
  font-size: clamp(3.4rem, 15.5vw, 12.5rem); line-height: 0.84;
  letter-spacing: -0.01em; color: var(--fg); margin: 0;
}
.hero__display .line { display: block; }
.hero__display .accent { color: var(--teal); }
.hero__intro {
  display: grid; gap: 1.4rem 2.5rem; grid-template-columns: 1fr;
  margin-top: clamp(1.4rem, 3vw, 2.2rem); align-items: end;
}
@media (min-width: 760px) { .hero__intro { grid-template-columns: 1fr 1fr auto; } }
.hero__intro p { color: var(--fg-dim); max-width: 42ch; font-size: 0.98rem; }
.hero__intro p strong { color: var(--fg); font-weight: 600; font-family: var(--font-head); }

.link-cta {
  font-family: var(--font-head); font-weight: 600; font-size: 0.95rem;
  text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid var(--teal); padding-bottom: 3px;
  transition: color 0.2s var(--ease); display: inline-flex; align-items: center; gap: 0.45rem;
}
.link-cta:hover { color: var(--teal); }
.link-cta .arrow { transition: transform 0.2s var(--ease); }
.link-cta:hover .arrow { transform: translateX(4px); }

/* Stage: light grid panel + arch + cut-out figure + badges */
.hero__stagewrap { position: relative; margin-top: clamp(1.8rem, 4vw, 3rem); }
.hero__stage {
  position: relative; background: var(--surface);
  border-radius: 150px 150px 0 0;
  min-height: clamp(380px, 54vw, 640px);
  overflow: hidden;
}
/* Composited hero portrait: Matt in front of the DevOps lifecycle loop */
.hero__stage::before {
  content: ""; position: absolute; inset: 0;
  background: url("assets/hero-portrait.jpg") center 30% / cover no-repeat;
}
/* Light scrim — settles the edges so the white badges read cleanly */
.hero__stage::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(125% 90% at 50% 35%, transparent 58%, rgba(10, 10, 11, 0.34) 100%),
    linear-gradient(to bottom, rgba(10, 10, 11, 0.10), transparent 24%);
}

.badges { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.badge {
  position: absolute; pointer-events: auto;
  display: flex; align-items: center; gap: 0.65rem;
  font-family: var(--font-mono); font-weight: 400;
  font-size: clamp(0.66rem, 1.05vw, 0.84rem); letter-spacing: 0.02em;
  color: var(--ink); background: var(--fg);
  border: 3px solid var(--border-strong); border-radius: 14px;
  padding: 0.6rem 0.85rem; box-shadow: var(--shadow-hard);
  line-height: 1.2;
}
.badge__logo { width: 2.4rem; height: 2.4rem; object-fit: contain; flex: none; }
.badge__txt b { display: block; font-family: var(--font-head); font-weight: 600; font-size: 1.12em; letter-spacing: -0.01em; }

/* Dev half (left loop): Terraform, GitLab, Docker, Vault */
.badge.b1 { top: 5%;  left: 1%;  transform: rotate(-4deg); }   /* Terraform — Plan/IaC */
.badge.b2 { top: 31%; left: -1%; transform: rotate(2deg); }    /* GitLab — Code/CI */
.badge.b3 { top: 57%; left: 2%;  transform: rotate(3deg); }    /* Docker — Build */
.badge.b5 { bottom: 5%; left: 6%; transform: rotate(-2deg); }  /* Vault — Release */
/* Ops half (right loop): Ansible, Prometheus, Grafana, n8n */
.badge.b7 { top: 5%;  right: 1%;  transform: rotate(3deg); }   /* Ansible — Deploy */
.badge.b4 { top: 31%; right: -1%; transform: rotate(-3deg); }  /* Prometheus — Operate */
.badge.b8 { top: 57%; right: 2%;  transform: rotate(2deg); }   /* Grafana — Monitor */
.badge.b6 { bottom: 5%; right: 6%; transform: rotate(-3deg); } /* n8n — Automation */

/* mobile: badges flow as a static strip below the figure */
@media (max-width: 700px) {
  .hero__stage { border-radius: 120px 120px 0 0; min-height: clamp(300px, 70vw, 460px); }
  .badges {
    position: static; inset: auto; pointer-events: auto;
    display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center;
    padding: 1.1rem 0.4rem 0;
  }
  .badge { position: static; transform: none !important; box-shadow: 4px 4px 0 var(--border-strong); max-width: none; }
}

/* ---------- Section scaffolding ---------- */
.section { padding-block: clamp(3.5rem, 9vw, 7rem); border-top: 1px solid var(--border); }
.section__head { margin-bottom: clamp(2rem, 5vw, 3.2rem); }
.section__index { font-family: var(--font-mono); color: var(--muted); font-size: 0.75rem; letter-spacing: 0.12em; }
.section__title {
  font-family: var(--font-display); text-transform: uppercase;
  font-size: clamp(2.2rem, 7vw, 5rem); line-height: 0.9; letter-spacing: -0.01em; margin-top: 0.45rem;
}

/* ---------- About ---------- */
.about__grid { display: grid; gap: clamp(1.6rem, 4vw, 3rem); grid-template-columns: 1fr; }
@media (min-width: 880px) { .about__grid { grid-template-columns: 1.4fr 1fr; } }
.about__body p { color: var(--fg-dim); margin-bottom: 1.1rem; max-width: 64ch; }
.themes { list-style: none; padding: 0; display: grid; gap: 0.75rem; }
.themes li { position: relative; padding-left: 1.6rem; color: var(--fg-dim); font-size: 0.95rem; }
.themes li::before { content: "\25B9"; position: absolute; left: 0; top: 0; color: var(--teal); font-size: 1rem; }

/* ---------- Experience timeline ---------- */
.timeline { list-style: none; padding: 0; display: grid; gap: 1rem; }
.tl-item {
  display: grid; grid-template-columns: 1fr; gap: 0.3rem 1.5rem;
  padding: 1.3rem 1.4rem; background: var(--surface);
  border: 1px solid var(--border); border-left: 4px solid var(--teal); border-radius: var(--radius);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.tl-item:hover { transform: translateX(4px); background: var(--surface-2); border-left-color: var(--amber); }
@media (min-width: 760px) { .tl-item { grid-template-columns: 200px 1fr; } }
.tl-item .dates { font-family: var(--font-mono); font-size: 0.78rem; color: var(--teal); letter-spacing: 0.02em; }
.tl-item .role { font-family: var(--font-head); font-weight: 600; font-size: 1.12rem; color: var(--fg); }
.tl-item .org { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.4rem; }
.tl-item .summary { color: var(--fg-dim); font-size: 0.94rem; }

/* ---------- Projects ---------- */
.projects__grid { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .projects__grid { grid-template-columns: 1fr 1fr; } }
.project-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.6rem;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.project-card:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow-hard); border-color: var(--border-strong); }
.project-card h3 {
  font-family: var(--font-head); font-weight: 600; font-size: 1.25rem; margin-bottom: 1rem;
  display: flex; align-items: baseline; gap: 0.6rem;
}
.project-card h3::before { content: ""; width: 0.7rem; height: 0.7rem; background: var(--teal); border-radius: 3px; flex: none; transform: translateY(1px); }
.project-card dl { display: grid; gap: 0.15rem 0.9rem; grid-template-columns: auto 1fr; margin: 0; }
.project-card dt {
  font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--amber); padding-top: 0.55rem; align-self: start;
}
.project-card dd { color: var(--fg-dim); font-size: 0.92rem; padding-top: 0.4rem; margin: 0; }
.project-card dd:last-of-type { color: var(--fg); }

/* ---------- Skills ---------- */
.skills__grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.skill-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem 1.4rem 1.5rem; }
.skill-group h3 {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--teal); margin-bottom: 0.9rem;
}
.skill-group ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.skill-group li {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--fg-dim);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0.3rem 0.7rem;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.skill-group li:hover { border-color: var(--teal); color: var(--fg); }

/* ---------- Certifications ---------- */
.cert-grid { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); list-style: none; padding: 0; }
.cert-grid li { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; }
.cert-badge {
  width: 100%; max-width: 230px; aspect-ratio: 1;
  background: #fff; border-radius: 18px;
  display: grid; place-items: center; padding: 1.1rem;
  box-shadow: var(--shadow-hard);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.cert-grid li:hover .cert-badge { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--border-strong); }
.cert-badge img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cert-year { font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); }

/* tools logo strip */
.logo-strip {
  list-style: none; padding: 0; margin: 0 0 clamp(1.8rem, 4vw, 2.6rem);
  display: flex; flex-wrap: wrap; gap: 0.9rem;
}
.logo-strip li {
  width: 4.5rem; height: 4.5rem; flex: none;
  display: grid; place-items: center; padding: 0.75rem;
  background: #fff; border: none; border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.logo-strip li:hover { transform: translateY(-4px); box-shadow: 0 11px 26px rgba(0, 0, 0, 0.38); }
.logo-strip img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- Contact ---------- */
.contact__grid { display: grid; gap: clamp(1.6rem, 4vw, 3rem); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 820px) { .contact__grid { grid-template-columns: 1fr 1.1fr; } }
.contact__lead { color: var(--fg-dim); max-width: 40ch; }
.contact__note { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); margin-top: 1.2rem; }
#contact-form { display: grid; gap: 1rem; }
.form-field { display: grid; gap: 0.4rem; }
.form-field label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.form-field .optional { text-transform: none; letter-spacing: 0; color: var(--muted); opacity: 0.7; font-size: 0.92em; }
.form-field input, .form-field textarea, .form-field select {
  font-family: var(--font-body); font-size: 1rem; color: var(--fg);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.75rem 0.85rem; width: 100%;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.form-field select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239a9aa3' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.9rem center; padding-right: 2.2rem;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { outline: none; border-color: var(--teal); background: var(--surface-2); }
.form-field textarea { resize: vertical; min-height: 130px; }
#contact-form button {
  font-family: var(--font-head); font-weight: 600; font-size: 0.95rem; color: var(--ink);
  background: var(--teal); border: 3px solid var(--border-strong); border-radius: 12px;
  padding: 0.8rem 1.4rem; cursor: pointer; box-shadow: var(--shadow-hard); justify-self: start;
  transition: transform 0.15s var(--ease), background 0.18s var(--ease), box-shadow 0.15s var(--ease);
}
#contact-form button:hover:not(:disabled) { background: var(--teal-soft); }
#contact-form button:active:not(:disabled) { transform: translate(6px, 6px); box-shadow: 0 0 0 var(--border-strong); }
#contact-form button:disabled { opacity: 0.55; cursor: progress; box-shadow: 2px 2px 0 var(--border-strong); }
#form-status { font-family: var(--font-mono); font-size: 0.82rem; color: var(--teal); min-height: 1.2em; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding-block: 2.2rem; color: var(--muted); }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; align-items: center; justify-content: space-between; }
.site-footer p { font-family: var(--font-mono); font-size: 0.76rem; }
.site-footer .tag { color: var(--fg-dim); }

/* ---------- Honeypot (visually hidden) ---------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---------- Reveal animations ---------- */
.js [data-reveal] {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transition-delay: var(--reveal-delay, 0ms); will-change: opacity, transform;
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

.js .hero__display .line { opacity: 0; transform: translateY(0.45em); }
.hero.is-ready .hero__display .line { animation: lineRise 0.85s var(--ease) forwards; }
.hero.is-ready .hero__display .line:nth-child(2) { animation-delay: 0.12s; }
@keyframes lineRise { to { opacity: 1; transform: none; } }

.js .badge { opacity: 0; }
.hero.is-ready .badge { animation: badgeIn 0.5s var(--ease) forwards; }
.hero.is-ready .badge.b1 { animation-delay: 0.40s; }
.hero.is-ready .badge.b2 { animation-delay: 0.48s; }
.hero.is-ready .badge.b3 { animation-delay: 0.56s; }
.hero.is-ready .badge.b4 { animation-delay: 0.64s; }
.hero.is-ready .badge.b5 { animation-delay: 0.72s; }
.hero.is-ready .badge.b6 { animation-delay: 0.80s; }
@keyframes badgeIn { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero__display .line, .badge { opacity: 1 !important; transform: none; animation: none !important; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
