/* Matterhorn Web Solutions — black, white, neon teal. No images: everything is drawn in code. */

:root {
  --bg: #050607;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f2f5f5;
  --muted: #8b9696;
  --teal: #2af5d6;
  --teal-glow: rgba(42, 245, 214, 0.45);

  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --max: 1240px;
  --pad: clamp(20px, 5vw, 64px);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);

  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* film grain, generated by an SVG noise filter */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
::selection { background: var(--teal); color: var(--bg); }
:focus-visible { outline: 1px solid var(--teal); outline-offset: 4px; border-radius: 2px; }

.wrap { position: relative; max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }
.muted { color: var(--muted); }

.skip { position: absolute; left: 16px; top: -48px; z-index: 200; padding: 8px 14px; background: var(--teal); color: var(--bg); }
.skip:focus { top: 16px; }

.label, .eyebrow, .btn, .service__i, .service__tag, dt {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.label { color: var(--muted); }

.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal-glow); }
.dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--teal); animation: ping 2.4s var(--ease) infinite; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 20px; border-radius: 999px; white-space: nowrap;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.btn span { transition: transform 0.3s var(--ease); }
.btn:hover span { transform: translateX(3px); }
.btn--primary { background: var(--teal); color: var(--bg); font-weight: 500; }
.btn--primary:hover { box-shadow: 0 0 0 1px var(--teal), 0 0 32px var(--teal-glow); }
.btn--ghost { border: 1px solid var(--line-strong); height: 38px; padding: 0 16px; }
.btn--ghost:hover { border-color: var(--teal); color: var(--teal); }

/* ---------- nav ---------- */

.nav { position: fixed; inset: 0 0 auto; z-index: 50; border-bottom: 1px solid transparent; transition: background 0.4s var(--ease), border-color 0.4s var(--ease); }
.nav.is-scrolled {
  background: rgba(5, 6, 7, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-color: var(--line);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; letter-spacing: -0.02em; font-size: 1.05rem; }
.brand__mark { width: 22px; height: 22px; fill: none; stroke: var(--teal); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 6px var(--teal-glow)); }

.nav__links { display: flex; gap: 36px; font-size: 0.9rem; color: var(--muted); }
.nav__links a { position: relative; transition: color 0.3s var(--ease); }
.nav__links a:hover { color: var(--text); }
.nav__links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: var(--teal); transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease); }
.nav__links a:hover::after { transform: scaleX(1); }

/* ---------- hero ---------- */

.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; }

