/* Dark is the default theme. Light overrides the same tokens below. */
:root {
  color-scheme: dark;
  --bg: #0b0e14;
  --bg-2: #10141d;
  --card: #141926;
  --line: #232a3b;
  --text: #e8ecf4;
  --muted: #97a1b6;
  --accent: #f5a524;
  --accent-text: #f5a524;
  --on-accent: #17120a;
  --accent-2: #4fd1c5;
  --danger: #f07167;
  --bg-rgb: 11, 14, 20;
  --accent-rgb: 245, 165, 36;
  --accent-2-rgb: 79, 209, 197;
  --danger-rgb: 240, 113, 103;
  --veil-top: .93;
  --veil-bottom: .97;
  --panel-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  --thumb-a: #1a2133;
  --thumb-b: #111623;
  --thumb-label: rgba(245, 165, 36, .28);
  --radius: 14px;
  --max: 1160px;
  --font-head: "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7fb;
  --bg-2: #eceff6;
  --card: #ffffff;
  --line: #dde2ec;
  --text: #141a26;
  --muted: #566074;
  --accent-text: #9a5600;
  --accent-2: #0f766e;
  --danger: #c63a2f;
  --bg-rgb: 246, 247, 251;
  --accent-2-rgb: 15, 118, 110;
  --danger-rgb: 198, 58, 47;
  --veil-top: .88;
  --veil-bottom: .95;
  --panel-shadow: 0 24px 60px rgba(20, 26, 38, .12);
  --thumb-a: #edf0f7;
  --thumb-b: #dfe5f1;
  --thumb-label: rgba(154, 86, 0, .3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(var(--accent-rgb), .13), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(var(--accent-2-rgb), .08), transparent 60%),
    linear-gradient(rgba(var(--bg-rgb), var(--veil-top)), rgba(var(--bg-rgb), var(--veil-bottom)));
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; letter-spacing: -.02em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); max-width: 22ch; }
.eyebrow {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent-text); margin-bottom: 14px;
}

/* nav */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 14px max(20px, calc((100vw - var(--max)) / 2));
  background: rgba(var(--bg-rgb), .82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 600; margin-right: auto; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent); color: var(--on-accent); font-size: .8rem; font-weight: 700;
}
.nav-links { display: flex; align-items: center; gap: 26px; font-size: .92rem; color: var(--muted); }
.nav-links a:hover { color: var(--text); }
.nav-links { order: 1; }
.theme-toggle {
  order: 2; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: transparent; color: var(--text); border: 1px solid var(--line); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent-text); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
.nav-toggle { order: 3; display: none; background: none; border: 0; width: 36px; height: 36px; cursor: pointer; }
.nav-toggle span { display: block; height: 2px; margin: 6px 6px; background: var(--text); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: 10px; font-weight: 600; font-size: .95rem;
  background: var(--accent); color: var(--on-accent) !important; border: 1px solid var(--accent);
  cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(var(--accent-rgb), .25); }
.btn-ghost { background: transparent; color: var(--text) !important; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); box-shadow: none; }
.btn-small { padding: 8px 16px; font-size: .88rem; }

/* hero */
.hero {
  max-width: var(--max); margin: 0 auto; padding: 96px 20px 80px;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center;
}
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); }
.hero-role { margin-top: 16px; font-family: var(--font-head); font-size: clamp(1.05rem, 2vw, 1.35rem); color: var(--accent-2); }
.hero-headline { margin-top: 26px; font-family: var(--font-head); font-weight: 600; font-size: clamp(1.3rem, 2.6vw, 1.8rem); line-height: 1.25; letter-spacing: -.01em; max-width: 24ch; }
.hero-tagline { margin-top: 14px; color: var(--muted); font-size: 1.08rem; max-width: 54ch; }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }

