:root {
  /* Vintage palette: #E73F1E · #FB6C00 · #F9B637 · #FFDD9C (colorhunt) */
  --vintage-red: #E73F1E;
  --vintage-orange: #FB6C00;
  --vintage-gold: #F9B637;
  --vintage-sand: #FFDD9C;

  --bg: #FFF8EC;
  --bg-alt: #FFF0D4;
  --surface: #FFFDF8;
  --text: #2A1810;
  --muted: #6E4A38;
  --border: #F2D9A8;
  --accent: #C8351A;        /* deepened vintage red so text/buttons meet WCAG AA */
  --accent-strong: #A82A13;
  --accent-contrast: #FFF8EC;
  --glow: var(--vintage-gold);
  --glow-2: var(--vintage-orange);
  --error: #b42318;
  --success: #067647;
  --radius: 14px;
  --max: 1100px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1E1410;
    --bg-alt: #251912;
    --surface: #2E2018;
    --text: #FFF0D4;
    --muted: #D9BE98;
    --border: #4A3326;
    --accent: var(--vintage-gold);
    --accent-strong: var(--vintage-sand);
    --accent-contrast: #1E1410;
    --glow: var(--vintage-orange);
    --glow-2: var(--vintage-red);
    --error: #fda29b;
    --success: #75e0a7;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5vw + 1rem, 3.75rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 2vw + 1rem, 2.4rem); letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-contrast);
  padding: 8px 14px; z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

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

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
/* Retro four-colour stripe across the top of the header */
.site-header::before {
  content: ""; display: block; height: 5px;
  background: linear-gradient(90deg,
    var(--vintage-red) 0 25%, var(--vintage-orange) 25% 50%,
    var(--vintage-gold) 50% 75%, var(--vintage-sand) 75% 100%);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.brand img { border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav-links a:not(.btn) { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav-links a:not(.btn):hover { color: var(--text); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: 999px;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
  font: inherit; font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: transparent; color: var(--accent-strong); }
.btn-small { padding: 7px 16px; font-size: .95rem; }

/* Hero */
.hero {
  padding: clamp(64px, 12vw, 140px) 0 clamp(56px, 10vw, 120px);
  background:
    radial-gradient(60% 80% at 85% 0%, color-mix(in srgb, var(--glow) 22%, transparent), transparent 70%),
    radial-gradient(50% 70% at 0% 100%, color-mix(in srgb, var(--glow-2) 16%, transparent), transparent 70%);
}
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 700; color: var(--accent); }
.lead { font-size: clamp(1.1rem, 1vw + .9rem, 1.3rem); color: var(--muted); max-width: 640px; }
.hero h1 { max-width: 780px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

/* Hero globe: sits beside the copy (never on top of it), aligned toward the bottom */
.hero-grid { display: grid; gap: 40px; align-items: end; }
.hero-art { justify-self: center; width: min(70vw, 280px); }
.hero-art img, .hero-art svg {
  display: block;
  width: 100%; height: auto;
  filter: drop-shadow(0 24px 40px color-mix(in srgb, var(--vintage-red) 28%, transparent));
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(340px, 460px); gap: 40px; }
  .hero-art { width: 100%; transform: translateY(24px); }
}

/* Sections */
.section { padding: clamp(56px, 9vw, 100px) 0; }
.section-alt { background: var(--bg-alt); }
.section-intro { color: var(--muted); max-width: 620px; }

.cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 32px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}
.card p { color: var(--muted); margin: 0; }

.steps {
  list-style: none; padding: 0; margin: 32px 0 0;
  display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  counter-reset: step;
}
.steps li { counter-increment: step; position: relative; padding-top: 52px; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; top: 0; left: 0;
  font-weight: 800; font-size: 1.6rem; color: var(--accent);
}
.steps p { color: var(--muted); margin: 0; }

/* Contact */
.contact-grid { display: grid; gap: 40px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .contact-grid { grid-template-columns: 1fr 1.2fr; align-items: start; } }

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 32px);
}
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.field [aria-invalid="true"] { border-color: var(--error); }
.hp { position: absolute; left: -9999px; }
.form-status { margin: 14px 0 0; min-height: 1.6em; font-weight: 500; }
.form-status.is-error { color: var(--error); }
.form-status.is-success { color: var(--success); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: .95rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.site-footer p { margin: 0; }
.footer-inner { align-items: flex-start; gap: 20px; }
.footer-company { display: grid; gap: 6px; }
.footer-name { font-weight: 700; color: var(--text); }
.site-footer address { font-style: normal; line-height: 1.5; }
.footer-ids, .footer-copy { font-size: .88rem; }
.site-footer .footer-copy { margin-top: 6px; }
.site-footer a { color: var(--muted); }

/* Small screens */
@media (max-width: 560px) {
  .nav-links li:not(:last-child) { display: none; }
  .hero-actions .btn { flex: 1 1 100%; text-align: center; }
}

/* 404 */
.notfound { min-height: 70vh; display: grid; place-items: center; text-align: center; }

/* Social links */
.social { display: flex; gap: 16px; list-style: none; margin: 0; padding: 0; }
.social a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.social a:hover { color: var(--accent); }

/* Hero highlights */
.highlights {
  list-style: none; margin: 48px 0 0; padding: 24px 0 0;
  border-top: 1px solid var(--border);
  display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.highlights li { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hl-icon { margin-bottom: 8px; }
.hl-shield { fill: color-mix(in srgb, var(--vintage-gold) 30%, transparent); stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; }
.hl-mark { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* LEI trust strip */
.trust-strip {
  position: relative;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--vintage-gold) 18%, transparent), transparent 60%),
    var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 22px 0;
}
/* Same four-colour stripe as the header */
.trust-strip::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg,
    var(--vintage-red) 0 25%, var(--vintage-orange) 25% 50%,
    var(--vintage-gold) 50% 75%, var(--vintage-sand) 75% 100%);
}
.trust-icon { filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--vintage-red) 30%, transparent)); }
.trust-badge {
  display: inline-block; margin-right: 8px; padding: 2px 10px;
  border-radius: 999px; background: var(--accent); color: var(--accent-contrast);
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  vertical-align: 2px;
}
.trust-inner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.trust-icon { flex: none; width: 44px; height: 44px; }
.trust-inner p { margin: 0; flex: 1 1 320px; color: var(--muted); font-size: .98rem; }
.trust-inner strong { color: var(--text); }
.lei {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em; padding: 1px 6px; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  word-break: break-all;
}
.trust-link { font-weight: 600; white-space: nowrap; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.highlights strong { font-size: 1.25rem; color: var(--text); }
.highlights span { color: var(--muted); font-size: .95rem; }

/* Compact cards (experience) */
.cards-compact .card { padding: 22px; }
.section-alt .card { background: var(--surface); }

/* Technology tags */
.stack-title { margin-top: 48px; }
.tags { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.tags li {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: .95rem; font-weight: 500;
}

/* Cookie consent banner */
.cookie-banner {
  position: fixed; z-index: 50;
  left: 16px; right: 16px; bottom: 16px;
  max-width: 560px; margin-left: auto;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(42, 24, 16, .18);
  padding: 18px 20px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; flex: 1 1 260px; font-size: .95rem; }
.cookie-actions { display: flex; gap: 10px; }

.link-button {
  background: none; border: 0; padding: 0; margin-left: 12px;
  font: inherit; color: inherit; text-decoration: underline; cursor: pointer;
}
.link-button[hidden] { display: none; }
