/* ============================================================
   Jonathan King — Portfolio
   Styles per DesignSpec sections 2 (tokens), 3-13 (sections), 15 (mobile)
   ============================================================ */

:root {
  /* 2.1 color */
  --bg:      #0A0C10;
  --bg2:     #0F1117;
  --bg3:     #161A24;
  --bg4:     #1D2232;
  --amber:   #E8A020;
  --amber2:  #C47010;
  --amber3:  #F5C060;
  --amberdim: rgba(232,160,32,0.10);
  --rule:    rgba(255,255,255,0.07);
  --rule2:   rgba(255,255,255,0.12);
  --text:    #E2E6F0;
  --muted:   #8892A8;
  --dim:     #404860;
  --white:   #FFFFFF;

  /* 2.2 type */
  --display: 'Space Grotesk', system-ui, sans-serif;
  --body:    'Inter', system-ui, sans-serif;
  --mono:    'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* 2.5 grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px;
}

/* 2.3 spacing helpers */
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 52px;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* 2.2 type scale */
h1, h2, h3, h4 { font-family: var(--display); color: var(--white); }
h1.hero-h1 {
  font-size: clamp(44px, 4.8vw, 68px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.06;
  color: var(--white);
  margin: 24px 0 28px;
}
.section-h2 {
  font-size: clamp(32px, 3.8vw, 52px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--white);
  margin: 16px 0 24px;
}
.section-sub {
  font-size: 16px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.85;
  max-width: 760px;
}

/* eyebrow + tags */
.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
}
.eyebrow-prefixed {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow-prefixed::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--amber);
}

.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--dim);
  background: var(--bg3);
  border: 0.5px solid var(--rule2);
  border-radius: 2px;
  padding: 4px 8px;
}

.hl { color: var(--amber); }

/* section rule */
.section-rule {
  height: 0.5px;
  background: linear-gradient(90deg, transparent, var(--rule2) 20%, var(--rule2) 80%, transparent);
  margin-bottom: 48px;
}

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 18px 0;
  background: transparent;
  border-bottom: 0.5px solid transparent;
  transition: background 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
}
.nav.scrolled {
  background: rgba(10,12,16,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 0.5px solid var(--rule2);
}
.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-logo {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--amber);
  letter-spacing: 0.06em;
}
.nav-links {
  display: flex;
  gap: 32px;
}
.nav-links a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--bg);
  background: var(--amber);
  padding: 8px 20px;
  border-radius: 2px;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--amber2); color: var(--white); }

/* ============ HERO ============ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 100px 0 60px;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: center;
  width: 100%;
}
.hero-left { padding: 100px 64px 60px 0; }
.hero-sub {
  color: var(--muted);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 540px;
}
.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 12px 22px;
  border-radius: 2px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
  border: 0.5px solid transparent;
}
.btn-primary {
  background: var(--amber);
  color: var(--bg);
}
.btn-primary:hover { background: var(--amber2); color: var(--white); }
.btn-secondary {
  background: transparent;
  border-color: var(--rule2);
  color: var(--muted);
}
.btn-secondary:hover {
  border-color: var(--amber);
  color: var(--white);
}
.cert-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hero-right { display: flex; align-items: center; justify-content: center; }
.constellation { width: 100%; max-width: 560px; height: auto; }

/* hero fade-up animation */
.fa { opacity: 0; transform: translateY(24px); animation: fadeUp 0.65s ease forwards; }
.fa.d1 { animation-delay: 0.1s; }
.fa.d2 { animation-delay: 0.22s; }
.fa.d3 { animation-delay: 0.36s; }
.fa.d4 { animation-delay: 0.48s; }
.fa.d5 { animation-delay: 0.62s; }
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ============ STATS ============ */
.stats {
  background: var(--bg3);
  border-top: 0.5px solid var(--rule2);
  border-bottom: 0.5px solid var(--rule2);
  padding: 44px 0;
}
.stats-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.stat-block {
  text-align: center;
  padding: 8px 0;
  border-right: 0.5px solid var(--rule2);
}
.stat-block:last-child { border-right: none; }
.stat-num {
  font-family: var(--display);
  font-size: 42px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 8px;
}

