/* =========================================================
   Justin Wagner — personal site
   Aesthetic: industrial-precise. Deep slate ink, amber signal,
   technical Cabinet Grotesk display + Satoshi body.
   ========================================================= */

:root {
  /* Brand palette */
  --ink:        #0E1116;   /* primary surface (dark) */
  --ink-2:      #14181F;   /* elevated dark */
  --ink-3:      #1B2029;   /* card on dark */
  --paper:      #F5F4EF;   /* primary surface (light) */
  --paper-2:    #ECEAE3;   /* alt surface */
  --paper-3:    #E0DDD4;   /* borders / hairlines */
  --text:       #14181F;
  --text-muted: #5B6270;
  --text-faint: #8A8F99;
  --text-inv:   #F5F4EF;
  --text-inv-muted: #A8ADB7;

  /* Accent: industrial amber / signal */
  --accent:       #E08A1A;
  --accent-hover: #BF6F0E;
  --accent-soft:  #F5B454;

  /* Secondary: steel blue (used sparingly for chips) */
  --steel:       #5B7894;

  /* Type */
  --font-display: 'Cabinet Grotesk', 'Satoshi', system-ui, sans-serif;
  --font-body:    'Satoshi', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Scale (fluid) */
  --text-xs:  clamp(11.5px, 0.74vw + 10px, 13px);
  --text-sm:  clamp(13px,   0.3vw + 12px,  14.5px);
  --text-base:clamp(15.5px, 0.3vw + 14px,  17px);
  --text-md:  clamp(17px,   0.6vw + 15px,  20px);
  --text-lg:  clamp(20px,   0.9vw + 17px,  24px);
  --text-xl:  clamp(26px,   1.8vw + 20px,  36px);
  --text-2xl: clamp(34px,   3vw   + 22px,  56px);
  --text-hero:clamp(44px,   5.5vw + 24px,  96px);

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* Layout */
  --container: 1200px;
  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 0 rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.05);
  --shadow:    0 4px 24px rgba(14,17,22,.08);
  --shadow-lg: 0 24px 60px -16px rgba(14,17,22,.25);

  --ease: cubic-bezier(.16,1,.3,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
::selection { background: var(--accent); color: var(--ink); }

/* ---------- Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 40px);
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--text-inv);
  padding: 10px 14px; border-radius: 6px;
  z-index: 100;
}
.skip-link:focus { left: 16px; top: 16px; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245,244,239,0.7);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--paper-3);
  background: rgba(245,244,239,0.85);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: var(--text-sm);
}
.brand-mark {
  width: 32px; height: 32px;
  color: var(--ink);
  flex: 0 0 32px;
}
.brand-mark.sm { width: 28px; height: 28px; }
.brand-name { white-space: nowrap; }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
  font-size: var(--text-sm);
  font-weight: 500;
}
.site-nav a {
  color: var(--text-muted);
  transition: color .15s ease;
}
.site-nav a:hover { color: var(--ink); }
.site-nav .nav-cta {
  color: var(--ink);
  background: var(--ink);
  color: var(--text-inv);
  padding: 8px 14px;
  border-radius: 999px;
  transition: background .2s ease, transform .2s var(--ease);
}
.site-nav .nav-cta:hover { background: var(--accent); color: var(--ink); }

@media (max-width: 560px) {
  .site-nav a:not(.nav-cta) { display: none; }
  .brand-name { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(64px, 10vw, 124px) 0 clamp(56px, 9vw, 112px);
  overflow: hidden;
  background: var(--paper);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(20,24,31,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20,24,31,0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 80%);
  pointer-events: none;
}
.hero::before {
  content: "";
  position: absolute;
  inset: auto -10% -40% -10%;
  height: 60%;
  background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(224,138,26,.08), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: center;
  gap: clamp(40px, 6vw, 88px);
}

.hero-copy { min-width: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--space-6);
  padding: 6px 12px;
  background: var(--paper-2);
  border: 1px solid var(--paper-3);
  border-radius: 999px;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(224,138,26,.18);
}

.display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-hero);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0 0 var(--space-8);
  color: var(--ink);
  max-width: 16ch;
}
.display em {
  display: inline-block;
  font-style: italic;
  font-family: 'Cabinet Grotesk', serif;
  color: var(--accent);
  font-weight: 800;
  margin-right: 0.08em;
}

.lede {
  font-size: var(--text-md);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 58ch;
  margin: 0 0 var(--space-10);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-16);
}

.hero-photo {
  position: relative;
  align-self: center;
  margin: 0 0 var(--space-12);
  border-radius: 28px;
  padding: 10px;
  background:
    linear-gradient(145deg, rgba(245,244,239,.92), rgba(236,234,227,.7)),
    var(--paper-2);
  border: 1px solid rgba(20,24,31,.12);
  box-shadow: var(--shadow-lg);
}

.hero-photo::before {
  content: "";
  position: absolute;
  inset: -18px -18px auto auto;
  width: 96px;
  height: 96px;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  opacity: .85;
  border-top-right-radius: 18px;
  pointer-events: none;
}

.hero-photo::after {
  content: "";
  position: absolute;
  inset: auto auto -14px -14px;
  width: 120px;
  height: 120px;
  background-image:
    linear-gradient(to right, rgba(20,24,31,.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20,24,31,.12) 1px, transparent 1px);
  background-size: 12px 12px;
  mask-image: linear-gradient(135deg, #000, transparent 72%);
  -webkit-mask-image: linear-gradient(135deg, #000, transparent 72%);
  pointer-events: none;
}

.hero-photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
  border-radius: 20px;
  filter: saturate(.95) contrast(1.02);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: -0.005em;
  transition: transform .2s var(--ease), background .2s ease, color .2s ease, border-color .2s ease, box-shadow .25s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: var(--text-inv);
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 10px 24px -10px rgba(14,17,22,.5);
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--ink);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--paper-3);
}
.btn-ghost:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

/* Hero stats */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: var(--space-6);
  grid-column: 1 / -1;
  margin: 0;
  padding-top: var(--space-8);
  border-top: 1px solid var(--paper-3);
}
.hero-stats > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hero-stats dt {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.hero-stats dd {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink);
}
.hero-stats a { border-bottom: 1px dashed var(--paper-3); transition: border-color .2s ease, color .2s ease; }
.hero-stats a:hover { border-bottom-color: var(--accent); color: var(--accent-hover); }