.hero-panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--panel-shadow); overflow: hidden; font-family: var(--font-mono); font-size: .84rem;
}
.panel-head { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.panel-title { margin-left: 8px; color: var(--muted); font-size: .76rem; }
.fixes { list-style: none; padding: 10px 18px 6px; }
.fixes li {
  display: grid; gap: 5px; padding: 13px 0; border-bottom: 1px dashed var(--line);
  opacity: 0; animation: step .5s forwards;
}
.fixes li:last-child { border-bottom: 0; }
.fixes li:nth-child(1) { animation-delay: .3s; }
.fixes li:nth-child(2) { animation-delay: .9s; }
.fixes li:nth-child(3) { animation-delay: 1.5s; }
.fixes li:nth-child(4) { animation-delay: 2.1s; }
.fix-problem, .fix-solution { padding-left: 24px; position: relative; }
.fix-problem { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(var(--danger-rgb), .7); }
.fix-solution { color: var(--text); }
.fix-problem::before, .fix-solution::before { position: absolute; left: 0; text-decoration: none; display: inline-block; }
.fix-problem::before { content: "✕"; color: var(--danger); }
.fix-solution::before { content: "✓"; color: var(--accent-2); }
.panel-foot { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); color: var(--accent-2); font-size: .78rem; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); animation: pulse 1.8s infinite; }
@keyframes step { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(var(--accent-2-rgb), .6); } 100% { box-shadow: 0 0 0 10px rgba(var(--accent-2-rgb), 0); } }

/* sections */
.section { max-width: var(--max); margin: 0 auto; padding: 84px 20px; border-top: 1px solid var(--line); }
.section-head { margin-bottom: 40px; }
.grid { display: grid; gap: 20px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; transition: border-color .2s, transform .2s;
}
.card:hover { border-color: rgba(var(--accent-rgb), .55); transform: translateY(-3px); }

/* problems I solve */
.section-sub { color: var(--muted); font-size: 1.05rem; margin-top: 14px; max-width: 60ch; }
.problems { display: grid; gap: 16px; }
.problem { display: grid; grid-template-columns: 1fr 40px 1.35fr; gap: 22px; align-items: center; padding: 26px 28px; }
.label { display: inline-block; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; }
.label-problem { color: var(--danger); }
.label-solution { color: var(--accent-2); }
.card .problem-quote { color: var(--text); font-size: 1.08rem; line-height: 1.5; }
.problem-arrow { font-size: 1.5rem; color: var(--accent-text); text-align: center; }
.solution-side h3 { margin: 0 0 8px; }
.card .proof { margin-top: 10px; color: var(--text); font-size: .9rem; padding-left: 12px; border-left: 2px solid var(--accent); }
.solution-side .tags { margin-top: 14px; }
.problems-cta {
  margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 28px; border: 1px dashed rgba(var(--accent-rgb), .5); border-radius: var(--radius);
}
.problems-cta p { font-family: var(--font-head); font-size: 1.15rem; }

/* about */
.about { display: grid; grid-template-columns: 220px 1fr; gap: 44px; align-items: start; }
.avatar {
  width: 220px; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden;
  display: grid; place-items: center; background: var(--card); border: 1px solid var(--line);
  font-family: var(--font-head); font-size: 3.4rem; font-weight: 700; color: var(--accent-text);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.about-text p { color: var(--muted); font-size: 1.06rem; margin-bottom: 16px; max-width: 68ch; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 44px; }
.stat { padding: 20px 0 0; border-top: 2px solid var(--line); position: relative; }
.stat::before { content: ""; position: absolute; top: -2px; left: 0; width: 44px; height: 2px; background: var(--accent); }
.stat strong { display: block; font-family: var(--font-head); font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .9rem; }

/* experience */
.timeline-wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }
.timeline { display: grid; gap: 20px; }
.card .org { color: var(--accent-2); font-size: .92rem; }

