:root {
  --ink: #0c0e13;
  --ink-2: #10131a;
  --panel: #151922;
  --panel-2: #1b202b;
  --border: #2a303d;
  --border-soft: #20252f;

  --text: #e9e6dd;
  --text-dim: #9aa1b0;
  --text-faint: #5c6274;

  --accent: #c98a3e;
  --accent-bright: #e3a75c;
  --accent-soft: rgba(201, 138, 62, 0.14);
  --accent2: #6f93ab;
  --syntax-str: #9fb98f;

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --radius: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}


body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}


body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
i { line-height: 1; }

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

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


.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cursor-dot {
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--accent-bright);
}

.cursor-ring {
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 1px solid var(--border);
  transition: opacity 0.3s ease, width 0.25s var(--ease), height 0.25s var(--ease), margin 0.25s var(--ease), border-color 0.25s ease;
}

html.cursor-active .cursor-dot,
html.cursor-active .cursor-ring { opacity: 1; }

html.cursor-active .cursor-ring.hovering {
  width: 54px; height: 54px;
  margin: -27px 0 0 -27px;
  border-color: var(--accent);
}

html.cursor-active, html.cursor-active a, html.cursor-active button {
  cursor: none;
}


header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 22px 6vw;
  transition: padding 0.35s var(--ease), background 0.35s var(--ease), border-color 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}

header.scrolled {
  padding: 13px 6vw;
  background: rgba(12, 14, 19, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border-soft);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1240px;
  margin: 0 auto;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2.2rem;
  font-family: var(--font-mono);
  font-size: 0.83rem;
}

.nav-links a {
  position: relative;
  color: var(--text-dim);
  transition: color 0.25s var(--ease);
  padding-bottom: 4px;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}

.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after, .nav-links a:hover::after { width: 100%; }


#home {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 140px 6vw 100px;
  overflow: hidden;
}

.animated-bg {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(560px circle at 18% 22%, var(--accent-soft), transparent 60%),
    radial-gradient(620px circle at 82% 78%, rgba(111, 147, 171, 0.14), transparent 60%);
  filter: blur(10px);
  animation: driftBg 22s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes driftBg {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(3%, -4%) scale(1.08); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1180px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-text {
  opacity: 0;
  transform: translateY(20px);
  animation: riseIn 0.8s var(--ease) 0.1s forwards;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent2);
  letter-spacing: 0.04em;
  margin-bottom: 1.2rem;
}

.eyebrow-line { color: var(--text-faint); margin-right: 0.6rem; }
.eyebrow.center { text-align: center; margin: 0 0 0.6rem; }

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.4vw, 3.6rem);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 em { font-style: normal; color: var(--accent-bright); }

.hero-copy {
  margin-top: 1.3rem;
  max-width: 46ch;
  color: var(--text-dim);
  font-size: 1.05rem;
}

/* --- the editor visual --- */
.hero-editor {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 40px 90px -30px rgba(0,0,0,0.65);
  opacity: 0;
  transform: translateY(24px) rotateX(4deg);
  transform-style: preserve-3d;
  perspective: 800px;
  animation: riseIn 0.9s var(--ease) 0.3s forwards;
  overflow: hidden;
}

@keyframes riseIn { to { opacity: 1; transform: translateY(0); } }

.editor-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-soft);
}

.editor-dots {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #4a5063;
  box-shadow: 18px 0 0 #4a5063, 36px 0 0 #4a5063;
}

.editor-filename {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-faint);
}

.editor-body {
  display: flex;
  padding: 1.4rem 0;
  font-family: var(--font-mono);
  font-size: 0.86rem;
}

.editor-gutter {
  display: flex;
  flex-direction: column;
  padding: 0 1rem 0 1.3rem;
  color: var(--text-faint);
  opacity: 0.6;
  text-align: right;
  line-height: 1.85;
  user-select: none;
}

.editor-code {
  flex: 1;
  padding-right: 1.4rem;
  color: var(--text);
  line-height: 1.85;
  white-space: pre;
  overflow-x: auto;
}

.tok-comment { color: var(--text-faint); }
.tok-key { color: var(--accent2); }
.tok-str { color: var(--syntax-str); }

.editor-terminal {
  border-top: 1px solid var(--border-soft);
  padding: 0.95rem 1.3rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  background: rgba(0,0,0,0.15);
}

.term-prompt { color: var(--accent); margin-right: 0.5rem; }
.term-static { color: var(--text-faint); margin-right: 0.4rem; }
.typing-effect { color: var(--accent-bright); font-weight: 500; }