@media (max-width: 720px) {
  .hero-stats { grid-template-columns: 1fr; gap: var(--space-4); }
}

@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hero-photo {
    width: min(420px, 100%);
    margin: calc(-1 * var(--space-6)) 0 var(--space-12);
  }
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(64px, 10vw, 140px) 0;
  position: relative;
}
.section-alt {
  background: var(--paper-2);
  border-top: 1px solid var(--paper-3);
  border-bottom: 1px solid var(--paper-3);
}

.section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-hover);
  margin: 0 0 var(--space-4);
}
.section-label.inverse { color: var(--accent-soft); }

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-2xl);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 var(--space-4);
  max-width: 18ch;
}

.section-sub {
  color: var(--text-muted);
  font-size: var(--text-md);
  max-width: 56ch;
  margin: 0 0 var(--space-12);
}

.section-head { margin-bottom: var(--space-12); }

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.col-side { position: sticky; top: 96px; }
@media (max-width: 880px) {
  .two-col { grid-template-columns: 1fr; gap: var(--space-8); }
  .col-side { position: static; }
}

/* ---------- About ---------- */
.prose-lg {
  font-size: var(--text-md);
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 var(--space-6);
  letter-spacing: -0.005em;
}
.col-main p {
  color: var(--text-muted);
  font-size: var(--text-base);
  line-height: 1.65;
  margin: 0 0 var(--space-5);
  max-width: 62ch;
}
.col-main p:last-of-type { margin-bottom: var(--space-8); }

.chip-list {
  display: flex; flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0; margin: var(--space-6) 0 0;
}
.chip-list li {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  background: var(--paper);
  border: 1px solid var(--paper-3);
  border-radius: 999px;
  color: var(--text-muted);
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.chip-list li:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* ---------- Focus cards ---------- */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 1px;
  background: var(--paper-3);
  border: 1px solid var(--paper-3);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
@media (max-width: 720px) {
  .focus-grid { grid-template-columns: 1fr; }
}
.focus-card {
  background: var(--paper);
  padding: clamp(28px, 3.5vw, 44px);
  position: relative;
  transition: background .25s ease, transform .25s var(--ease);
}
.focus-card:hover { background: var(--paper-2); }

.focus-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  color: var(--accent-hover);
  display: inline-block;
  margin-bottom: var(--space-5);
}
.focus-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-3);
  color: var(--ink);
}
.focus-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-base);
  line-height: 1.6;
  max-width: 48ch;
}