/* services */
.services { grid-template-columns: repeat(3, 1fr); }
.service-num { font-family: var(--font-mono); font-size: .76rem; color: var(--accent-text); }
.card h3 { font-size: 1.15rem; margin: 10px 0; }
.card p { color: var(--muted); font-size: .95rem; }
.card ul { list-style: none; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.card li { font-size: .88rem; color: var(--text); padding: 3px 0 3px 18px; position: relative; }
.card li::before { content: ""; position: absolute; left: 0; top: 12px; width: 8px; height: 2px; background: var(--accent-2); }

/* projects */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.filter {
  font-family: var(--font-mono); font-size: .78rem; padding: 7px 14px; border-radius: 999px;
  background: transparent; color: var(--muted); border: 1px solid var(--line); cursor: pointer;
}
.filter:hover { color: var(--text); }
.filter.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.projects { grid-template-columns: repeat(3, 1fr); }
.project { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.thumb {
  position: relative; aspect-ratio: 16 / 9; width: 100%; border: 0; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--thumb-a), var(--thumb-b)); color: var(--muted);
  font-family: var(--font-mono); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase;
  border-bottom: 1px solid var(--line); overflow: hidden;
}
button.thumb { cursor: pointer; }
.thumb-label { font-family: var(--font-head); font-size: 2.6rem; font-weight: 700; letter-spacing: -.02em; text-transform: none; color: var(--thumb-label); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.play {
  position: relative; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-size: 1.1rem; padding-left: 4px;
  box-shadow: 0 8px 26px rgba(0,0,0,.5); transition: transform .2s;
}
button.thumb:hover .play { transform: scale(1.1); }
.project-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.project-meta { display: flex; justify-content: space-between; gap: 10px; font-family: var(--font-mono); font-size: .72rem; }
.project-meta .cat { color: var(--accent-text); letter-spacing: .08em; text-transform: uppercase; }
.project-meta .client { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tag { font-family: var(--font-mono); font-size: .72rem; padding: 4px 9px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); }
.project-links { margin-top: auto; padding-top: 18px; display: flex; gap: 16px; font-size: .88rem; font-weight: 600; }
.project-links a, .project-links button { color: var(--accent-text); background: none; border: 0; font: inherit; cursor: pointer; }
.project-links a:hover, .project-links button:hover { text-decoration: underline; }

/* skills */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.skills h3 { font-size: 1rem; margin-bottom: 4px; }

/* process */
.process { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.process li { counter-increment: step; padding-top: 20px; border-top: 2px solid var(--line); position: relative; }
.process li::before {
  content: "0" counter(step); position: absolute; top: -2px; left: 0; width: 44px; height: 2px; background: var(--accent);
  font-size: 0;
}
.process li::after { content: "0" counter(step); font-family: var(--font-mono); font-size: .78rem; color: var(--accent-text); position: absolute; top: 20px; right: 0; }
.process h3 { font-size: 1.1rem; margin-bottom: 8px; }
.process p { color: var(--muted); font-size: .94rem; }

/* contact */
.contact { text-align: center; padding-bottom: 110px; }
.contact h2 { max-width: 20ch; margin: 0 auto; font-size: clamp(2rem, 4.6vw, 3.2rem); }
.contact-sub { color: var(--muted); max-width: 52ch; margin: 18px auto 0; }
.contact-actions { margin-top: 34px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.footer { max-width: var(--max); margin: 0 auto; padding: 44px 20px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 36px; }
.footer-grid p { margin-bottom: 10px; max-width: 46ch; }
.footer-grid nav a { display: block; padding: 3px 0; }
.footer-name { font-family: var(--font-head); font-size: 1.1rem; font-weight: 600; color: var(--text); }
.footer-head { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); }
.footer-bar { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.footer a:hover { color: var(--text); }

/* small shared pieces */
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: 0 0 10px 0; font-weight: 600; }
.skip:focus { left: 0; }
.hero h1 .hero-role { display: block; letter-spacing: 0; font-weight: 500; }
.card h3 a:hover, .more:hover, .all-link a:hover { color: var(--accent-text); }
.proof a { color: var(--accent-text); font-weight: 600; white-space: nowrap; }
.proof a:hover { text-decoration: underline; }
a.thumb { cursor: pointer; }

/* articles list, FAQ */
.posts { grid-template-columns: repeat(3, 1fr); }
.post-card { display: flex; flex-direction: column; }
.post-card .more { margin-top: auto; padding-top: 16px; color: var(--accent-text); font-size: .88rem; font-weight: 600; }
.all-link { margin-top: 26px; font-weight: 600; color: var(--accent-text); }
.faq { display: grid; gap: 12px; max-width: 860px; }
.faq details { padding: 0; }
.faq summary { list-style: none; cursor: pointer; padding: 20px 56px 20px 24px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 24px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; color: var(--accent-text); }
.faq details[open] summary::after { content: "–"; }
.faq summary h3 { margin: 0; font-size: 1.05rem; }
.faq details p { padding: 0 24px 22px; max-width: 70ch; }

/* article and project pages */
.article { border-top: 0; max-width: 860px; padding-top: 56px; }
.article h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); max-width: 24ch; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--font-mono); font-size: .76rem; color: var(--muted); margin-bottom: 30px; }
.crumbs a:hover { color: var(--text); }
.lead { margin-top: 18px; font-size: 1.18rem; color: var(--muted); max-width: 64ch; }
.player { margin-top: 32px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #000; aspect-ratio: 16 / 9; }
.player video { width: 100%; height: 100%; display: block; }
.prose { margin-top: 36px; font-size: 1.06rem; }
.prose h2 { font-size: 1.55rem; margin: 44px 0 14px; max-width: none; }
.prose h3 { font-size: 1.2rem; margin: 30px 0 10px; }
.prose p { margin-bottom: 16px; color: var(--text); max-width: 70ch; }
.prose ul, .prose ol { margin: 0 0 18px 22px; max-width: 68ch; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--accent-text); }
.prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { font-weight: 600; }
.prose blockquote { margin: 22px 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); }
.prose blockquote p { font-family: var(--font-head); font-size: 1.2rem; margin: 0; }
.prose code { font-family: var(--font-mono); font-size: .9em; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.prose pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px; overflow-x: auto; margin-bottom: 18px; }
.prose pre code { border: 0; padding: 0; background: none; }
.prose .tags { margin-top: 0; }
.author { margin-top: 48px; display: grid; grid-template-columns: 84px 1fr; gap: 20px; align-items: start; }
.author:hover { transform: none; }
.avatar-small { width: 84px; font-size: 1.5rem; border-radius: 50%; }
.author p { margin-bottom: 8px; }
.author a { color: var(--accent-text); font-weight: 600; }

