/* =========================================================
   TOKENS
   ========================================================= */
:root {
  --bg-base:       #0d0f0e;
  --bg-surface:    #131614;
  --bg-raised:     #1a1d1b;
  --bg-border:     #252926;

  --accent:        #4ade80;
  --accent-dim:    #22c55e;
  --accent-cyan:   #38bdf8;
  --accent-warm:   #f59e0b;
  --accent-muted:  rgba(74, 222, 128, 0.08);
  --accent-glow:   rgba(74, 222, 128, 0.15);

  --text-primary:  #e8ede9;
  --text-secondary:#8fa890;
  --text-muted:    #4d5e50;

  --font-display:  'Share Tech Mono', 'Courier New', monospace;
  --font-body:     'Inter', 'Segoe UI', system-ui, sans-serif;

  --radius-sm:     4px;
  --radius-md:     8px;
  --radius-lg:     16px;

  --transition:    200ms ease;
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.65;
  overflow-x: hidden;
}

/* Scanline signature element */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.04) 2px,
    rgba(0, 0, 0, 0.04) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* =========================================================
   TYPOGRAPHY
   ========================================================= */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em; line-height: 1.2; }

.section-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.section-label::after {
  content: '';
  flex: 1;
  max-width: 40px;
  height: 1px;
  background: var(--accent-dim);
}

.section-title {
  font-size: clamp(2rem, 4.8vw, 3.5rem);
  color: var(--text-primary);
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.7;
}

.section-heading {
  margin-bottom: 48px;
}

.split-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.7fr);
  gap: 48px;
  align-items: end;
}

.split-heading .section-subtitle {
  justify-self: end;
  margin-bottom: 18px;
}

/* =========================================================
   LAYOUT UTILS
   ========================================================= */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 96px 0; }

.divider {
  border: none;
  border-top: 1px solid var(--bg-border);
}

/* =========================================================
   NAVIGATION
   ========================================================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background var(--transition), border-color var(--transition);
}

.nav.scrolled {
  background: rgba(13, 15, 14, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bg-border);
}

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

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  transition: color var(--transition);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--transition);
}
.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  transition: transform var(--transition), opacity var(--transition);
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: 64px;
  position: relative;
  overflow: hidden;
}

/* Subtle grid bg */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--bg-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 40%, transparent 100%);
  opacity: 0.35;
  pointer-events: none;
}

.hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.62fr);
  gap: clamp(40px, 7vw, 88px);
  align-items: center;
}

.hero-content {
  min-width: 0;
  max-width: 860px;
}

.hero-eyebrow {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.6s 0.1s forwards;
}

.hero-heading {
  font-size: clamp(3rem, 6.2vw, 5.6rem);
  color: var(--text-primary);
  line-height: 1.04;
  margin-bottom: 26px;
  opacity: 0;
  animation: fadeUp 0.6s 0.25s forwards;
  max-width: 780px;
}
.hero-heading span {
  display: block;
  max-width: 100%;
}
.hero-heading .typed-cursor {
  color: var(--accent);
  animation: blink 1s infinite;
}

.hero-role-line {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  max-width: 100%;
  margin-bottom: 28px;
  padding: 10px 14px;
  border: 1px solid rgba(143, 168, 144, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(19, 22, 20, 0.72);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: clamp(0.82rem, 1.5vw, 0.98rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeUp 0.6s 0.35s forwards;
}
.role-label {
  color: var(--accent);
}
.typed-target {
  display: inline-block;
  min-width: 21ch;
  overflow-wrap: anywhere;
}
.typed-cursor {
  color: var(--accent);
  animation: blink 1s infinite;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 500px;
  line-height: 1.75;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 0.6s 0.4s forwards;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.6s 0.55s forwards;
}

.hero-panel {
  border-left: 1px solid rgba(143, 168, 144, 0.2);
  padding-left: clamp(24px, 4vw, 44px);
  display: grid;
  gap: 18px;
}

.hero-panel-line {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 16px;
  align-items: baseline;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(143, 168, 144, 0.12);
}
.hero-panel-line span {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
}
.hero-panel-line strong {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: 400;
  letter-spacing: 0.04em;
}
.hero-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 8px;
}
.hero-metric-grid div {
  min-width: 0;
  border: 1px solid rgba(143, 168, 144, 0.16);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  background: rgba(26, 29, 27, 0.58);
}
.hero-metric-grid strong,
.hero-metric-grid span {
  display: block;
  font-family: var(--font-display);
}
.hero-metric-grid strong {
  color: var(--accent);
  font-size: 1rem;
  line-height: 1.2;
}
.hero-metric-grid span {
  color: var(--text-muted);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-base);
}
.btn-primary:hover {
  background: #6aeea4;
  transform: translateY(-1px);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--bg-border);
}
.btn-outline:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
  transform: translateY(-1px);
}

