/* ===== Tokens ===== */
:root{
  --bg: #05070d;
  --bg-panel: #0a0f1c;
  --accent: #2b72c4;
  --accent-glow: #4f93d6;
  --accent-dim: rgba(43,114,196,0.35);
  --text: #e9edf6;
  --muted: #5c6b8a;
  --hairline: rgba(43,114,196,0.14);
  --font-sans: 'Space Grotesk', sans-serif;
  --font-serif: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

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

html{ scroll-behavior: smooth; }

body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  position: relative;
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

a{ color: inherit; text-decoration: none; }

::selection{ background: var(--accent-dim); color: #fff; }

/* ===== Background layers ===== */
#signal-canvas{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.55;
  pointer-events: none;
}

.grid-overlay{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--hairline) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.35) 55%, transparent 90%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.35) 55%, transparent 90%);
}

main, nav, footer{ position: relative; z-index: 1; }

/* ===== Nav ===== */
.nav{
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px clamp(24px, 6vw, 100px);
  backdrop-filter: blur(6px);
}

.nav-mark{
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--accent-glow);
  border: 1px solid var(--hairline);
  padding: 6px 10px;
  border-radius: 3px;
}

.nav-links{ display: flex; gap: clamp(16px, 3vw, 36px); }

.nav-links a{
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--muted);
  transition: color 0.25s ease;
}
.nav-links a:hover{ color: var(--accent-glow); }

/* ===== Hero ===== */
.hero{
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(24px, 6vw, 100px);
  position: relative;
}

.eyebrow{
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.4vw, 13px);
  letter-spacing: 0.18em;
  color: var(--accent-glow);
  margin-bottom: 28px;
  text-shadow: 0 0 18px rgba(79,147,214,0.3);
}

.name{
  font-size: clamp(42px, 8vw, 96px);
  line-height: 0.95;
  display: flex;
  flex-direction: column;
  margin-bottom: 28px;
}

.name-sans{
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--accent-glow);
  text-shadow: 0 0 40px rgba(43,114,196,0.35), 0 0 70px rgba(43,114,196,0.15);
}

.name-serif{
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: #aab6cc;
}

.tagline{
  font-size: clamp(15px, 1.7vw, 19px);
  line-height: 1.6;
  max-width: 620px;
  color: #c3cbdc;
  font-weight: 400;
}

.accent{
  color: var(--accent-glow);
  font-style: italic;
  font-family: var(--font-serif);
}

/* ===== Info strip ===== */
.info{
  padding: 20px clamp(24px, 6vw, 100px) 100px;
  border-top: 1px solid var(--hairline);
  margin-top: 20px;
}

.info-row{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--hairline);
}
.info-row:last-child{ border-bottom: none; }

.info-label{
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.info-value{
  font-family: var(--font-sans);
  font-size: clamp(16px, 2vw, 22px);
  color: var(--text);
  text-align: right;
}

/* ===== Sections ===== */
.section{
  padding: 90px clamp(24px, 6vw, 100px);
  border-top: 1px solid var(--hairline);
}

.section-label{
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 56px;
}

/* Projects */
.project{
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--hairline);
  font-family: inherit;
  cursor: pointer;
  padding: 36px 0;
  transition: padding-left 0.35s ease, background 0.35s ease;
}
.project:first-of-type{ border-top: 1px solid var(--hairline); }

.project:hover{
  padding-left: 20px;
  background: linear-gradient(90deg, rgba(43,114,196,0.05), transparent 60%);
}

.project-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.project h3{
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(21px, 2.8vw, 30px);
  color: var(--text);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.project:hover h3{
  color: var(--accent-glow);
  text-shadow: 0 0 30px rgba(43,114,196,0.32);
}

.project-arrow{
  font-size: 22px;
  color: var(--muted);
  transition: color 0.3s ease, transform 0.3s ease;
}
.project:hover .project-arrow{ color: var(--accent-glow); transform: translate(3px,-3px); }

.tags{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 18px;
}
.tags span{
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--accent-glow);
  border: 1px solid var(--hairline);
  padding: 5px 10px;
  border-radius: 3px;
  background: rgba(43,114,196,0.05);
}

.project p{
  max-width: 680px;
  color: #aab3c9;
  line-height: 1.65;
  font-size: 15.5px;
  margin-bottom: 16px;
}

.project-link-text{
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

/* Skills */
.skills-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 60px;
}

.skill-group{ border-bottom: 1px solid var(--hairline); padding-bottom: 24px; }

.skill-label{
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 10px;
}

.skill-group p{
  font-family: var(--font-sans);
  font-size: clamp(16px, 1.8vw, 19px);
  color: var(--text);
}

/* Contact */
.contact h2{
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(32px, 5vw, 52px);
  margin-bottom: 56px;
}

.accent-serif{
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--accent-glow);
  text-shadow: 0 0 30px rgba(43,114,196,0.32);
}

.contact-row{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-sans);
  font-size: clamp(18px, 2.4vw, 24px);
  transition: color 0.3s ease, padding-left 0.3s ease;
}
.contact-row:first-child{ border-top: 1px solid var(--hairline); }

.contact-row:hover{
  color: var(--accent-glow);
  padding-left: 12px;
}
.contact-row:hover .project-arrow{ color: var(--accent-glow); transform: translate(3px,-3px); }

/* Footer */
footer{
  padding: 40px clamp(24px, 6vw, 100px) 60px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--hairline);
}

/* ===== Reveal on scroll ===== */
.reveal{
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s cubic-bezier(.16,.84,.44,1), transform 0.8s cubic-bezier(.16,.84,.44,1);
}
.reveal.in{
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 720px){
  .name{ font-size: clamp(48px, 16vw, 90px); }
  .skills-grid{ grid-template-columns: 1fr; }
  .info-row{ flex-direction: column; gap: 6px; align-items: flex-start; }
  .info-value{ text-align: left; }
  .nav-links{ gap: 14px; }
}

/* Focus visibility */
a:focus-visible, button:focus-visible{
  outline: 2px solid var(--accent-glow);
  outline-offset: 4px;
}

/* ===== Coming-soon modal ===== */
.modal-backdrop{
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3,5,10,0.72);
  backdrop-filter: blur(4px);
  padding: 24px;
}
.modal-backdrop[hidden]{ display: none; }

.modal{
  width: 100%;
  max-width: 420px;
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 32px 28px;
  box-shadow: 0 0 60px rgba(43,114,196,0.18);
  animation: modal-in 0.3s cubic-bezier(.16,.84,.44,1);
}

@keyframes modal-in{
  from{ opacity: 0; transform: translateY(10px) scale(0.98); }
  to{ opacity: 1; transform: translateY(0) scale(1); }
}

.modal-eyebrow{
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent-glow);
  margin-bottom: 12px;
}

.modal h3{
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 26px;
  margin-bottom: 14px;
}

.modal-body{
  color: #aab3c9;
  line-height: 1.6;
  font-size: 14.5px;
  margin-bottom: 24px;
}

.modal-close{
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--accent-glow);
  background: none;
  border: 1px solid var(--hairline);
  padding: 10px 18px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}
.modal-close:hover{
  background: rgba(43,114,196,0.12);
}