/* ---------- Theme tokens ---------- */
:root {
  --bg: #f8fafc;
  --bg-2: #ffffff;
  --text: #0f172a;
  --muted: #5b6474;
  --line: #e2e8f0;
  --accent: #dc2626;          /* Laravel-ish red */
  --accent-soft: #fee2e2;
  --accent-text: #ffffff;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --ok: #22c55e;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .06);
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120;
    --bg-2: #111827;
    --text: #e5e7eb;
    --muted: #9aa4b2;
    --line: #1f2937;
    --accent: #f87171;
    --accent-soft: rgba(248, 113, 113, .14);
    --accent-text: #1a0606;
    --code-bg: #060a14;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b1120;
  --bg-2: #111827;
  --text: #e5e7eb;
  --muted: #9aa4b2;
  --line: #1f2937;
  --accent: #f87171;
  --accent-soft: rgba(248, 113, 113, .14);
  --accent-text: #1a0606;
  --code-bg: #060a14;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }

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

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--accent); color: var(--accent-text);
  padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip:focus { left: 12px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent); color: var(--accent-text);
  font-size: 13px; font-weight: 800; letter-spacing: .02em;
}
nav { margin-left: auto; }
.nav-links { display: flex; gap: 4px; list-style: none; }
.nav-links a {
  display: block; padding: 6px 12px; border-radius: 8px;
  text-decoration: none; color: var(--muted); font-weight: 500; font-size: 15px;
}
.nav-links a:hover { color: var(--text); background: var(--line); }

.theme-toggle {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  cursor: pointer;
}
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: block; }
}

/* ---------- Hero ---------- */
.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line); background: var(--bg-2);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 20px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
h1 { font-size: clamp(30px, 4.4vw, 46px); font-weight: 800; }
.hl { color: var(--accent); }
.lead { margin-top: 18px; color: var(--muted); font-size: 18px; max-width: 54ch; }

.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  font: 600 15px var(--font); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.05); }
.btn-ghost { background: transparent; }

/* Terminal */
.terminal {
  margin: 0; border-radius: var(--radius); overflow: hidden;
  background: var(--code-bg); color: var(--code-text);
  box-shadow: var(--shadow); border: 1px solid #1e293b;
}
.term-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.06); }
.term-bar span { width: 11px; height: 11px; border-radius: 50%; background: #334155; }
.term-bar span:nth-child(1) { background: #ef4444; }
.term-bar span:nth-child(2) { background: #eab308; }
.term-bar span:nth-child(3) { background: #22c55e; }
.term-bar em { margin-left: 8px; font: 12.5px var(--mono); color: #94a3b8; font-style: normal; }
pre { margin: 0; overflow-x: auto; }
code { font-family: var(--mono); font-variant-ligatures: none; }
.terminal pre { padding: 18px 18px 20px; font-size: 13.2px; line-height: 1.7; }
.p { color: #94a3b8; }
.ok { color: #4ade80; font-weight: 500; }
.m { color: #94a3b8; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; border-top: 1px solid var(--line); }
.section-title { font-size: 26px; font-weight: 800; margin-bottom: 28px; display: flex; align-items: baseline; gap: 12px; }
.section-title span { font: 500 14px var(--mono); color: var(--accent); }

/* Work */
.job { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.job-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.job h3 { font-size: 20px; }
.when { font: 500 14px var(--mono); color: var(--muted); }
.roles { list-style: none; margin: 16px 0 14px; padding-left: 14px; border-left: 2px solid var(--accent); display: grid; gap: 4px; }
.bullets { padding-left: 20px; display: grid; gap: 8px; }
.bullets li::marker { color: var(--accent); }

/* Projects */
.feature {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: start;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.tag-line { font: 500 12.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 6px; }
.feature h3 { font-size: 26px; margin-bottom: 10px; }
.feature-body > p { color: var(--muted); }
.checks { list-style: none; margin: 18px 0; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 28px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 5px; width: 18px; height: 18px; border-radius: 6px;
  background: var(--accent-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  background-size: 13px; background-repeat: no-repeat; background-position: center;
}
.stack { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 16px; }
.stack li { font: 500 12.5px var(--mono); padding: 3px 9px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.link { font-weight: 600; text-decoration: none; color: var(--accent); }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.code-card { margin: 0; border-radius: 12px; overflow: hidden; background: var(--code-bg); color: var(--code-text); border: 1px solid #1e293b; }
.code-card figcaption { font: 12.5px var(--mono); color: #94a3b8; padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,.06); }
.code-card pre { padding: 16px; font-size: 13px; line-height: 1.7; }
.c { color: #64748b; font-style: italic; }
.k { color: #f9a8d4; }
.s { color: #86efac; }
.f { color: #93c5fd; }
.kw { color: #fca5a5; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }
.card {
  display: flex; flex-direction: column;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.card h3 { font-size: 19px; margin-bottom: 8px; }
.card > p { color: var(--muted); font-size: 15.5px; }
.card .stack { margin-top: auto; padding-top: 14px; }

/* Approach */
.approach { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step { padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); }
.step-n {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent); font: 600 14px var(--mono); margin-bottom: 14px;
}
.step h3 { font-size: 17px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 15px; }

/* Skills + education */
.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; }
.skills { display: grid; grid-template-columns: 110px 1fr; gap: 10px 16px; margin: 0; }
.skills dt { font: 500 13.5px var(--mono); color: var(--accent); padding-top: 2px; }
.skills dd { margin: 0; }
.edu { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.edu h3 { font-size: 17px; margin-bottom: 4px; }
.portrait { margin: 20px 0 0; }
.portrait img { width: 160px; height: 160px; border-radius: 16px; object-fit: cover; border: 1px solid var(--line); }

/* Contact */
.contact-box { text-align: center; max-width: 680px; }
.contact h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
.contact-box > p { color: var(--muted); margin-top: 10px; font-size: 18px; }
.contact .cta { justify-content: center; }
.socials { list-style: none; display: flex; justify-content: center; gap: 22px; margin-top: 24px; flex-wrap: wrap; }
.socials a { color: var(--muted); font-weight: 600; text-decoration: none; }
.socials a:hover { color: var(--accent); }

/* 404 page */
.notfound { border: 0; min-height: 80vh; display: grid; place-items: center; text-align: center; }
.notfound .lead { margin-inline: auto; }
.notfound .cta { justify-content: center; }

.footer { border-top: 1px solid var(--line); padding: 26px 0; color: var(--muted); font-size: 14px; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero-grid, .feature, .two-col { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .approach { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .nav-links { display: none; }
  .theme-toggle { margin-left: auto; }
  .hero { padding: 44px 0 40px; }
  .lead { font-size: 17px; }
  .cards, .approach { grid-template-columns: 1fr; }
  .feature, .job { padding: 20px; }
  .section { padding: 48px 0; }
  .terminal pre { font-size: 11.5px; }
  .code-card pre { font-size: 12px; }
  .skills { grid-template-columns: 1fr; gap: 2px; }
  .skills dd { margin-bottom: 10px; }
  .cta .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card { transition: none; }
}