/* =========================================================
   ABOUT
   ========================================================= */
.about { background: var(--bg-surface); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.about-body p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.975rem;
  line-height: 1.8;
}
.about-body p strong { color: var(--text-primary); font-weight: 600; }

.about-facts {
  display: grid;
  gap: 16px;
}

.fact-card {
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: border-color var(--transition), background var(--transition);
}
.fact-card:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
}
.fact-icon {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.fact-card h4 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 4px;
}
.fact-card p { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.55; }

/* =========================================================
   SKILLS
   ========================================================= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 124px;
  gap: 16px;
}

.skill-item {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.035), transparent 55%),
    var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  transition: all var(--transition);
  cursor: default;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  min-width: 0;
}
.skill-item:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(0,0,0,0.28);
}
.skill-item:nth-child(1) { grid-column: 1 / 3; grid-row: 1; }
.skill-item:nth-child(2) { grid-column: 3 / 4; grid-row: 1; }
.skill-item:nth-child(3) { grid-column: 4 / 6; grid-row: 1 / 3; }
.skill-item:nth-child(4) { grid-column: 6 / 7; grid-row: 1 / 3; }
.skill-item:nth-child(5) { grid-column: 1 / 2; grid-row: 2; }
.skill-item:nth-child(6) { grid-column: 2 / 4; grid-row: 2; }
.skill-item:nth-child(7) { grid-column: 1 / 3; grid-row: 3; }
.skill-item:nth-child(8) { grid-column: 3 / 5; grid-row: 3; }
.skill-item:nth-child(9) { grid-column: 5 / 7; grid-row: 3; }

.skill-item:nth-child(3),
.skill-item:nth-child(4) { border-color: rgba(245, 158, 11, 0.28); }
.skill-item:nth-child(5),
.skill-item:nth-child(6) { border-color: rgba(56, 189, 248, 0.28); }
.skill-item:nth-child(8) { border-color: rgba(74, 222, 128, 0.28); }
.skill-item .skill-icon {
  width: clamp(42px, 7vw, 68px);
  height: clamp(42px, 7vw, 68px);
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,0.35));
}
.skill-item .skill-name {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* =========================================================
   PORTFOLIO
   ========================================================= */
.portfolio {
  background:
    linear-gradient(180deg, var(--bg-base), var(--bg-surface));
}

.project-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.75fr);
  gap: 36px;
  align-items: center;
}

.project-media {
  display: block;
  border: 1px solid rgba(143, 168, 144, 0.22);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-raised);
  box-shadow: 0 26px 70px rgba(0,0,0,0.45);
  transition: border-color 240ms ease, box-shadow 240ms ease;
}
.project-media:hover {
  border-color: rgba(74, 222, 128, 0.55);
  box-shadow: 0 34px 88px rgba(0,0,0,0.55), 0 0 42px rgba(56, 189, 248, 0.1);
}
.project-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  object-position: top center;
  transform: scale(1);
  transition: transform 320ms ease;
}
.project-media:hover img {
  transform: scale(1.055);
}

