/* ==========================================================================
   TOKENS — change colors, fonts and spacing here and it ripples everywhere.
   Theme is strict black & white on purpose: hierarchy comes from grey value
   and weight, not hue.
   ========================================================================== */
:root {
  --bg: #060606;
  --bg-alt: #0D0D0D;
  --surface: #121212;
  --surface-2: #1B1B1B;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.24);

  --text: #F2F2F2;
  --text-muted: #A3A3A3;
  --text-faint: #656565;

  --accent: #FFFFFF;      /* pure white — buttons, underline emphasis, active states */
  --accent-dim: rgba(255, 255, 255, 0.10);

  /* code-block syntax colors — the one deliberately colorful element on an
     otherwise black & white page. Confined to the hero editor mockup. */
  --code-kw: #BD93F9;     /* keywords: const, true */
  --code-var: #8BE9FD;    /* variable / object name */
  --code-prop: #F2F2F2;   /* object keys — kept neutral so values pop */
  --code-str: #F1FA8C;    /* string literals */
  --code-num: #FFB86C;    /* numbers */
  --code-comment: #6272A4;/* comments */
  --code-punct: #6D6D6D;  /* braces, colons, commas */
  --code-plain: var(--text);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --container: 1120px;
  --nav-h: 72px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   RESET
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body, h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

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

/* thin monochrome scrollbar (webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }
html { scrollbar-color: var(--surface-2) var(--bg); scrollbar-width: thin; }

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #050505;
  padding: 10px 16px;
  z-index: 999;
  border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

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

/* ==========================================================================
   SCROLL PROGRESS BAR
   ========================================================================== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 200;
  transition: width 0.1s linear;
}

/* ==========================================================================
   SCROLL REVEAL
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

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

.section { padding: 96px 0; }
.section--alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section__inner { max-width: 760px; }
#projects .section__inner,
#extras .section__inner,
#skills .section__inner,
#experience .section__inner,
#contact .section__inner { max-width: var(--container); }

.kicker {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.kicker--spaced { margin-top: 40px; }

.section__title {
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 32px;
}
.section__title--sm { font-size: 1.35rem; margin-bottom: 20px; }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--accent); color: #050505; }
.btn--primary:hover { background: #D9D9D9; }

.btn--outline { border-color: var(--border-strong); color: var(--text); }
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }

.btn--sm { padding: 8px 16px; font-size: 0.85rem; }

/* ==========================================================================
   NAV
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(6, 6, 6, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav__logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  margin-right: auto;
}
.nav__logo:hover { color: var(--accent); }

.nav__links { display: flex; gap: 28px; }
.nav__link {
  font-size: 0.94rem;
  color: var(--text-muted);
  position: relative;
  padding: 6px 0;
  transition: color 0.15s var(--ease);
}
.nav__link:hover { color: var(--text); }
.nav__link.is-active { color: var(--accent); }
.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.nav__cta { margin-left: 8px; }

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  margin-left: 4px;
}
.nav__toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.nav__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; }
.nav__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  padding: 88px 0 96px;
  position: relative;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: -14px -14px;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  position: relative;
}

.hero__title {
  font-size: clamp(2.1rem, 4.6vw, 3.1rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero__title .accent {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 7px;
}

.hero__lead {
  color: var(--text-muted);
  font-size: 1.06rem;
  max-width: 52ch;
  margin-bottom: 32px;
}

.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 48px; }

.hero__stats { display: flex; gap: 36px; flex-wrap: wrap; }
.hero__stat-value {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.hero__stat-label { font-size: 0.85rem; color: var(--text-faint); margin-top: 6px; max-width: 14ch; }

/* code editor mockup */
.editor {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}
.editor__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: #FF5F57; }
.dot--y { background: #FEBC2E; }
.dot--g { background: #28C840; }
.editor__filename {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
}

.editor__body {
  margin: 0;
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 300px;
}

.tok-kw { color: var(--code-kw); font-weight: 600; }
.tok-str { color: var(--code-str); }
.tok-prop { color: var(--code-prop); }
.tok-num { color: var(--code-num); font-weight: 600; }
.tok-comment { color: var(--code-comment); font-style: italic; }
.tok-punct { color: var(--code-punct); }
.tok-var { color: var(--code-var); font-weight: 600; }
.tok-plain { color: var(--code-plain); }

.caret {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ==========================================================================
   ABOUT — photo left, copy right
   ========================================================================== */
.about__grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 56px;
  align-items: start;
}

.about__photo {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}
.about__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.about__photo-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
  color: var(--text-faint);
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 20px 20px;
}
.about__photo-placeholder span {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.about__photo-placeholder small { font-size: 0.78rem; max-width: 22ch; line-height: 1.4; }
.about__photo img { opacity: 0; transition: opacity 0.3s var(--ease); }
/* JS toggles .has-photo on successful load */
.about__photo.has-photo .about__photo-placeholder { opacity: 0; pointer-events: none; }
.about__photo.has-photo img { opacity: 1; }
.about__photo img.is-broken { display: none; }

.about__text .kicker,
.about__text .section__title { margin-top: 0; }

.about__content p {
  color: var(--text-muted);
  margin-bottom: 18px;
  max-width: 62ch;
}
.about__content p:last-child { margin-bottom: 0; }

/* ==========================================================================
   SKILLS
   ========================================================================== */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.skill-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.skill-card__icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  margin-bottom: 16px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.skill-card:hover .skill-card__icon { color: var(--accent); border-color: var(--border-strong); }
.skill-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text);
}
.skill-card__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: 999px;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.skill-card:hover .tag { border-color: var(--border-strong); }

/* ==========================================================================
   EXPERIENCE — minimal rows, interactive on hover
   ========================================================================== */
.timeline { border-top: 1px solid var(--border); }

.exp-row {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 22px 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: background 0.2s var(--ease), padding-left 0.2s var(--ease);
}
.exp-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.25s var(--ease);
}
.exp-row:hover {
  background: var(--surface);
  padding-left: 24px;
}
.exp-row:hover::before { transform: scaleY(1); }

