/* ==========================================================================
   STEFANO MIKHAIEL — PORTFOLIO
   Design system: technical drawing / construction document aesthetic
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Color tokens */
  --ink: #12161C;
  --paper: #F7F5F0;
  --paper-dim: #EFEBE2;
  --blueprint: #1A2332;
  --blueprint-light: #263349;
  --redline: #C8461E;
  --line: #8A9199;
  --line-faint: #D7D3C8;
  --verified: #2D5C4E;
  --verified-bg: #E4EBE7;

  /* Type */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Source Serif 4', serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout */
  --max-width: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --grid-unit: 8px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@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;
    scroll-behavior: auto !important;
  }
}
body, h1, h2, h3, h4, p, figure { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: none; cursor: pointer; color: inherit; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  position: relative;
}

/* ---------- Construction grid background ---------- */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-faint) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.35;
}

/* Reference cross markers */
.crossmark {
  position: absolute;
  width: 16px;
  height: 16px;
  pointer-events: none;
  opacity: 0.5;
}
.crossmark::before, .crossmark::after {
  content: '';
  position: absolute;
  background: var(--line);
}
.crossmark::before { width: 100%; height: 1px; top: 50%; left: 0; }
.crossmark::after { width: 1px; height: 100%; left: 50%; top: 0; }
.crossmark--tl { top: 12px; left: 12px; }
.crossmark--tr { top: 12px; right: 12px; }
.crossmark--bl { bottom: 12px; left: 12px; }
.crossmark--br { bottom: 12px; right: 12px; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--blueprint);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--redline);
  display: flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--redline);
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.75rem);
  line-height: 1.1;
  margin-top: 0.5rem;
}

/* ---------- Layout helpers ---------- */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  position: relative;
}

section {
  position: relative;
  z-index: 1;
  padding: clamp(3.5rem, 8vw, 7rem) 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(247, 245, 240, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-faint);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--blueprint);
}
.logo span { color: var(--redline); }

.nav-links {
  display: flex;
  gap: clamp(1rem, 2vw, 2rem);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav-links a {
  position: relative;
  padding-bottom: 4px;
  transition: color 0.2s ease;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--redline);
  transition: width 0.25s ease;
}
.nav-links a:hover::after,
.nav-links a:focus-visible::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--blueprint);
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line-faint);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .nav-links.is-open { max-height: 400px; }
  .nav-links a {
    padding: 1rem var(--gutter);
    width: 100%;
    border-bottom: 1px solid var(--line-faint);
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.85em 1.5em;
  border: 1px solid var(--blueprint);
  transition: background 0.2s ease, color 0.2s ease;
}
.btn--primary {
  background: var(--blueprint);
  color: var(--paper);
}
.btn--primary:hover { background: var(--redline); border-color: var(--redline); }
.btn--ghost {
  background: transparent;
  color: var(--blueprint);
}
.btn--ghost:hover { background: var(--blueprint); color: var(--paper); }

/* ---------- Focus states ---------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--redline);
  outline-offset: 3px;
}

/* ---------- Utility ---------- */
.mono { font-family: var(--font-mono); }
.text-muted { color: var(--line); }
