/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --ink: #0a0f1a;
  --panel: #0e1524;
  --panel-2: #131c30;
  --line: #223154;
  --line-soft: #1a2540;
  --text: #e6ecf5;
  --muted: #8d98b3;
  --signal: #59d8c4;
  --signal-dim: rgba(89, 216, 196, 0.12);
  --warn: #f4a65a;
  --good: #7cd992;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Manrope', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --maxw: 1120px;
}

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

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

.mono { font-family: var(--font-mono); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--signal);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 3px var(--signal-dim);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(28px, 4vw, 38px);
  margin-bottom: 36px;
  max-width: 34ch;
}

p { color: var(--muted); margin: 0; }

section { position: relative; padding: 96px 0; }

.hairline {
  border-top: 1px solid var(--line-soft);
}

/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(10, 15, 26, 0.82);
  backdrop-filter: blur(10px);
}

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

.nav-mark {
  font-family: var(--font-mono);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-mark .dot {
  width: 8px; height: 8px;
  background: var(--good);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(124, 217, 146, 0.15);
}

.nav-links {
  display: flex;
  gap: 30px;
  font-size: 14.5px;
  color: var(--muted);
}

.nav-links a {
  position: relative;
  padding-bottom: 4px;
  transition: color 0.15s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0;
  height: 1px;
  background: var(--signal);
  transition: width 0.25s ease;
}

.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--signal); }
.nav-links a.active::after { width: 100%; }

.scroll-progress {
  position: absolute;
  bottom: -1px; left: 0;
  height: 1px;
  width: 0%;
  background: var(--signal);
  box-shadow: 0 0 8px 0 var(--signal);
  transition: width 0.1s linear;
}

.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-links { display: none; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding-top: 168px;
  padding-bottom: 80px;
  overflow: hidden;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}

#hero-canvas {
  width: 100%;
  height: 420px;
  display: block;
}

.hero-visual {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background:
    radial-gradient(circle at 70% 30%, rgba(89, 216, 196, 0.08), transparent 60%),
    var(--panel);
  overflow: hidden;
}

.frame-label {
  position: absolute;
  top: 12px; left: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  z-index: 2;
  background: rgba(10, 15, 26, 0.55);
  padding: 4px 9px;
  border-radius: 3px;
  backdrop-filter: blur(2px);
}

.hero-title {
  font-size: clamp(40px, 6vw, 64px);
  margin: 6px 0 18px;
  background: linear-gradient(120deg, var(--text) 40%, var(--signal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-role {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--signal);
  margin-bottom: 22px;
}

.hero-tagline {
  max-width: 46ch;
  font-size: 17px;
  margin-bottom: 34px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 4px;
  border: 1px solid var(--line);
  transition: border-color 0.15s ease, transform 0.12s ease-out, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tilt {
  transition: transform 0.2s ease-out, border-color 0.2s ease, box-shadow 0.2s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.magnetic {
  transition: transform 0.2s ease-out;
}

.service-card.tilt:hover,
.ticket.tilt:hover,
.hero-visual.tilt:hover,
.photo-frame.tilt:hover {
  border-color: var(--signal);
  box-shadow: 0 20px 50px -20px rgba(89, 216, 196, 0.25);
}

.btn-primary {
  background: var(--signal);
  color: #06120f;
  border-color: var(--signal);
}

.btn-primary:hover { transform: translateY(-1px); }

.btn-ghost { color: var(--text); }
.btn-ghost:hover { border-color: var(--signal); color: var(--signal); }

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
}

.stack-tags span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line-soft);
  padding: 5px 10px;
  border-radius: 4px;
}

/* ============================================================
   About
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 50px;
}

.about-copy p { font-size: 16.5px; color: var(--text); opacity: 0.85; }

.facts {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  overflow: hidden;
}

.photo-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--panel);
  margin-bottom: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-image {
  position: absolute;
  inset: -3%;
  background-size: cover;
  background-position: center 25%;
  background-repeat: no-repeat;
  animation: kenburns 16s ease-in-out infinite alternate;
}

@keyframes kenburns {
  from { transform: scale(1); }
  to   { transform: scale(1.09); }
}

@media (prefers-reduced-motion: reduce) {
  .photo-image { animation: none; }
}

.photo-fallback {
  display: none;
  font-family: var(--font-display);
  font-size: 48px;
  color: var(--line);
  z-index: 1;
}

.photo-frame.empty .photo-fallback { display: block; }

/* Scanning sweep line — subtle, continuous */
.photo-scan {
  position: absolute;
  left: 0; right: 0;
  height: 40%;
  top: -40%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(89, 216, 196, 0.16) 45%,
    rgba(89, 216, 196, 0.28) 50%,
    rgba(89, 216, 196, 0.16) 55%,
    transparent
  );
  animation: scan-sweep 6s linear infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes scan-sweep {
  0%   { top: -40%; }
  100% { top: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .photo-scan { display: none; }
}

/* Viewfinder-style corner brackets */
.frame-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--signal);
  opacity: 0.75;
  z-index: 2;
}