.cursor { color: var(--accent); animation: blink 0.9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   BUTTONS
   ============================================================ */
.cta-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2.2rem;
  padding: 0.85rem 1.6rem;
  background: var(--accent);
  color: #16110a;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.35s var(--ease), transform 0.15s ease-out;
  box-shadow: 0 12px 30px -14px rgba(201, 138, 62, 0.7);
  will-change: transform;
}

.cta-btn i { transition: transform 0.3s var(--ease); font-size: 0.85em; }
.cta-btn:hover { box-shadow: 0 16px 36px -14px rgba(201, 138, 62, 0.85); }
.cta-btn:hover i { transform: translateX(4px); }

.cta-btn.text-btn {
  background: transparent;
  color: var(--accent-bright);
  border: 1px solid var(--border);
  box-shadow: none;
}

.cta-btn.text-btn:hover { border-color: var(--accent); background: var(--accent-soft); }

.cta-btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0);
  animation: rippleOut 0.6s ease-out;
  pointer-events: none;
}

@keyframes rippleOut { to { transform: scale(3.2); opacity: 0; } }

.scroll-cue {
  position: absolute;
  bottom: 34px; left: 50%;
  transform: translateX(-50%);
  width: 22px; height: 36px;
  border: 1px solid var(--border);
  border-radius: 20px;
  z-index: 1;
}

.scroll-cue span {
  position: absolute;
  top: 7px; left: 50%;
  width: 4px; height: 4px;
  margin-left: -2px;
  background: var(--accent);
  border-radius: 50%;
  animation: scrollDown 1.8s ease-in-out infinite;
}

@keyframes scrollDown {
  0%   { top: 7px; opacity: 1; }
  70%  { top: 20px; opacity: 0; }
  100% { top: 20px; opacity: 0; }
}


.marquee {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  padding: 1.4rem 0;
  overflow: hidden;
  background: var(--ink-2);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
  display: flex;
  gap: 3.2rem;
  width: max-content;
  animation: marqueeScroll 26s linear infinite;
}

.marquee-track span {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-faint);
  white-space: nowrap;
}

.marquee-track i { color: var(--accent2); font-size: 1rem; }

@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}


#services {
  position: relative;
  z-index: 1;
  padding: 8rem 6vw;
  max-width: 1240px;
  margin: 0 auto;
  text-align: center;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 3.2rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
  text-align: left;
}

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.2rem 1.8rem 2rem;
  overflow: hidden;
  opacity: 0;
  transform: translateY(28px);
  transition: border-color 0.4s var(--ease), transform 0.15s ease-out, box-shadow 0.3s ease;
  will-change: transform;
}

.card.in-view { animation: riseIn 0.7s var(--ease) forwards; }

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 20px 50px -25px rgba(0,0,0,0.6);
}

.card-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 70%);
  pointer-events: none;
}

.card:hover .card-glow { opacity: 1; }

.card-index {
  position: absolute;
  top: 1.2rem; right: 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}

.card i { font-size: 1.4rem; color: var(--accent-bright); margin-bottom: 1.1rem; display: inline-block; }
.card h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; margin-bottom: 0.6rem; }
.card p { color: var(--text-dim); font-size: 0.95rem; }


#process {
  position: relative;
  z-index: 1;
  padding: 7rem 6vw 8rem;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.commit-log {
  text-align: left;
  margin-top: 1rem;
}

.commit-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px auto 1fr;
  gap: 0 1.1rem;
  padding: 1.3rem 0;
}

.commit-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 2rem;
  bottom: -0.3rem;
  width: 1px;
  background: var(--border);
}

.commit-node {
  width: 17px; height: 17px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--ink);
}

.commit-hash {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent2);
  white-space: nowrap;
  padding-top: 1px;
}

.commit-msg {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}

.commit-meta { color: var(--text-dim); font-size: 0.92rem; }


#contact {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 7rem 6vw 8rem;
  max-width: 720px;
  margin: 0 auto;
}

.contact-copy { color: var(--text-dim); margin: 1rem auto 0; max-width: 48ch; }


footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 6vw;
  border-top: 1px solid var(--border-soft);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.eof { color: var(--text-faint); opacity: 0.6; margin-left: 0.4rem; }


@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; text-align: left; }
  .hero-editor { max-width: 560px; }
}

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav-links { gap: 1rem; font-size: 0.72rem; }
  .logo { font-size: 1.05rem; }
  header { padding: 18px 5vw; }
  header.scrolled { padding: 12px 5vw; }
  #home { padding: 120px 5vw 70px; }
  .editor-body { font-size: 0.76rem; }
  .commit-item { grid-template-columns: 14px 1fr; }
  .commit-hash { grid-column: 2; grid-row: 1; }
  .commit-body { grid-column: 2; grid-row: 2; }
}

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