.grid-bg {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.6;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 65% 45%, #000 15%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 65% 45%, #000 15%, transparent 75%);
}
.grid-bg--low {
  mask-image: radial-gradient(ellipse 60% 70% at 50% 100%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 100%, #000 10%, transparent 70%);
}

/* live wireframe terrain, drawn by main.js */
.peak {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  mask-image: radial-gradient(ellipse 42% 55% at 70% 36%, #000 45%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 42% 55% at 70% 36%, #000 45%, transparent 100%);
}
@media (max-width: 860px) {
  .peak {
    mask-image: radial-gradient(ellipse 75% 38% at 50% 30%, #000 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 75% 38% at 50% 30%, #000 40%, transparent 100%);
  }
}

.hero__inner { width: 100%; padding-block: 0 clamp(56px, 12vh, 128px); pointer-events: none; }
.hero__inner > * { pointer-events: auto; }

.hero__title {
  margin-top: 24px;
  font-size: clamp(3.5rem, 11vw, 10rem);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.9;
}
.hero__title em { font-style: normal; color: var(--teal); text-shadow: 0 0 24px var(--teal-glow), 0 0 72px rgba(42, 245, 214, 0.22); }

.hero__lede { margin-top: 24px; max-width: 42ch; color: var(--muted); font-size: clamp(1.05rem, 1.5vw, 1.3rem); line-height: 1.45; }
.hero__actions { margin-top: 32px; }

/* ---------- services ---------- */

.section { padding-top: clamp(112px, 16vw, 200px); }

.services { margin-top: 40px; border-top: 1px solid var(--line); }

.service {
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: baseline;
  gap: 8px 24px;
  padding-block: clamp(22px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
}
.service::after {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%;
  background: linear-gradient(90deg, var(--teal), transparent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.7s var(--ease);
}
.service__i { color: var(--muted); transition: color 0.3s var(--ease); }
.service h3 {
  font-size: clamp(1.75rem, 4.4vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1.05;
  transition: transform 0.6s var(--ease), text-shadow 0.4s var(--ease);
}
.service__tag { color: var(--muted); }

.service:hover::after { transform: scaleX(1); }
.service:hover .service__i { color: var(--teal); }
.service:hover h3 { transform: translateX(14px); text-shadow: 0 0 28px rgba(42, 245, 214, 0.25); }

/* ---------- request console ---------- */

.request {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
  margin-top: 40px;
}
.request__intro { position: sticky; top: 120px; }
.request__title { font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 500; letter-spacing: -0.05em; line-height: 0.95; }
.request__note { margin-top: 24px; color: var(--muted); max-width: 28ch; }
.request__note strong { color: var(--teal); font-weight: 400; }

.console {
  --c-line: rgba(42, 245, 214, 0.22);
  --err: #ff6b81;
  position: relative;
  font-family: var(--mono);
  border: 1px solid var(--c-line);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(42, 245, 214, 0.05), rgba(42, 245, 214, 0.012) 40%, rgba(5, 6, 7, 0.9));
  box-shadow: 0 0 0 4px rgba(42, 245, 214, 0.03), 0 30px 80px -30px rgba(42, 245, 214, 0.35);
  overflow: hidden;
  isolation: isolate;
}
/* CRT scanlines */
.console::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px);
}
/* slow sweep of light down the panel */
.console::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 140px; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(42, 245, 214, 0.06), transparent);
  animation: sweep 7s linear infinite;
}

.console__bar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--c-line);
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.console__lights { display: inline-flex; gap: 6px; }
.console__lights i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--line-strong); }
.console__lights i:first-child { background: var(--teal); border-color: var(--teal); box-shadow: 0 0 8px var(--teal-glow); }
.console__status { margin-left: auto; color: var(--teal); display: inline-flex; align-items: center; gap: 8px; }
.console__status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; animation: blink 1.6s steps(2) infinite; }

.console__progress { height: 1px; background: linear-gradient(90deg, transparent, var(--teal), transparent); transform: scaleX(0); }
.console.is-sending .console__progress { animation: transmit 1.1s var(--ease) infinite; }

.console__body { display: grid; gap: 24px; padding: clamp(20px, 3vw, 32px); }

.console__boot { min-height: 3.2em; font-size: 0.8rem; line-height: 1.6; color: var(--muted); white-space: pre-line; }
.console__boot::after { content: "▍"; color: var(--teal); animation: blink 1s steps(2) infinite; }

