/* =========================================================
   Design tokens
========================================================= */
:root {
  --bg: #0a0e14;
  --bg-alt: #0d1219;
  --surface: #10151d;
  --surface-hover: #141b25;
  --border: #1c2430;
  --border-soft: #161d27;

  --text: #e6edf3;
  --text-muted: #8b98a5;
  --text-dim: #5c6773;

  --accent: #3fa9f5;       /* signal blue */
  --accent-soft: #3fa9f51a;
  --accent-2: #3fa9f5;     /* same blue, kept for compatibility */
  --warn: #f0b429;         /* security amber */
  --danger: #f87171;

  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --container: 1120px;
  --header-h: 72px;
}

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

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  overflow-x: hidden;
  max-width: 100vw;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(45,212,191,0.07), transparent 40%),
    radial-gradient(circle at 88% 0%, rgba(56,189,248,0.06), transparent 45%);
  background-attachment: fixed;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; }

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.page-header {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--border-soft);
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 10px 0 12px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 640px;
}

section { padding: 72px 0; }
section + section { border-top: 1px solid var(--border-soft); }

.section-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 32px;
}

/* =========================================================
   Reveal-on-scroll
========================================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].visible { opacity: 1; transform: translateY(0); }

/* =========================================================
   Header / Nav
========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(10, 14, 20, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 14, 20, 0.92);
}

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

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-icon { color: var(--accent); flex-shrink: 0; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background 0.2s ease;
  position: relative;
}
.nav-links a:hover { color: var(--text); background: var(--surface-hover); }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 3px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-switch {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  background: var(--surface);
}
.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}
.lang-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 8px;
}
.nav-toggle span {
  width: 20px; height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* =========================================================
   Buttons
========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--accent);
  color: #051220;
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover { background: #6cbdf7; }
.btn-ghost {
  background: transparent;
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* =========================================================
   Hero (Home)
========================================================= */
.hero {
  padding: 96px 0 80px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 14px 0 18px;
}
.hero-title .name { color: var(--accent); }

.hero-quote {
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 46ch;
  margin-bottom: 32px;
  border-left: 2px solid var(--accent);
  padding-left: 16px;
}

/* Terminal panel */
.terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.6);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.terminal-bar .tdot { width: 10px; height: 10px; border-radius: 50%; }
.tdot.r { background: #ff5f57; }
.tdot.y { background: #febc2e; }
.tdot.g { background: #28c840; }
.terminal-bar span.tlabel {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}
.terminal-body {
  padding: 22px 20px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  min-height: 190px;
}
.term-line { margin-bottom: 10px; white-space: pre-wrap; word-break: break-word; }
.term-line.cmd { color: var(--text); }
.term-line.muted { color: var(--text-dim); }
.term-line.ok { color: var(--accent-2); }
.term-line.accent { color: var(--warn); }
.cursor {
  display: inline-block;
  width: 7px; height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Skills grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.skill-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.skill-icon {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 16px;
}
.skill-card h3 {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.skill-card p { color: var(--text-muted); font-size: 0.9rem; }

/* =========================================================
   About page
========================================================= */
.about-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 56px;
  align-items: start;
}

.journey p { color: var(--text-muted); margin-bottom: 16px; max-width: 62ch; }

.timeline { margin-top: 40px; display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 18px;
  padding-bottom: 28px;
  position: relative;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: 19px; top: 34px; bottom: 0;
  width: 1px;
  background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.hop {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--bg-alt);
  flex-shrink: 0;
}
.timeline-content h3 { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 2px; }
.timeline-place {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 8px;
  display: block;
}
.timeline-content p { color: var(--text-muted); font-size: 0.92rem; max-width: 60ch; }

.philosophy-list { margin-top: 24px; display: flex; flex-direction: column; gap: 14px; }
.philosophy-list li {
  display: flex; gap: 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.philosophy-list li::before {
  content: "//";
  color: var(--accent);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.side-card h3 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.info-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); font-size: 0.9rem; }
.info-row:last-child { border-bottom: none; }
.info-row .k { color: var(--text-dim); }
.info-row .v { color: var(--text); text-align: right; }

.stack-cat { margin-bottom: 18px; }
.stack-cat:last-child { margin-bottom: 0; }
.stack-cat-label {
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg-alt);
}

/* =========================================================
   Projects
========================================================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-3px); }

.project-thumb {
  aspect-ratio: 16/9;
  position: relative;
  overflow: hidden;
  background: var(--bg-alt);
}
.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.project-card:hover .project-thumb img { transform: scale(1.03); }

.project-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--warn);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.project-body h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.project-body p { color: var(--text-muted); font-size: 0.92rem; flex: 1; }

.project-links { display: flex; gap: 14px; margin-top: 6px; flex-wrap: wrap; }
.project-links a, .project-links .private {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.project-links a { color: var(--accent-2); }
.project-links a:hover { color: var(--accent); }
.project-links .private { color: var(--text-dim); }

/* =========================================================
   Contact
========================================================= */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 56px;
  align-items: start;
}

.contact-single {
  max-width: 620px;
}

.contact-cards { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color 0.2s ease;
}
.contact-card:hover { border-color: var(--accent); }
.contact-card .ci {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-card .cc-label { font-size: 0.74rem; color: var(--text-dim); font-family: var(--font-mono); }
.contact-card .cc-value { font-size: 0.93rem; color: var(--text); }

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.field input, .field textarea {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  transition: border-color 0.2s ease;
  resize: vertical;
}
.field input:focus, .field textarea:focus {
  border-color: var(--accent);
  outline: none;
}
.field textarea { min-height: 130px; }

/* =========================================================
   Footer
========================================================= */
.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 34px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.footer-text { color: var(--text-dim); font-size: 0.85rem; font-family: var(--font-mono); }
.footer-links { display: flex; gap: 18px; }
.footer-links a {
  color: var(--text-dim);
  font-size: 0.85rem;
  display: flex; align-items: center; gap: 6px;
  transition: color 0.2s ease;
}
.footer-links a:hover { color: var(--accent); }

/* =========================================================
   Responsive
========================================================= */
@media (max-width: 900px) {
  .hero { padding-top: 56px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .about-layout, .contact-layout { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: rgba(10,14,20,0.98);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 20px 20px;
    gap: 2px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .nav-links.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav-links a { padding: 12px 8px; }
  .nav-toggle { display: flex; }
  .form-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
}