.frame-corner.tl { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.frame-corner.tr { top: 10px; right: 10px; border-left: none; border-bottom: none; }
.frame-corner.bl { bottom: 10px; left: 10px; border-right: none; border-top: none; }
.frame-corner.br { bottom: 10px; right: 10px; border-left: none; border-top: none; }

.frame-status {
  position: absolute;
  bottom: 12px; right: 14px;
  z-index: 2;
  font-size: 11px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 15, 26, 0.55);
  padding: 4px 9px;
  border-radius: 3px;
  backdrop-filter: blur(2px);
}

.frame-status .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 2px rgba(124, 217, 146, 0.18);
}

.fact-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  font-size: 14px;
}

.fact-row + .fact-row { border-top: 1px solid var(--line-soft); }

.fact-row .k {
  font-family: var(--font-mono);
  color: var(--muted);
  white-space: nowrap;
}

.fact-row .v { color: var(--text); text-align: right; }

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.skills-list span {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 7px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  color: var(--muted);
}

/* ============================================================
   Services
   ============================================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  overflow: hidden;
}

.service-card {
  background: var(--panel);
  padding: 32px;
}

.service-code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--signal);
  margin-bottom: 18px;
  display: block;
}

.service-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

.service-card p { font-size: 14.5px; }

/* ============================================================
   Work / projects — changelog style
   ============================================================ */
.log {
  border-left: 1px solid var(--line-soft);
  margin-left: 6px;
}

.log-item {
  position: relative;
  padding: 0 0 40px 32px;
}

.log-item:last-child { padding-bottom: 0; }

.log-item::before {
  content: '';
  position: absolute;
  left: -5px; top: 4px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--signal);
}

.log-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.log-head h3 { font-size: 19px; }

.log-role {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

.log-item p { font-size: 14.5px; max-width: 62ch; margin-bottom: 14px; }

.log-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.log-tags span {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--signal);
  background: var(--signal-dim);
  padding: 4px 9px;
  border-radius: 3px;
}

/* ============================================================
   Contact
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 50px;
}

.contact-info .fact-row .v a:hover { color: var(--signal); }

.ticket {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--panel);
  padding: 28px;
}

.ticket-head {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.field input,
.field textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
  resize: vertical;
  transition: border-color 0.15s ease;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--signal);
}

.field textarea { min-height: 120px; }

.form-note {
  font-family: var(--font-mono);
  font-size: 12.5px;
  margin-top: 14px;
}

.form-note.ok { color: var(--good); }
.form-note.err { color: var(--warn); }

/* ============================================================
   Footer
   ============================================================ */
footer {
  border-top: 1px solid var(--line-soft);
  padding: 34px 0;
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

/* ============================================================
   Terminal / system console
   ============================================================ */
.terminal {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
  background: #0c1120;
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.6);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel-2);
}

.terminal-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.terminal-dot.r { background: #e5605a; }
.terminal-dot.y { background: #e6b455; }
.terminal-dot.g { background: #62c674; }

.terminal-path {
  margin-left: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.terminal-body {
  margin: 0;
  padding: 22px 24px 28px;
  min-height: 320px;
  font-size: 13.5px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--muted);
}

.term-cmd {
  color: var(--text);
}

.term-cmd::before { content: ''; }

.term-out { color: var(--muted); }
.term-out.ok { color: var(--good); }
.term-out.accent { color: var(--signal); }

.term-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: var(--signal);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: term-blink 1s step-end infinite;
}

@keyframes term-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@media (max-width: 620px) {
  .terminal-body { font-size: 12.5px; padding: 18px 16px 22px; }
}

/* ============================================================
   Cursor spotlight
   ============================================================ */
.spotlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(
    600px circle at var(--x, 50%) var(--y, 50%),
    rgba(89, 216, 196, 0.05),
    transparent 40%
  );
}

@media (hover: none) {
  .spotlight { display: none; }
}

/* ============================================================
   Boot loader
   ============================================================ */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader.done {
  opacity: 0;
  visibility: hidden;
}

.loader-inner {
  width: min(420px, 84vw);
}

.loader-mark {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.loader-mark .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--good);
}

.loader-lines {
  font-size: 12.5px;
  color: var(--signal);
  min-height: 90px;
  line-height: 1.9;
}

.loader-bar {
  margin-top: 18px;
  height: 2px;
  background: var(--line-soft);
  border-radius: 2px;
  overflow: hidden;
}

.loader-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--signal);
  transition: width 0.28s ease;
}

body:not(.loaded) { overflow: hidden; }

/* ============================================================
   About decorative orb
   ============================================================ */
.about-orb-canvas {
  position: absolute;
  top: 0; right: 0;
  width: 55%;
  height: 100%;
  pointer-events: none;
  opacity: 0.7;
  z-index: 0;
}

#about .wrap { position: relative; z-index: 1; }

/* ============================================================
   Scroll reveal — one orchestrated moment per element
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .hero .wrap,
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .hero-visual { order: -1; }
  .services-grid { grid-template-columns: 1fr; }
  section { padding: 64px 0; }
}