.project-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.project-tag {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.project-body h3 {
  font-size: clamp(1.7rem, 4vw, 2.75rem);
  color: var(--text-primary);
  margin-bottom: 14px;
}
.project-body p {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 24px;
}
.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.project-stack span {
  border: 1px solid rgba(143, 168, 144, 0.22);
  border-radius: 999px;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  padding: 7px 10px;
  text-transform: uppercase;
}
.project-stack span:nth-child(2) {
  border-color: rgba(245, 158, 11, 0.35);
  color: #facc15;
}
.project-stack span:nth-child(4) {
  border-color: rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  transition: gap var(--transition);
}
.project-link:hover { gap: 10px; }
.project-link svg { flex-shrink: 0; }

/* =========================================================
   CONTACT
   ========================================================= */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 64px;
  align-items: start;
  margin-top: 48px;
}

.contact-info p {
  font-size: 0.975rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 32px;
}

.contact-socials {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.social-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: color var(--transition);
}
.social-link:hover { color: var(--accent); }
.social-link svg { flex-shrink: 0; }

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.field-group input,
.field-group textarea {
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  resize: vertical;
}
.field-group input:focus,
.field-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.field-group textarea { min-height: 120px; }

/* Honeypot — visually hidden */
.hp-field { position: absolute; left: -9999px; opacity: 0; pointer-events: none; tabindex: -1; }

.form-status {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  display: none;
}
.form-status.success { display: block; background: rgba(74,222,128,0.1); color: var(--accent); border: 1px solid var(--accent-dim); }
.form-status.error   { display: block; background: rgba(239,68,68,0.08); color: #f87171; border: 1px solid #ef4444; }

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  border-top: 1px solid var(--bg-border);
  padding: 32px 0;
  background: var(--bg-surface);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.footer-copy a { color: var(--text-secondary); transition: color var(--transition); }
.footer-copy a:hover { color: var(--accent); }

.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--accent); }

/* =========================================================
   ANIMATIONS
   ========================================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .about-grid    { grid-template-columns: 1fr; gap: 40px; }
  .contact-grid  { grid-template-columns: 1fr; gap: 40px; }
  .split-heading { grid-template-columns: 1fr; gap: 12px; }
  .split-heading .section-subtitle { justify-self: start; margin-bottom: 0; }
  .skills-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 126px;
  }
  .skill-item:nth-child(1),
  .skill-item:nth-child(2),
  .skill-item:nth-child(3),
  .skill-item:nth-child(4),
  .skill-item:nth-child(5),
  .skill-item:nth-child(6),
  .skill-item:nth-child(7),
  .skill-item:nth-child(8),
  .skill-item:nth-child(9) {
    grid-column: auto;
    grid-row: auto;
  }
  .project-showcase { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 700px) {
  .hero {
    min-height: auto;
    padding-top: 104px;
    padding-bottom: 72px;
  }
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 38px;
  }
  .hero-panel {
    border-left: 0;
    border-top: 1px solid rgba(143, 168, 144, 0.2);
    padding-left: 0;
    padding-top: 26px;
  }
  .hero-heading {
    font-size: clamp(2.35rem, 11vw, 3.25rem);
    max-width: 100%;
    margin-bottom: 22px;
  }
  .hero-sub {
    font-size: 1rem;
    max-width: 32rem;
  }
  .hero-role-line {
    align-items: flex-start;
    padding: 9px 11px;
  }
  .hero-metric-grid { grid-template-columns: 1fr; }
  section { padding: 72px 0; }
  .nav-links { display: none; flex-direction: column; gap: 0; position: absolute; top: 64px; left: 0; right: 0; background: rgba(13,15,14,0.97); border-bottom: 1px solid var(--bg-border); padding: 16px 24px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; font-size: 0.95rem; border-bottom: 1px solid var(--bg-border); }
  .nav-links a:last-child { border-bottom: none; }
  .nav-toggle { display: flex; }
  .section-heading { margin-bottom: 32px; }
  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 118px;
    gap: 12px;
  }
  .skill-item:nth-child(1),
  .skill-item:nth-child(2),
  .skill-item:nth-child(3),
  .skill-item:nth-child(4),
  .skill-item:nth-child(5),
  .skill-item:nth-child(6),
  .skill-item:nth-child(7),
  .skill-item:nth-child(8),
  .skill-item:nth-child(9) {
    grid-column: auto;
    grid-row: auto;
  }
  .skill-item:nth-child(9) { grid-column: span 2; }
  .project-body h3 { font-size: 2rem; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