/* video modal */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4,6,10,.86); backdrop-filter: blur(4px); }
.modal-box { position: relative; width: min(980px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.modal-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; font-family: var(--font-head); font-size: .95rem; }
.modal-close { background: none; border: 0; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: 4px 8px; }
.modal-close:hover { color: var(--text); }
.modal-media { aspect-ratio: 16 / 9; background: #000; }
.modal-media iframe, .modal-media video { width: 100%; height: 100%; border: 0; display: block; }

/* reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s, transform .6s; }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 64px; }
  .services, .projects, .skills, .posts { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .process, .stats { grid-template-columns: repeat(2, 1fr); }
  .timeline-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: flex-start;
    gap: 16px; padding: 20px; background: var(--bg-2); border-bottom: 1px solid var(--line);
  }
  .nav-links.open { display: flex; }
  .services, .projects, .skills, .process, .posts, .footer-grid { grid-template-columns: 1fr; }
  .avatar.avatar-small { width: 64px; font-size: 1.2rem; }
  .author { grid-template-columns: 64px 1fr; }
  .article { padding-top: 36px; }
  .problem { grid-template-columns: 1fr; gap: 14px; padding: 22px; }
  .problem-arrow { text-align: left; transform: rotate(90deg); width: 24px; }
  .about { grid-template-columns: 1fr; gap: 24px; }
  .avatar { width: 140px; font-size: 2.4rem; }
  .section { padding: 60px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .fixes li, .js .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* private video note */
.thumb-note { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em; text-transform: none; color: var(--muted); }
.video-note { margin-top: 26px; padding: 14px 18px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); font-size: .95rem; }