/* ============ ABOUT ============ */
.about { padding: 120px 0; }
.about-grid {
  display: grid;
  grid-template-columns: 300px 1fr 280px;
  gap: 56px;
  align-items: start;
  margin-top: 64px;
}
.about-photo-wrap {
  position: relative;
  border-radius: 2px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--bg2);
  border: 0.5px solid var(--rule2);
}
.about-photo {
  display: block;
  position: relative;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: grayscale(8%) contrast(1.02);
  transition: filter 0.4s;
}
.about-photo:hover { filter: grayscale(0%) contrast(1.04); }
.about-photo::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(10,12,16,0.35) 100%);
  pointer-events: none;
}
.photo-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bg2), var(--bg3));
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-align: center;
  padding: 16px;
  gap: 12px;
}
.photo-initials {
  font-family: var(--display);
  font-size: 64px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: -0.02em;
}
.photo-note code {
  font-family: var(--mono);
  color: var(--amber);
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 2px;
}

.pull-quote {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  color: var(--white);
  line-height: 1.5;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}
.about-text p {
  color: var(--muted);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.9;
  margin-bottom: 18px;
}
.about-text p:last-child { margin-bottom: 0; }

.about-links { display: flex; flex-direction: column; gap: 12px; }
.about-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg2);
  border: 0.5px solid var(--rule2);
  border-radius: 2px;
  transition: background 0.2s, border-color 0.2s;
}
.about-link:hover {
  background: var(--bg3);
  border-color: var(--amber);
}
.about-link-icon {
  width: 36px; height: 36px;
  background: var(--amberdim);
  border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.about-link-text { flex: 1; min-width: 0; }
.about-link-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--amber);
  text-transform: uppercase;
  margin-bottom: 2px;
}
.about-link-value {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.about-link-arrow {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 14px;
}

.availability-card {
  padding: 18px 20px;
  background: var(--bg2);
  border: 0.5px solid var(--rule2);
  border-radius: 2px;
}
.availability-title {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--amber);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.availability-list li {
  position: relative;
  padding-left: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.availability-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 4px; height: 4px;
  background: var(--amber);
  border-radius: 50%;
}

/* ============ TIMELINE ============ */
.timeline-section {
  background: var(--bg2);
  border-top: 0.5px solid var(--rule2);
  border-bottom: 0.5px solid var(--rule2);
  padding: 120px 0;
}
.timeline { margin-top: 64px; }
.tl-item {
  display: grid;
  grid-template-columns: 240px 1fr;
  border-top: 0.5px solid var(--rule);
  padding: 32px 0;
}
.tl-item:last-child { border-bottom: 0.5px solid var(--rule); }
.tl-company {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.tl-date {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
}
.tl-role {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
  margin-bottom: 8px;
}
.tl-desc {
  font-size: 13px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 12px;
}
.tl-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ============ CERTS ============ */
.certs {
  background: var(--bg3);
  border-top: 0.5px solid var(--rule2);
  border-bottom: 0.5px solid var(--rule2);
  padding: 80px 0;
}
.certs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 48px;
}
.cert-card {
  background: var(--bg2);
  border: 0.5px solid var(--rule2);
  border-radius: 2px;
  padding: 28px 24px;
  transition: border-color 0.2s, background 0.2s;
}
.cert-card:hover {
  border-color: rgba(232,160,32,0.4);
}
.cert-icon {
  width: 38px; height: 38px;
  background: var(--amberdim);
  border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.cert-name {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}
.cert-full {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  line-height: 1.5;
}
.cert-issuer {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--amber);
  letter-spacing: 0.06em;
}

/* ============ SKILLS + COMPLIANCE ============ */
.skills {
  background: var(--bg2);
  border-top: 0.5px solid var(--rule2);
  border-bottom: 0.5px solid var(--rule2);
  padding: 120px 0;
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rule2);
  border: 0.5px solid var(--rule2);
  border-radius: 2px;
  overflow: hidden;
  margin: 64px 0 48px;
}
.skill-cell {
  background: var(--bg2);
  padding: 24px 22px;
  transition: background 0.22s;
}
.skill-cell:hover { background: var(--bg3); }
.skill-cat {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}
.skill-list li {
  font-size: 13px;
  color: var(--text);
  position: relative;
  padding-left: 14px;
  margin-bottom: 6px;
  opacity: 0.7;
}
.skill-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 4px; height: 4px;
  background: var(--amber);
  opacity: 0.5;
  border-radius: 50%;
}
.skill-list li.strong {
  color: var(--white);
  opacity: 1;
}
.skill-list li.strong::before { opacity: 1; }