/* ---------- Now / Work ---------- */
.now-card {
  padding: var(--space-8) 0;
  border-top: 1px solid var(--paper-3);
}
.now-card:first-child { border-top: 0; padding-top: 0; }
.now-card:last-child { padding-bottom: 0; }

.now-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: var(--space-3);
}
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--accent-soft);
  font-size: 10.5px;
  letter-spacing: 0.12em;
}
.badge-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--paper-3);
}
.now-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-3);
  color: var(--ink);
}
.now-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-base);
  line-height: 1.65;
  max-width: 62ch;
}
.now-card p a {
  color: var(--ink);
  border-bottom: 1px solid var(--paper-3);
  transition: border-color .2s ease, color .2s ease;
}
.now-card p a:hover { border-bottom-color: var(--accent); color: var(--accent-hover); }

/* ---------- Connect ---------- */
.section-connect {
  background: var(--ink);
  color: var(--text-inv);
  position: relative;
  overflow: hidden;
}
.section-connect::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 50%;
  background: radial-gradient(ellipse 50% 100% at 50% 0%, rgba(224,138,26,.18), transparent 70%);
  pointer-events: none;
}
.section-connect::after {
  /* subtle factory-floor grid */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(245,244,239,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(245,244,239,0.04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, #000 30%, transparent 85%);
  pointer-events: none;
}
.connect-inner { position: relative; z-index: 1; max-width: 900px; }
.display-md {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-2xl);
  letter-spacing: -0.028em;
  line-height: 1.02;
  margin: 0 0 var(--space-5);
  color: var(--text-inv);
  max-width: 18ch;
}
.connect-sub {
  color: var(--text-inv-muted);
  font-size: var(--text-md);
  max-width: 60ch;
  margin: 0 0 var(--space-12);
}

.connect-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: var(--space-3);
}
@media (max-width: 720px) {
  .connect-grid { grid-template-columns: 1fr; }
}

.contact-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 4px 12px;
  padding: var(--space-6);
  background: var(--ink-2);
  border: 1px solid rgba(245,244,239,0.08);
  border-radius: var(--radius);
  color: var(--text-inv);
  transition: background .25s ease, border-color .25s ease, transform .25s var(--ease);
}
.contact-card:hover {
  background: var(--ink-3);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.contact-card:hover .contact-arrow { color: var(--accent); transform: translate(2px,-2px); }
.contact-label {
  grid-column: 1;
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-soft);
  font-weight: 600;
}
.contact-value {
  grid-column: 1;
  font-size: var(--text-base);
  font-weight: 500;
  word-break: break-word;
}
.contact-arrow {
  grid-column: 2;
  grid-row: 1 / 3;
  width: 18px; height: 18px;
  color: var(--text-inv-muted);
  transition: color .2s ease, transform .2s var(--ease);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--paper-2);
  border-top: 1px solid var(--paper-3);
  padding: var(--space-12) 0;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.footer-brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); font-weight: 700;
  font-family: var(--font-display);
}
.footer-meta { margin: 0; }
.footer-nav { display: flex; gap: var(--space-5); }
.footer-nav a { transition: color .15s ease; }
.footer-nav a:hover { color: var(--ink); }

@media (max-width: 560px) {
  .footer-inner { flex-direction: column; align-items: flex-start; gap: var(--space-4); }
}

/* ---------- Reveal animation ----------
   Subtle; only triggers when JS adds .js-reveal-ready to <html>.
   Without JS or if disabled, everything is fully visible. */
html.js-reveal-ready [data-reveal],
html.js-reveal-ready .focus-card,
html.js-reveal-ready .now-card,
html.js-reveal-ready .contact-card {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.focus-card:nth-child(2) { transition-delay: .05s; }
.focus-card:nth-child(3) { transition-delay: .1s; }
.focus-card:nth-child(4) { transition-delay: .15s; }
.is-in { opacity: 1 !important; transform: none !important; }

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