:root {
  --bg: #050C10;
  --bg-alt: #091619;
  --surface: #0F2326;
  --surface-raised: #142D30;
  --border: #24474A;
  --text: #FFFFFF;
  --muted: #B0B6B8;
  --accent: #A6D98F;
  --accent-hover: #BFE6AC;
  --teal: #3C8575;
  --teal-light: #5BA894;
  --highlight: #F2C96B;

  --font-heading: "Source Serif 4", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --header-h: 72px;
  color-scheme: dark;
}

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

[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.6em;
}
h1 { font-size: 48px; }
h2 { font-size: 32px; margin-bottom: 40px; }
h3 { font-size: 20px; }

p { margin: 0 0 1em; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 780px; }
.muted { color: var(--muted); font-size: 16px; }

/* Buttons */

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  border: 1.5px solid transparent;
  font: 600 16px/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s;
}
.btn-small { padding: 8px 16px; font-size: 15px; }
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-hover); color: var(--bg); box-shadow: 0 0 24px rgba(166, 217, 143, .45); }
.btn-outline { border-color: var(--text); color: var(--text); background: transparent; }
.btn-outline:hover { background: rgba(255, 255, 255, .08); color: var(--text); }

/* Header */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 10;
  transition: background-color .2s, border-color .2s;
  border-bottom: 1px solid transparent;
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; }
.wordmark { font: 600 24px/1 var(--font-heading); color: var(--text); }
.brand-name { font-size: 15px; color: var(--muted); }
.brand-name::before { content: "·"; margin-right: 12px; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.btn) {
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
}
.site-nav a:not(.btn):hover,
.site-nav a.active { color: var(--accent); }

.site-header.scrolled {
  background: rgba(5, 12, 16, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--border);
}

.menu-toggle { display: none; }

/* Hero */

.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: calc(var(--header-h) + 32px) 0 32px;
}
/* The image starts just right of the text column and shrinks on narrower screens,
   so the cell never sits under the text. Every edge fades into the page. */
.hero {
  --content-left: max(24px, calc((100vw - 1100px) / 2 + 24px));
  --text-width: 560px;
}
.hero-image {
  position: absolute;
  top: calc(50% + var(--header-h) / 2);
  left: calc(var(--content-left) + var(--text-width) - 40px);
  width: min(780px, calc(100vw - var(--content-left) - var(--text-width) + 20px));
  height: auto;
  transform: translateY(-50%);
  -webkit-mask-image: radial-gradient(closest-side, #000 50%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 50%, transparent 100%);
}
.hero-inner { position: relative; width: 100%; }
.hero-text { max-width: var(--text-width); }
.hero-sub { color: var(--muted); font-size: 20px; margin-bottom: 40px; }
.hero-ctas { display: flex; gap: 40px; flex-wrap: wrap; }
.cta { max-width: 240px; }
.cta p { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* Sections */

.section { padding: 96px 0; }
.hero + .section { padding-top: 64px; }
.section-alt { background: var(--bg-alt); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

/* Offer */

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 40px; }
.offer { transition: border-color .2s, background-color .2s, box-shadow .2s; }
.offer blockquote {
  position: relative;
  margin: 0 0 20px;
  padding: 24px 0 20px;
  font-style: italic;
  border-bottom: 1px solid var(--border);
}
.offer blockquote::before {
  content: "\201C";
  position: absolute;
  top: -14px;
  left: -4px;
  font: 600 56px/1 var(--font-heading);
  color: var(--accent);
}
.offer .solution { margin: 0; }
.offer .hint { display: none; }

/* On devices with a mouse, the solution appears on hover or keyboard focus */
@media (hover: hover) {
  .offer { cursor: default; }
  .reveal { display: grid; }
  .reveal > * { grid-area: 1 / 1; transition: opacity .25s, transform .25s; }
  .offer .hint {
    display: block;
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    align-self: start;
  }
  .offer .solution { opacity: 0; transform: translateY(8px); }
  .offer:hover,
  .offer:focus-within {
    border-color: var(--teal);
    background: var(--surface-raised);
    box-shadow: 0 0 32px rgba(166, 217, 143, .08);
  }
  .offer:hover .hint,
  .offer:focus-within .hint { opacity: 0; transform: translateY(-8px); }
  .offer:hover .solution,
  .offer:focus-within .solution { opacity: 1; transform: none; }
}

.below-cards { margin-bottom: 8px; }

/* About */

.about { display: grid; grid-template-columns: 280px 1fr; gap: 64px; align-items: start; }
.about h2 { margin-bottom: 24px; }
.about h3 { font-size: 18px; margin-top: 4px; }
.about-text > p { max-width: 36em; margin-bottom: 32px; }
.about-details { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
.photo {
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: 12px;
  overflow: hidden;
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-placeholder {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1.5px dashed var(--border);
  color: var(--muted);
  font-size: 14px;
}
.photo-placeholder svg { width: 64px; height: 64px; fill: none; stroke: var(--teal); stroke-width: 1.5; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font: 400 14px/1 var(--font-mono);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
  border-radius: 6px;
  padding: 8px 10px;
}
.plain-list { list-style: none; padding: 0; margin: 0; }

/* Portfolio */

.portfolio-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.project { padding: 0; overflow: hidden; }
.project > :not(.thumb) { margin-left: 32px; margin-right: 32px; }
.project h3 { margin-top: 24px; }
.project .links { font-size: 15px; margin-bottom: 28px; }
.thumb { background: var(--bg); aspect-ratio: 2 / 1; display: grid; place-items: center; border-bottom: 1px solid var(--border); }
.thumb svg { width: 100%; height: 100%; }
.net-edges line { stroke: var(--muted); stroke-width: 1.5; opacity: .4; }
.n1 { fill: var(--accent); }
.n2 { fill: var(--teal); }
.n3 { fill: var(--highlight); }
.thumb-empty { background: repeating-linear-gradient(135deg, var(--bg), var(--bg) 12px, var(--bg-alt) 12px, var(--bg-alt) 24px); }
.thumb-empty span { font-size: 14px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); padding: 6px 12px; border-radius: 6px; }

/* Process */

.steps {
  list-style: none;
  padding: 0;
  margin: 0 0 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
}
.steps::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  height: 1px;
  background: var(--teal);
}
.steps li { position: relative; }
.step-num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  margin-bottom: 16px;
  position: relative;
  box-shadow: 0 0 0 6px var(--bg-alt);
}
.steps h3 { font-size: 18px; }
.steps p { font-size: 16px; color: var(--muted); }

/* FAQ */

.faq details { border-bottom: 1px solid var(--border); }
.faq details:first-child { border-top: 1px solid var(--border); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 40px 20px 0;
  font-weight: 600;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent); }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  font-weight: 400;
  color: var(--accent);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding-right: 40px; color: var(--muted); }