.field { display: grid; gap: 8px; border: 0; min-width: 0; }
.field label, .field legend {
  display: flex; align-items: baseline; gap: 12px;
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.field legend { margin-bottom: 12px; }
.field b { color: var(--teal); font-weight: 400; }
.field em { font-style: normal; color: rgba(139, 150, 150, 0.6); text-transform: none; letter-spacing: 0.02em; }

.field input, .field textarea {
  width: 100%;
  padding: 6px 0 10px;
  font: inherit; font-size: 1rem;
  color: var(--text);
  caret-color: var(--teal);
  background: transparent;
  border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0;
  outline: none;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.field textarea { resize: vertical; min-height: 104px; line-height: 1.5; }
.field input:focus, .field textarea:focus { border-color: var(--teal); box-shadow: 0 1px 0 var(--teal), 0 14px 24px -18px var(--teal-glow); }
.field [aria-invalid="true"] { border-color: var(--err); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-block; padding: 9px 14px;
  border: 1px solid var(--line-strong); border-radius: 2px;
  font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
  cursor: pointer; user-select: none;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.chip span:hover { border-color: var(--teal); color: var(--text); }
.chip input:checked + span { background: var(--teal); border-color: var(--teal); color: var(--bg); box-shadow: 0 0 22px -6px var(--teal-glow); }
.chip input:focus-visible + span { outline: 1px solid var(--teal); outline-offset: 3px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.console__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 4px; }
.console__msg { font-size: 0.8rem; color: var(--err); min-height: 1.3em; flex: 1 1 200px; }
.console__foot .btn { margin-left: auto; }
.console__foot .btn[disabled] { opacity: 0.6; cursor: progress; }

.console__done { display: grid; justify-items: start; align-content: center; gap: 14px; min-height: 460px; padding: clamp(28px, 5vw, 56px); }
.console__check {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--teal); box-shadow: 0 0 24px -4px var(--teal-glow), inset 0 0 12px -4px var(--teal-glow);
  position: relative;
}
.console__check::after {
  content: ""; position: absolute; left: 15px; top: 12px; width: 9px; height: 16px;
  border: solid var(--teal); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.console__done-title { font-family: var(--sans); font-size: clamp(2rem, 4vw, 3rem); font-weight: 500; letter-spacing: -0.04em; color: var(--teal); text-shadow: 0 0 24px var(--teal-glow); }
.console__done-note { color: var(--muted); }
.console__done-note b { color: var(--text); font-weight: 400; }

@keyframes sweep { from { transform: translateY(-140px); } to { transform: translateY(900px); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes transmit { 0% { transform: scaleX(0); transform-origin: left; } 50% { transform: scaleX(1); transform-origin: left; } 50.1% { transform-origin: right; } 100% { transform: scaleX(0); transform-origin: right; } }

/* ---------- contact ---------- */

.contact { position: relative; margin-top: clamp(112px, 16vw, 200px); padding-block: clamp(80px, 10vw, 140px); border-top: 1px solid var(--line); overflow: hidden; }

.contact__title { margin-top: 32px; font-size: clamp(3.5rem, 11vw, 10rem); font-weight: 500; letter-spacing: -0.06em; line-height: 0.9; }

.contact__mail {
  display: inline-flex; align-items: baseline; gap: 0.3em;
  margin-top: clamp(32px, 5vw, 56px); padding-bottom: 6px;
  font-size: clamp(1.3rem, 3.4vw, 2.6rem);
  letter-spacing: -0.03em;
  color: var(--teal);
  background: linear-gradient(var(--teal), var(--teal)) left bottom / 0% 1px no-repeat;
  transition: background-size 0.5s var(--ease), text-shadow 0.4s var(--ease);
  overflow-wrap: anywhere;
}
.contact__mail span { font-size: 0.6em; transition: transform 0.4s var(--ease); }
.contact__mail:hover { background-size: 100% 1px; text-shadow: 0 0 24px var(--teal-glow); }
.contact__mail:hover span { transform: translate(3px, -3px); }

.contact__meta { display: flex; flex-wrap: wrap; gap: 24px clamp(48px, 8vw, 120px); margin-top: clamp(48px, 7vw, 96px); }
.contact__meta dt { color: var(--muted); }
.contact__meta dd { margin-top: 6px; }
.contact__meta a:hover { color: var(--teal); }
.contact__meta time { font-family: var(--mono); font-size: 0.95rem; font-variant-numeric: tabular-nums; }

.notfound { margin-top: 0; min-height: 100svh; display: flex; align-items: center; border-top: 0; }
.notfound .wrap { width: 100%; }

/* contour peak behind "Let's talk", bottom right */
.peak--contact {
  inset: auto 0 0 auto;
  width: min(60vw, 820px);
  height: min(46vw, 620px);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 55%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 55%, transparent 100%);
}

/* ---------- footer ---------- */

.footer { border-top: 1px solid var(--line); }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 28px; font-size: 0.85rem; color: var(--muted); }
.footer a:hover { color: var(--teal); }

/* ---------- reveal ---------- */

.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--d, 0ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

@keyframes ping { 0% { transform: scale(1); opacity: 0.9; } 80%, 100% { transform: scale(3.2); opacity: 0; } }
@keyframes ping-svg { 0% { transform: scale(1); opacity: 0.9; } 80%, 100% { transform: scale(4); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade-in { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
    }

/* ---------- small screens ---------- */

@media (max-width: 860px) {
  .request { grid-template-columns: 1fr; gap: 32px; }
  .request__intro { position: static; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav__links { display: none; }
  .service { grid-template-columns: 40px 1fr; }
  .service__tag { grid-column: 2; }
  .console__done { min-height: 340px; }
  .peak--contact { width: 100%; height: 80vw; }
  .contact { padding-bottom: 84vw; }
}
