/* ==========================================================
   DESIGN TOKENS
   Change colors, fonts, and spacing here — everything below
   references these variables, so this is the one place to
   touch for a full re-theme.
   ========================================================== */
:root {
  /* --- Color --- */
  --bg: #F7F8FA;            /* page background, cool paper-white */
  --surface: #FFFFFF;        /* cards, nav, form fields */
  --ink: #14171F;            /* primary text */
  --muted: #5B6270;          /* secondary text */
  --border: #E4E7EC;         /* hairline borders */
  --accent: #3A4CE0;         /* indigo — links, CTAs */
  --accent-ink: #FFFFFF;     /* text on accent background */
  --accent-soft: #EEF0FD;    /* accent tint, chips/badges */
  --mint: #0FBF95;           /* secondary accent, used sparingly */
  --editor-bg: #12141C;      /* dark surface, hero code window only */
  --editor-text: #E4E7EC;

  /* --- Type --- */
  /* --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace; */
  --font-display: Segoe UI;
  --font-body: Segoe UI;
  --font-mono: Segoe UI;

  /* --- Layout --- */
  --container: 1140px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 23, 31, 0.04), 0 8px 24px rgba(20, 23, 31, 0.06);
}

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

html { scroll-behavior: smooth; }

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

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

img { max-width: 100%; display: block; }

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

ul, ol { list-style: none; }

button { font: inherit; cursor: pointer; border: none; background: none; }

input, textarea { font: inherit; }

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

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

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

.section {
  padding: 112px 0;
}

.section--muted {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 16px;
}

.section__title {
  font-size: clamp(28px, 3.4vw, 40px);
  max-width: 32ch;
  margin-bottom: 8px;
}

/* Scroll-reveal: JS toggles .is-visible; content is readable by default
   so it never depends on JS for basic access. */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 15px;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn--primary {
  background: var(--ink);
  color: var(--surface);
}
.btn--primary:hover { transform: translateY(-2px); background: var(--accent); }

.btn--ghost {
  border: 1px solid var(--border);
  color: var(--ink);
  background: var(--surface);
}
.btn--ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

.btn--small { padding: 9px 18px; font-size: 14px; }

/* ==========================================================
   NAV
   ========================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 248, 250, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 72px;
}

.nav__logo {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 17px;
}
.nav__logo-dot { color: var(--accent); }

.nav__links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font-size: 14px;
  color: var(--muted);
}
.nav__links a:hover { color: var(--ink); }

.nav__cta { margin-left: 8px; }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 24px;
}
.nav__toggle span {
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

/* ==========================================================
   HERO
   ========================================================== */
.hero {
  padding: 96px 0 112px;
}

.hero__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero__title {
  font-size: clamp(36px, 5vw, 56px);
  margin-bottom: 22px;
}

.hero__title .hl { color: var(--accent); }

.hero__sub {
  color: var(--muted);
  font-size: 17px;
  max-width: 46ch;
  margin-bottom: 36px;
}

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

/* --- Signature element: mock code editor --- */
.editor {
  background: var(--editor-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.editor__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.editor__dot { width: 11px; height: 11px; border-radius: 50%; }
.editor__dot--red { background: #FF5F57; }
.editor__dot--yellow { background: #FEBC2E; }
.editor__dot--green { background: #28C840; }

.editor__filename {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(228,231,235,0.5);
  margin-left: 8px;
}

.editor__body {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.8;
  color: var(--editor-text);
  padding: 24px 20px;
  min-height: 220px;
  white-space: pre-wrap;
  word-break: break-word;
}

.editor__cursor {
  display: inline-block;
  width: 7px;
  height: 15px;
  background: var(--mint);
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Syntax-style spans injected by script.js */
.tok-key { color: #7FB2FF; }
.tok-str { color: #A5E8C4; }
.tok-punct { color: rgba(228,231,235,0.55); }
.tok-bool { color: #FFAE7A; }

/* ==========================================================
   ABOUT
   ========================================================== */
.about__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  margin-top: 40px;
}

.about__text p {
  color: var(--muted);
  margin-bottom: 16px;
  max-width: 58ch;
}

.about__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-content: start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
}

.fact dt {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.fact dd { font-weight: 500; }

/* ==========================================================
   SKILLS
   ========================================================== */
.skills {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.skill-group {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.skill-group h3 {
  font-size: 15px;
  margin-bottom: 14px;
}

.skill-group__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* ==========================================================
   PROJECTS
   ========================================================== */
.projects {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.project-card__thumb {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(255,255,255,0.85);
}

.project-card__body { padding: 22px; }

.project-card__body h3 { font-size: 18px; margin-bottom: 8px; }

.project-card__body p {
  color: var(--muted);
  font-size: 14.5px;
  margin-bottom: 16px;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.project-card__tags span {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}
.project-card__tags span:not(:last-child)::after { content: '·'; margin-left: 6px; color: var(--border); }

.project-card__link {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.project-card__link:hover { text-decoration: underline; }

/* ==========================================================
   SERVICES
   ========================================================== */
.services {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.service-card {
  padding: 26px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
}

.service-card h3 { font-size: 17px; margin-bottom: 10px; }
.service-card p { color: var(--muted); font-size: 14.5px; }

/* ==========================================================
   CONTACT
   ========================================================== */
.contact { max-width: 720px; }

.contact__sub { color: var(--muted); margin-top: 4px; }

.contact__form {
  margin-top: 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field--full { grid-column: 1 / -1; }

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

.field input,
.field textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--surface);
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.15s ease;
}
.field input:focus,
.field textarea:focus { border-color: var(--accent); outline: none; }

.form__note {
  grid-column: 1 / -1;
  font-size: 14px;
  color: var(--mint);
  min-height: 20px;
}

/* ==========================================================
   FOOTER
   ========================================================== */
.footer { border-top: 1px solid var(--border); }

.footer__inner {
  padding: 32px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
}

.footer__social { display: flex; gap: 20px; }
.footer__social a:hover { color: var(--ink); }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .about__grid { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }
}

@media (max-width: 720px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: flex; }

  .nav__links.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
    gap: 16px;
  }

  .contact__form { grid-template-columns: 1fr; }
  .contact__form .field--full { grid-column: 1; }
}