.fw-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.fw-card {
  background: var(--bg2);
  border: 0.5px solid var(--rule2);
  border-radius: 2px;
  padding: 22px 18px;
  transition: border-color 0.2s, background 0.2s;
}
.fw-card:hover {
  border-color: rgba(232,160,32,0.28);
  background: var(--bg3);
}
.fw-name {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: 10px;
}
.fw-desc {
  font-size: 12px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.7;
}

/* ============ WORK ============ */
.work { padding: 120px 0; }
.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule2);
  margin-top: 64px;
}
.work-card {
  background: var(--bg2);
  padding: 40px;
  transition: background 0.2s;
}
.work-card:hover { background: var(--bg3); }
.work-card.featured {
  background: var(--bg3);
  border-left: 2px solid var(--amber);
}
.work-card.featured:hover { background: var(--bg4); }
.work-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}
.work-title {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.25;
  margin-bottom: 12px;
}
.work-org {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--amber);
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.work-desc {
  font-size: 13px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 20px;
}
.work-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 20px 0;
}
.work-stats > div { min-width: 0; }
.ws-num {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  color: var(--amber3);
  letter-spacing: -0.02em;
  line-height: 1;
}
.ws-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 6px;
}

/* ============ CONTACT ============ */
.contact {
  background: var(--bg2);
  border-top: 0.5px solid var(--rule2);
  padding: 120px 0;
}
.contact-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 80px;
  align-items: start;
}
.contact-sub {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
  max-width: 440px;
  margin-bottom: 28px;
}
.trust-list { display: flex; flex-direction: column; gap: 10px; }
.trust-list li {
  position: relative;
  padding-left: 16px;
  color: var(--muted);
  font-size: 13px;
}
.trust-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 4px; height: 4px;
  background: var(--amber);
  border-radius: 50%;
}

.contact-box {
  background: var(--bg3);
  border: 0.5px solid var(--rule2);
  border-radius: 2px;
  padding: 36px;
  min-width: 340px;
}
.contact-box-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--amber);
  letter-spacing: 0.12em;
  margin-bottom: 20px;
}
.contact-box form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.contact-box input,
.contact-box select,
.contact-box textarea {
  width: 100%;
  background: var(--bg);
  border: 0.5px solid var(--rule2);
  border-radius: 2px;
  padding: 11px 14px;
  color: var(--text);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 300;
  transition: border-color 0.2s;
  outline: none;
}
.contact-box input:focus,
.contact-box select:focus,
.contact-box textarea:focus {
  border-color: rgba(232,160,32,0.4);
}
.contact-box textarea { min-height: 80px; resize: vertical; font-family: var(--body); }
.contact-box select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.contact-box select option { background: var(--bg); color: var(--text); }
.form-note {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  text-align: center;
  margin-top: 4px;
}

/* ============ FOOTER ============ */
.footer {
  border-top: 0.5px solid var(--rule2);
  padding: 36px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-name {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--amber);
  letter-spacing: 0.08em;
}
.footer-links {
  display: flex;
  gap: 24px;
}
.footer-links a {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--muted); }
.footer-copy {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
}

/* ============ SCROLL REVEAL ============ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.vis {
  opacity: 1;
  transform: translateY(0);
}

/* ============ MOBILE (15) ============ */
@media (max-width: 960px) {
  .wrap { padding: 0 20px; }
  .nav { padding: 14px 0; }
  .nav-links { display: none; }
  .nav-inner { padding: 0 20px; }
  .nav-cta { display: none; }

  .hero { min-height: auto; padding: 0; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-left { padding: 110px 0 40px 0; }
  .hero-right { display: none; }

  .stats-inner { grid-template-columns: 1fr 1fr; }
  .stat-block { border-right: none; border-bottom: 0.5px solid var(--rule2); }
  .stat-block:nth-child(odd) { border-right: 0.5px solid var(--rule2); }
  .stat-block:nth-last-child(-n+2) { border-bottom: none; }

  .about { padding: 80px 0; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; margin-top: 40px; }
  .about-photo-wrap { max-width: 280px; }

  .timeline-section { padding: 80px 0; }
  .tl-item { grid-template-columns: 1fr; }
  .tl-left { padding-right: 0; padding-bottom: 8px; }

  .certs { padding: 60px 0; }
  .certs-grid { grid-template-columns: 1fr 1fr; }

  .skills { padding: 80px 0; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .fw-row { grid-template-columns: 1fr 1fr; }

  .work { padding: 80px 0; }
  .work-grid { grid-template-columns: 1fr; }

  .contact { padding: 80px 0; }
  .contact-inner { grid-template-columns: 1fr; gap: 48px; }
  .contact-box { min-width: unset; }
}
