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

:root {
  --ink: #0e0d0b;
  --paper: #f5f2ec;
  --cream: #ede9e0;
  --accent: #c84b2f;
  --accent2: #2f6bc8;
  --muted: #7a7570;
  --border: rgba(14,13,11,0.12);
  --mono: 'DM Mono', monospace;
  --serif: 'DM Serif Display', serif;
  --sans: 'DM Sans', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
  cursor: none;
}

/* ── Custom cursor ─────────────────────────────────────── */
.cursor {
  position: fixed;
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s, width 0.2s, height 0.2s, background 0.2s;
  mix-blend-mode: multiply;
}
.cursor-ring {
  position: fixed;
  width: 36px; height: 36px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, width 0.3s, height 0.3s, opacity 0.3s;
  opacity: 0.5;
}
body:hover .cursor { opacity: 1; }

/* ── Nav ───────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 3rem;
  background: transparent;
  transition: background 0.4s, backdrop-filter 0.4s;
}
nav.scrolled {
  background: rgba(245,242,236,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
}
.nav-logo-img {
  height: 106px;
  width: auto;
  display: block;
  mix-blend-mode: multiply;
}
.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}
.nav-links a {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after { width: 100%; background: var(--accent); }

/* ── Hero ──────────────────────────────────────────────── */
#hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
#hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 3rem;
  max-width: 1200px;
}
.hero-tag {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.2s forwards;
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(3.5rem, 8vw, 7rem);
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.9s 0.4s forwards;
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
}
.hero-sub {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.7;
  font-weight: 300;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeUp 0.9s 0.6s forwards;
}
.hero-ctas {
  display: flex;
  gap: 1.25rem;
  opacity: 0;
  animation: fadeUp 0.9s 0.8s forwards;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: 1.5px solid var(--ink);
  transition: background 0.2s, color 0.2s;
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: 1.5px solid var(--border);
  transition: border-color 0.2s, color 0.2s;
}
.btn-outline:hover { border-color: var(--ink); }
.hero-scroll {
  position: absolute;
  bottom: 2.5rem; left: 3rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeUp 0.9s 1.2s forwards;
}
.scroll-line {
  width: 40px;
  height: 1px;
  background: var(--muted);
  animation: scrollPulse 2s 1.5s infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleX(1); }
  50% { opacity: 1; transform: scaleX(1.2); transform-origin: left; }
}

/* ── Stats bar ─────────────────────────────────────────── */
.stats-bar {
  background: var(--ink);
  display: flex;
  padding: 2rem 3rem;
  gap: 0;
}
.stat {
  flex: 1;
  padding: 0 2rem;
  border-right: 1px solid rgba(255,255,255,0.1);
}
.stat:first-child { padding-left: 0; }
.stat:last-child { border-right: none; }
.stat-num {
  font-family: var(--serif);
  font-size: 2.8rem;
  color: #f5f2ec;
  line-height: 1;
  margin-bottom: 0.4rem;
}
.stat-num span { color: var(--accent); }
.stat-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: rgba(245,242,236,0.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Section base ──────────────────────────────────────── */
section { padding: 7rem 3rem; }
.section-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

/* ── About ─────────────────────────────────────────────── */
#about {
  display: block;
  max-width: 720px;
}
.about-text p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-weight: 300;
}
.about-text p strong { color: var(--ink); font-weight: 500; }

.about-image {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.about-image-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--cream);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--muted);
}
.about-image-placeholder .img-icon {
  font-size: 2.5rem;
  opacity: 0.3;
}
.about-image-placeholder p {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.6;
}

/* ── Skills ────────────────────────────────────────────── */
#skills { background: var(--cream); }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  margin-top: 3rem;
  border: 1px solid var(--border);
}
.skill-card {
  background: var(--cream);
  padding: 2rem;
  transition: background 0.2s;
}
.skill-card:hover { background: var(--paper); }
.skill-icon {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  display: block;
}
.skill-name {
  font-family: var(--serif);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}