.exp-row__index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  flex-shrink: 0;
  width: 24px;
}

.exp-row__main { flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

.exp-row__left { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.exp-row__role { font-size: 1.05rem; font-weight: 700; }
.exp-row__company { color: var(--text-muted); font-size: 0.92rem; }
.exp-row__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  animation: pulse-dot 1.8s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255,255,255,0.35); }
  50% { opacity: 0.55; box-shadow: 0 0 0 4px rgba(255,255,255,0); }
}

.exp-row__right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.exp-row__period {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-faint);
  white-space: nowrap;
}
.exp-row__duration {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.exp-row:hover .exp-row__period { color: var(--text-muted); }
.exp-row:hover .exp-row__duration { border-color: var(--border-strong); color: var(--text-muted); }

/* ==========================================================================
   PROJECTS
   ========================================================================== */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.project-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.project-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.project-card__name { font-size: 1.05rem; font-weight: 700; }
.project-card__link {
  color: var(--text-faint);
  flex-shrink: 0;
  transition: color 0.15s var(--ease), transform 0.15s var(--ease);
}
.project-card:hover .project-card__link { color: var(--accent); transform: translate(2px, -2px); }

.project-card__desc { color: var(--text-muted); font-size: 0.93rem; margin-bottom: 18px; flex-grow: 1; }
.project-card__tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* ==========================================================================
   CERTIFICATIONS / EDUCATION / LANGUAGES
   ========================================================================== */
.extras__inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
}

.cert-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  transition: padding-left 0.2s var(--ease);
}
.cert-list li:hover { padding-left: 8px; }
.cert-list li:first-child { padding-top: 0; }
.cert-list li:last-child { border-bottom: none; }
.cert-title { font-weight: 600; font-size: 0.98rem; }
.cert-meta { color: var(--text-faint); font-family: var(--font-mono); font-size: 0.8rem; margin-top: 4px; }

.edu-item { margin-bottom: 4px; font-weight: 600; }
.edu-school { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 24px; }

.lang-row { display: flex; justify-content: space-between; max-width: 320px; padding: 8px 0; font-size: 0.94rem; }
.lang-row span:first-child { color: var(--text); }
.lang-row span:last-child { color: var(--text-faint); font-family: var(--font-mono); font-size: 0.82rem; }

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact__lead { color: var(--text-muted); margin-bottom: 20px; max-width: 56ch; }

.contact__status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.contact__featured {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 44px);
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  transition: border-color 0.2s var(--ease);
}
.contact__featured:hover { border-color: var(--border-strong); }
.contact__featured-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.contact__featured-email {
  font-family: var(--font-mono);
  font-size: clamp(1.25rem, 3vw, 1.9rem);
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}
.contact__featured-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.contact__copy-btn { position: relative; }
.contact__copy-btn svg { width: 15px; height: 15px; }

.contact__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact-card__label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.contact-card__value { font-size: 0.98rem; font-weight: 600; word-break: break-word; }
.contact-card--link:hover .contact-card__value { color: var(--accent); }

/* ==========================================================================
   FOOTER — status-bar styled
   ========================================================================== */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}
.footer__inner { padding: 0; }

.footer__status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 24px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 1.8s ease-in-out infinite;
  flex-shrink: 0;
}
.footer__sep { color: var(--border-strong); }

.footer__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 24px;
}
.footer__text { font-size: 0.85rem; color: var(--text-faint); }
.footer__top {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color 0.15s var(--ease);
}
.footer__top:hover { color: var(--accent); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__code { order: -1; }
  .about__grid { grid-template-columns: 1fr; }
  .about__photo { max-width: 320px; aspect-ratio: 1 / 1; }
  .extras__inner { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 720px) {
  .section { padding: 64px 0; }
  .hero { padding: 44px 0 64px; }

  .nav__links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 16px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
  }
  .nav__links.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav__link { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .nav__link:last-child { border-bottom: none; }

  .nav__cta { display: none; }
  .nav__toggle { display: flex; }

  .hero__stats { gap: 24px; }
  .editor__body { font-size: 0.78rem; padding: 18px; min-height: 240px; }

  .exp-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .exp-row__main { flex-direction: column; align-items: flex-start; gap: 8px; }
  .exp-row__right { align-items: flex-start; flex-direction: row; gap: 10px; }

  .footer__status { font-size: 0.72rem; }
}
