:root {
  --background: #061015;
  --foreground: #ecf4ef;
  --surface: #0a171e;
  --card: #0d1b22;
  --primary: #c8ff4a;
  --primary-foreground: #071005;
  --secondary: #15313b;
  --secondary-foreground: #dbe8e2;
  --muted: #132129;
  --muted-foreground: #91a79f;
  --border: #20343c;
  --body-text: #b6c7c0;
  --line-num: #52676e;
  --font-base: "IBM Plex Sans", system-ui, sans-serif;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --radius-sm: .375rem;
  --radius: .625rem;
  --radius-md: .875rem;
  --radius-lg: 1.25rem;
  --radius-full: 999px;
  --shadow-lg: 0 28px 80px rgba(0,0,0,.42);
  --shadow-md: 0 18px 48px rgba(0,0,0,.32);
  --dur-fast: .14s;
  --dur-normal: .26s;
  --dur-slow: .52s;
  --container: min(1180px, calc(100% - 3rem));
}

* { box-sizing: border-box; padding: 0; margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-base);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ===== Page background grid ===== */
.page {
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(rgba(113,199,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(113,199,255,.035) 1px, transparent 1px),
    var(--background);
  background-size: 48px 48px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; font-weight: 500; border-radius: var(--radius);
  white-space: nowrap; cursor: pointer; border: 1px solid transparent;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.btn:focus-visible { box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--primary); outline: none; }
.btn svg { flex-shrink: 0; }
.btn-sm { height: 1.5rem; padding: 0 .75rem; font-size: .875rem; }
.btn-sm svg { width: 1rem; height: 1rem; }
.btn-md { height: 2.5rem; padding: 0 1rem; font-size: .9375rem; }
.btn-lg { height: 3rem; padding: 0 1.25rem; font-size: 1rem; border-radius: var(--radius-md); }
.btn-lg svg { width: 1.5rem; height: 1.5rem; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.btn-primary:hover { background: #b8f53e; border-color: #b8f53e; transform: translateY(-1px); }
.btn-primary:active { background: #a8e835; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(200,255,74,.12); }

/* ===== Header ===== */
.header {
  position: sticky; top: 0; z-index: 50;
  width: var(--container); height: 76px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(6,16,21,.88);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: .75rem; font-weight: 600; }
.brand-mark {
  width: 2.25rem; height: 2.25rem; display: grid; place-items: center;
  border: 1px solid var(--primary); border-radius: var(--radius-sm);
  color: var(--primary); font-family: var(--font-mono); font-size: .78rem; letter-spacing: -.04em;
}
.brand-name { font-family: var(--font-display); font-size: 1rem; }
.nav { display: flex; align-items: center; gap: 2rem; }
.nav a { color: var(--muted-foreground); font-size: .9rem; transition: color var(--dur-fast) ease; }
.nav a:hover, .nav a.active { color: var(--primary); }

.menu-toggle { display: none; flex-direction: column; gap: 5px; padding: .5rem; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--foreground); border-radius: 2px; transition: transform .25s ease, opacity .25s ease; }
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none; flex-direction: column; gap: 1rem;
  width: var(--container); margin: 0 auto; padding: 1.25rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  position: sticky; top: 84px; z-index: 49;
}
.mobile-nav.open { display: flex; }
.mobile-nav a:not(.btn) { color: var(--muted-foreground); padding: .5rem 0; border-bottom: 1px solid var(--border); }

/* ===== Eyebrow ===== */
.eyebrow {
  margin: 0 0 1rem; color: var(--primary);
  font-family: var(--font-mono); font-size: .78rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
}

/* ===== Hero ===== */
.hero {
  position: relative; width: var(--container);
  min-height: calc(100vh - 76px); margin: 0 auto;
  padding: clamp(5rem, 10vw, 8.5rem) 0 6rem;
  display: grid; grid-template-columns: minmax(0,1.08fr) minmax(350px,.72fr);
  gap: clamp(3rem, 8vw, 7rem); align-items: center;
}
.hero::before {
  content: ""; position: absolute; width: 34rem; height: 34rem;
  right: -15rem; top: 3rem; border-radius: 50%;
  background: rgba(200,255,74,.07); filter: blur(90px); pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.availability {
  width: fit-content; margin-bottom: 2.25rem; padding: .5rem .75rem;
  display: flex; align-items: center; gap: .6rem;
  border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--surface); color: var(--muted-foreground);
  font-family: var(--font-mono); font-size: .74rem;
  text-transform: uppercase; letter-spacing: .08em;
}
.availability-dot {
  width: .45rem; height: .45rem; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 0 5px rgba(200,255,74,.1);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 5px rgba(200,255,74,.1);} 50% { box-shadow: 0 0 0 8px rgba(200,255,74,.05);} }
.hero h1 {
  margin: 0; font-family: var(--font-display);
  font-size: clamp(3.7rem, 8vw, 7.4rem); font-weight: 650;
  letter-spacing: -.065em; line-height: .88;
}
.hero h1 span { display: block; color: var(--muted-foreground); }
.hero-text { max-width: 640px; margin: 2rem 0 0; color: var(--body-text); font-size: clamp(1.05rem, 1.7vw, 1.24rem); line-height: 1.7; }
.hero-actions { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.secondary-cta { color: var(--foreground); }

/* Hero visual card */
.hero-visual {
  position: relative; z-index: 1;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: rgba(13,27,34,.86); box-shadow: var(--shadow-lg);
  overflow: hidden; transform: rotate(1.25deg);
  transition: transform var(--dur-normal) ease;
}
.hero-visual:hover { transform: rotate(0deg); }
.visual-header, .skill-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.1rem; border-bottom: 1px solid var(--border);
  color: var(--muted-foreground); font-family: var(--font-mono); font-size: .74rem;
}
.live-label { color: var(--primary); }
.live-label::before { content: "● "; font-size: .6rem; }
.visual-body { padding: 1.6rem 1.25rem; }
.code-line {
  display: grid; grid-template-columns: 2rem 1fr; gap: .75rem;
  padding: .7rem 0; color: var(--body-text);
  font-family: var(--font-mono); font-size: .9rem;
  border-left: 2px solid transparent; padding-left: .5rem;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.code-line:hover { background: rgba(200,255,74,.05); border-left-color: var(--primary); }
.code-line b { color: var(--primary); font-weight: 500; }
.line-number { color: var(--line-num); }
.visual-footer {
  display: flex; align-items: center; justify-content: flex-start; gap: .75rem;
  padding: .9rem 1.1rem; border-top: 1px solid var(--border);
  background: #09141a; line-height: 1.4;
  color: var(--muted-foreground); font-family: var(--font-mono); font-size: .74rem;
}
.visual-footer svg { width: 1rem; color: var(--primary); flex-shrink: 0; }

/* ===== Sections ===== */
.section { width: var(--container); margin: 0 auto; padding: clamp(5.5rem, 10vw, 9rem) 0; border-top: 1px solid var(--border); }
.section-intro { max-width: 660px; margin-bottom: 3.5rem; }
.section h2, .contact h2 {
  margin: 0; font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 4.7rem); font-weight: 600;
  letter-spacing: -.055em; line-height: .98;
}
.section-intro > p:last-child, .skills-copy > p:last-child {
  margin: 1.5rem 0 0; color: var(--muted-foreground); font-size: 1.08rem; line-height: 1.7;
}

/* Services */
.service-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--border); border-left: 1px solid var(--border);
}
.service-card {
  min-height: 290px; padding: 2rem;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: rgba(13,27,34,.72);
  transition: background var(--dur-normal) ease, transform var(--dur-normal) ease;
}
.service-card:hover { background: var(--card); transform: translateY(-3px); }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4rem; }
.card-top svg { width: 1.5rem; color: var(--primary); }
.card-top span { color: var(--muted-foreground); font-family: var(--font-mono); font-size: .75rem; }
.service-card h3, .process-list h3 {
  margin: 0 0 .75rem; font-family: var(--font-display);
  font-size: 1.55rem; font-weight: 550; letter-spacing: -.025em;
}
.service-card p, .process-list p { margin: 0; color: var(--muted-foreground); line-height: 1.65; }