.skill-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 300;
}
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}
.tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ── Portfolio / Work Showcase ─────────────────────────── */
#showcase {
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
}
#showcase .section-title { color: var(--paper); }
#showcase .section-tag { color: var(--accent); }
.showcase-intro {
  font-size: 1.05rem;
  color: rgba(245,242,236,0.55);
  max-width: 520px;
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 4rem;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 1px;
}
.portfolio-grid.wide {
  grid-template-columns: 1fr;
}

.portfolio-card {
  position: relative;
  background: #181714;
  overflow: hidden;
  cursor: pointer;
}
.portfolio-card:hover .portfolio-overlay { opacity: 1; }
.portfolio-card:hover .portfolio-screenshot { transform: scale(1.03); }

.portfolio-screenshot {
  width: 100%;
  display: block;
  transition: transform 0.5s ease;
  border: none;
}

/* Browser chrome mockup */
.browser-chrome {
  background: #1e1c1a;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.browser-dots {
  display: flex;
  gap: 5px;
}
.browser-dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: block;
}
.dot-red   { background: #ff5f57; }
.dot-yellow{ background: #ffbd2e; }
.dot-green { background: #28ca41; }
.browser-bar {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  height: 20px;
  display: flex;
  align-items: center;
  padding: 0 0.6rem;
}
.browser-url {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: rgba(245,242,236,0.3);
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portfolio-inner {
  display: flex;
  flex-direction: column;
}

/* Rendered live-site inside the card */
.site-preview {
  width: 100%;
  height: 320px;
  overflow: hidden;
  position: relative;
  background: #111;
  flex-shrink: 0;
}
.site-preview iframe {
  width: 200%;
  height: 200%;
  border: none;
  transform: scale(0.5);
  transform-origin: top left;
  pointer-events: none;
  display: block;
  transition: transform 0.4s ease, filter 0.4s ease;
  filter: brightness(0.9);
}
.portfolio-card:hover .site-preview iframe {
  filter: brightness(1);
}

/* Fallback drawn mockup */
.site-mockup {
  width: 100%;
  height: 280px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: rgba(200,75,47,0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 3;
  gap: 0.5rem;
  text-decoration: none;
}
.portfolio-overlay span {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245,242,236,0.9);
}
.portfolio-overlay .overlay-title {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--paper);
  font-style: italic;
}

.portfolio-meta {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.portfolio-meta-left .project-name {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--paper);
  margin-bottom: 0.2rem;
}
.portfolio-meta-left .project-type {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: rgba(245,242,236,0.4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.portfolio-meta .project-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.project-tag {
  font-family: var(--mono);
  font-size: 0.62rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(245,242,236,0.45);
  letter-spacing: 0.04em;
}

/* ── Services ──────────────────────────────────────────── */
#services { padding: 7rem 3rem; }
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 3rem;
}
.service-card {
  padding: 2.5rem;
  background: var(--paper);
  transition: background 0.2s;
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform 0.3s;
  transform-origin: bottom;
}
.service-card:hover::before { transform: scaleY(1); }
.service-card:hover { background: var(--cream); }
.service-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  margin-bottom: 1.25rem;
}
.service-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}
.service-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 300;
}
.service-price {
  display: inline-block;
  margin-top: 1.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
}

/* ── Process ───────────────────────────────────────────── */
#process { background: var(--cream); }
.process-steps {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.process-step {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 2rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
  position: relative;
}
.process-step:last-child { border-bottom: none; }
.step-num {
  font-family: var(--serif);
  font-size: 3rem;
  color: rgba(14,13,11,0.08);
  line-height: 1;
  font-style: italic;
}
.step-content h3 {
  font-family: var(--serif);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}
.step-content p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 300;
}

/* ── Contact ───────────────────────────────────────────── */
#contact {
  background: var(--ink);
  text-align: center;
  padding: 7rem 3rem;
}
#contact .section-title { color: var(--paper); font-size: clamp(2.5rem, 6vw, 4.5rem); }
#contact .section-tag { color: var(--accent); }
.contact-sub {
  color: rgba(245,242,236,0.5);
  font-size: 1.05rem;
  font-weight: 300;
  max-width: 480px;
  margin: 1rem auto 3rem;
  line-height: 1.7;
}
.contact-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}
.contact-link.primary {
  background: var(--accent);
  color: white;
  border: 1.5px solid var(--accent);
}
.contact-link.primary:hover { background: #a83922; border-color: #a83922; }
.contact-link.ghost {
  background: transparent;
  color: var(--paper);
  border: 1.5px solid rgba(245,242,236,0.2);
}
.contact-link.ghost:hover { border-color: var(--paper); }

/* ── Footer ────────────────────────────────────────────── */
footer {
  background: var(--ink);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 2rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(245,242,236,0.3);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

/* ── Animations ────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s, transform 0.7s;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ── Hamburger button ──────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: none;
  border: 1px solid var(--border);
  padding: 0 8px;
  cursor: pointer;
  z-index: 200;
  transition: border-color 0.2s;
}
.nav-hamburger:hover { border-color: var(--accent); }
.nav-hamburger span {
  display: block;
  width: 100%; height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94),
              opacity 0.25s,
              width 0.3s;
  transform-origin: center;
}
/* X state */
.nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Mobile menu drawer ────────────────────────────────── */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--paper);
  z-index: 99;
  flex-direction: column;
  align-items: flex-start;
  padding: 6rem 2rem 3rem;
  border-bottom: 1px solid var(--border);
  gap: 0;
  transform: translateY(-110%);
  transition: transform 0.45s cubic-bezier(0.25,0.46,0.45,0.94);
  box-shadow: 0 8px 40px rgba(14,13,11,0.12);
}
.mobile-menu.open {
  transform: translateY(0);
}
.mobile-links {
  list-style: none;
  width: 100%;
  margin-bottom: 2rem;
}
.mobile-links li {
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s;
}
.mobile-menu.open .mobile-links li { opacity: 1; transform: none; }
.mobile-menu.open .mobile-links li:nth-child(1) { transition-delay: 0.12s; }
.mobile-menu.open .mobile-links li:nth-child(2) { transition-delay: 0.18s; }
.mobile-menu.open .mobile-links li:nth-child(3) { transition-delay: 0.24s; }
.mobile-menu.open .mobile-links li:nth-child(4) { transition-delay: 0.30s; }
.mobile-menu.open .mobile-links li:nth-child(5) { transition-delay: 0.36s; }
.mobile-links a {
  display: block;
  padding: 1.1rem 0;
  font-family: var(--serif);
  font-size: 1.8rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color 0.2s, padding-left 0.2s;
}
.mobile-links a:hover { color: var(--accent); padding-left: 0.5rem; }
.mobile-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.9rem 2rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  border: 1.5px solid var(--ink);
  transition: background 0.2s;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s 0.42s, transform 0.3s 0.42s, background 0.2s;
}
.mobile-menu.open .mobile-cta { opacity: 1; transform: none; }
.mobile-cta:hover { background: var(--accent); border-color: var(--accent); }

/* ── Responsive ────────────────────────────────────────── */
@media (hover: none), (pointer: coarse) {
  .cursor, .cursor-ring { display: none; }
  body { cursor: auto; }
}

@media (max-width: 900px) {
  nav { padding: 1.25rem 1.5rem; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .mobile-menu { display: flex; }

  section { padding: 5rem 1.5rem; }
  #about { grid-template-columns: 1fr; gap: 3rem; }
  .skills-grid { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .stats-bar { flex-direction: column; gap: 2rem; padding: 2.5rem 1.5rem; }
  .stat { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); padding: 0 0 2rem 0; }
  .stat:last-child { border-bottom: none; }
  .hero-content { padding: 0 1.5rem; }
  .hero-scroll { left: 1.5rem; }
  footer { flex-direction: column; gap: 1rem; text-align: center; }
}

/* prevent body scroll when menu is open */
body.menu-open { overflow: hidden; }