/* Contact */

.contact { display: grid; grid-template-columns: 3fr 2fr; gap: 64px; }
.contact-form { display: grid; gap: 8px; }
.contact-form label { font-weight: 600; font-size: 15px; margin-top: 12px; }
.contact-form input,
.contact-form textarea {
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form ::placeholder { color: var(--muted); opacity: .7; }
.contact-form input:focus,
.contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.contact-form .btn { justify-self: start; margin-top: 20px; }
.contact-form .botcheck { display: none; }
.contact-form .btn:disabled { opacity: .6; cursor: wait; }
.form-error { color: var(--highlight); font-size: 15px; margin: 8px 0 0; }
.form-done { margin-top: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.contact-side { padding-top: 76px; }
.contact-side h3 { font-size: 18px; }
.contact-side .btn { margin-bottom: 40px; }
.contact-links li { margin-bottom: 8px; }

/* Footer */

.site-footer { background: var(--bg); border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; padding: 40px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 24px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* Name next to the wordmark only where the nav leaves room for it */
@media (max-width: 860px) {
  .brand-name { display: none; }
}

/* Tablet */

@media (max-width: 1024px) {
  .cards { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .steps::before { display: none; }

  .about { grid-template-columns: 220px 1fr; gap: 40px; }
  .about-details { grid-template-columns: 1fr; gap: 24px; }

  .hero {
    min-height: auto;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 0;
  }
  .hero-text { max-width: 640px; }
  .hero-image {
    position: static;
    width: min(100%, 560px);
    margin: 24px auto 0;
    transform: none;
  }
}

/* Mobile */

@media (max-width: 640px) {
  :root { --header-h: 64px; }
  body { font-size: 16px; }
  h1 { font-size: 32px; }
  h2 { font-size: 26px; margin-bottom: 28px; }
  h3 { font-size: 18px; }
  .container { padding: 0 16px; }
  .section { padding: 64px 0; }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: none;
    border: 0;
    cursor: pointer;
  }
  .menu-toggle span { display: block; height: 2px; background: var(--text); border-radius: 1px; }
  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 24px 16px 32px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
  }
  .site-header.menu-open { background: var(--bg-alt); border-bottom-color: var(--border); }
  .site-header.menu-open .site-nav { display: flex; }
  .site-header.menu-open .site-nav a:not(.btn) { font-size: 18px; }

  .hero-sub { font-size: 17px; }
  .hero-ctas { gap: 24px; }
  .hero-image { margin-top: 16px; }

  .card { padding: 24px; }
  .about, .contact { grid-template-columns: 1fr; gap: 40px; }
  .about .photo { width: 200px; }
  .about-details { grid-template-columns: 1fr; gap: 24px; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .project > :not(.thumb) { margin-left: 24px; margin-right: 24px; }

  .steps { grid-template-columns: 1fr; row-gap: 28px; padding-left: 56px; }
  .steps::before { display: block; top: 20px; bottom: 20px; left: 20px; right: auto; width: 1px; height: auto; }
  .steps li .step-num { position: absolute; left: -56px; top: 0; }
  .steps h3 { padding-top: 8px; }

  .contact-side { padding-top: 0; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