/* Process */
.process-section { display: grid; grid-template-columns: minmax(0,.8fr) minmax(420px,1.2fr); gap: clamp(3rem, 8vw, 7rem); }
.process-list li { display: grid; grid-template-columns: 3rem 1fr; gap: 1.5rem; padding: 1.75rem 0; border-top: 1px solid var(--border); transition: padding-left var(--dur-fast) ease; }
.process-list li:last-child { border-bottom: 1px solid var(--border); }
.process-list li:hover { padding-left: .5rem; }
.process-list > li > span { color: var(--primary); font-family: var(--font-mono); font-size: .78rem; }

/* Skills */
.skills-section { display: grid; grid-template-columns: minmax(0,.9fr) minmax(420px,1.1fr); gap: clamp(3rem, 8vw, 8rem); align-items: center; }
.skill-panel { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); overflow: hidden; box-shadow: var(--shadow-md); }
.skill-header span:last-child { color: var(--primary); }
.skill-list { padding: 1.5rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.skill-list li {
  padding: .9rem; display: flex; align-items: center; gap: .7rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); font-family: var(--font-mono); font-size: .85rem;
  transition: border-color var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.skill-list li:hover { border-color: var(--primary); transform: translateY(-2px); }
.skill-list svg { width: 1rem; color: var(--primary); flex-shrink: 0; }

/* Contact */
.contact {
  width: var(--container); margin: 0 auto 2rem;
  padding: clamp(3rem, 7vw, 5.5rem);
  display: grid; grid-template-columns: 1.2fr .8fr;
  gap: clamp(2.5rem, 7vw, 6rem); align-items: end;
  border: 1px solid #38503f; border-radius: var(--radius-lg);
  background: radial-gradient(circle at 85% 20%, rgba(200,255,74,.13), transparent 34%), var(--card);
}
.contact-action p { margin: 0 0 1.5rem; color: var(--body-text); font-size: 1.05rem; line-height: 1.65; }
.contact-action small { display: block; margin-top: .75rem; color: var(--muted-foreground); font-size: .75rem; }

/* Footer */
.footer {
  width: var(--container); min-height: 130px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 2rem; align-items: center;
  color: var(--muted-foreground); font-size: .86rem;
}
.back-to-top { justify-self: end; display: inline-flex; align-items: center; gap: .5rem; color: var(--muted-foreground); font-size: .9rem; transition: color var(--dur-fast) ease; }
.back-to-top:hover { color: var(--primary); }
.back-to-top svg { width: 1rem; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity var(--dur-slow) ease, transform var(--dur-slow) ease; }
.reveal.revealed { opacity: 1; transform: translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .nav { display: none; }
  .menu-toggle { display: flex; }
  .hero { min-height: auto; grid-template-columns: 1fr; padding-top: 5rem; }
  .hero-visual { max-width: 620px; transform: none; }
  .process-section, .skills-section, .contact { grid-template-columns: 1fr; }
  .section-intro { margin-bottom: 2.5rem; }
}
@media (max-width: 640px) {
  :root { --container: min(100% - 2rem, 1180px); }
  .header { height: 68px; }
  .header-cta { display: none; }
  .brand-name { font-size: .9rem; }
  .hero { padding: 4.5rem 0; }
  .hero h1 { font-size: clamp(3.25rem, 17vw, 5rem); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .service-grid { grid-template-columns: 1fr; }
  .service-card { min-height: 250px; }
  .process-section, .skills-section { display: block; }
  .skills-copy { margin-bottom: 3rem; }
  .process-section .section-intro { margin-bottom: 2rem; }
  .skill-list { grid-template-columns: 1fr; }
  .contact { padding: 2rem; }
  .footer { padding: 2rem 0; grid-template-columns: 1fr; gap: .75rem; }
  .back-to-top { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .service-card, .reveal { transition: none; }
  .availability-dot { animation: none; }
}
