/* ============================================================
   Fusting Projects and Design
   Aesthetic: "Alpine Engineering" — topographic contours,
   editorial serif display, monospaced blueprint labels,
   deep navy/ink base with glacial-ice accents.
   ============================================================ */

:root {
  /* Base — deep, cold, dominant */
  --ink:        #05070e;   /* near-black */
  --navy-900:   #070d1c;
  --navy-800:   #0a1428;
  --navy-600:   #14274d;
  --navy-500:   #1b356b;

  /* Light */
  --white:      #ffffff;
  --fog-1:      #c3cee2;   /* primary muted text */
  --fog-2:      #8493b4;   /* secondary muted text */
  --line:       rgba(180, 205, 255, 0.12);
  --line-strong:rgba(180, 205, 255, 0.24);

  /* Accent — glacial ice, used sparingly and sharply */
  --ice:        #6fd3ff;
  --ice-glow:   rgba(111, 211, 255, 0.35);

  /* Warm secondary accent — sunrise behind the mountain, used sparingly */
  --sun:        #f9c17a;
  --sun-glow:   rgba(249, 193, 122, 0.35);

  /* Type */
  --serif: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --sans:  "Hanken Grotesk", ui-sans-serif, sans-serif;
  --mono:  "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;

  --radius: 4px;          /* sharp, engineered corners */
  --radius-lg: 8px;
  --maxw: 1140px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--ink);
  color: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* Global topographic atmosphere — fixed contour field behind everything */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  color: var(--ice);
  background-image: url("topo.svg");
  background-size: 1500px 1500px;
  background-position: 60% 40%;
  background-repeat: no-repeat;
  opacity: 0.05;
  pointer-events: none;
}
/* faint vignette to deepen edges */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% -10%, transparent 55%, rgba(0,0,0,0.55) 100%);
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 26px;
  position: relative;
  z-index: 2;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  font-optical-sizing: auto;
}

a { color: inherit; text-decoration: none; }

/* Monospaced "blueprint" label used above section titles */
.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--ice);
  margin-bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
              border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn-primary {
  background: var(--navy-600);
  color: var(--white);
  border-color: var(--ice);
  box-shadow: 0 0 0 rgba(111, 211, 255, 0);
}
.btn-primary:hover {
  transform: translateY(-2px);
  background: var(--navy-500);
  box-shadow: 0 12px 34px -12px var(--ice-glow);
}
.btn-ghost {
  border-color: var(--line-strong);
  color: var(--white);
  background: rgba(255, 255, 255, 0.02);
}
.btn-ghost:hover {
  border-color: var(--ice);
  color: var(--ice);
  transform: translateY(-2px);
}
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(7, 13, 28, 0.85) 0%, rgba(5, 7, 14, 0.7) 100%);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid transparent;
  box-shadow:
    0 1px 0 0 rgba(111, 211, 255, 0.08),
    0 20px 40px -30px rgba(0, 0, 0, 0.6);
}
.site-header::after {
  /* soft glow accent along the bottom edge */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(111, 211, 255, 0.35) 20%, rgba(111, 211, 255, 0.35) 80%, transparent);
  opacity: 0.6;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 130px;
  gap: 32px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: auto;
  display: block;
  transition: transform 0.4s var(--ease), filter 0.4s var(--ease);
}
.brand-logo--header {
  height: 101px;
  filter: drop-shadow(0 0 10px rgba(111, 211, 255, 0.18));
}
.brand:hover .brand-logo--header {
  transform: rotate(-3deg) scale(1.04);
  filter: drop-shadow(0 0 16px rgba(111, 211, 255, 0.4));
}
.brand-logo--footer { height: 112px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(5, 7, 14, 0.4);
}
.nav-links a {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fog-2);
  position: relative;
  padding: 10px 18px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.nav-links a:not(.nav-cta):hover {
  color: var(--white);
  background: rgba(111, 211, 255, 0.06);
}
/* Scoped under .nav-links a for higher specificity — no !important needed */
.nav-links a.nav-cta {
  color: var(--ink);
  background: var(--ice);
  padding: 10px 22px;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 600;
  box-shadow: 0 0 0 rgba(111, 211, 255, 0);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.nav-links a.nav-cta:hover {
  color: var(--ink);
  background: #8fe0ff;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px -8px var(--ice-glow);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 24px; height: 2px; background: var(--white); border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 150px 0 160px;
  background:
    radial-gradient(700px 400px at 50% 78%, rgba(249, 193, 122, 0.14), transparent 65%),
    radial-gradient(1100px 620px at 72% -8%, rgba(111,211,255,0.16), transparent 58%),
    radial-gradient(900px 700px at 8% 30%, rgba(27,53,107,0.5), transparent 60%),
    linear-gradient(180deg, var(--navy-800) 0%, var(--ink) 100%);
}
/* white mountain wordmark as a large luminous watermark */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("logo-wordmark-white.png") center 60% no-repeat;
  background-size: min(1100px, 95%);
  opacity: 0.30;
  z-index: 1;
  filter: drop-shadow(0 0 40px rgba(111,211,255,0.3));
}
.hero-inner { position: relative; z-index: 3; max-width: 900px; }
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 600;
  margin-bottom: 26px;
  letter-spacing: -0.02em;
}
.hero h1 em {
  font-style: normal;
  font-weight: 600;
  color: var(--ice);
}
.hero-lead {
  font-size: 1.16rem;
  color: var(--white);
  max-width: 600px;
  margin-bottom: 40px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- Section shells ---------- */
section { padding: 108px 0; position: relative; z-index: 2; }
.section-head { margin-bottom: 64px; max-width: 720px; }
.section-head h2,
.contact-copy h2 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  position: relative;
  padding-bottom: 22px;
  margin-bottom: 18px;
}
.section-head h2::after,
.contact-copy h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 96px;
  height: 3px;
  background: linear-gradient(90deg, var(--ice) 0%, var(--sun) 100%);
  border-radius: 2px;
  box-shadow: 0 0 12px -2px rgba(249, 193, 122, 0.4);
}

/* ---------- Services ---------- */
.services { background: linear-gradient(180deg, var(--ink), var(--navy-900)); }
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.service-card {
  position: relative;
  background:
    linear-gradient(165deg, rgba(20,39,77,0.55), rgba(7,13,28,0.35));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
}
/* corner index tick */
.service-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 46px; height: 2px;
  background: var(--ice);
  transform: scaleX(0.4);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.service-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
}
.service-card:hover::before { transform: scaleX(1); }
.service-card--accent {
  border-color: rgba(111,211,255,0.28);
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(249, 193, 122, 0.08), transparent 60%),
    linear-gradient(165deg, rgba(27,53,107,0.6), rgba(7,13,28,0.4));
}
.service-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin-bottom: 22px;
  border: 1px solid rgba(111, 211, 255, 0.35);
  border-radius: 999px;
  background: rgba(111, 211, 255, 0.06);
  color: var(--ice);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  box-shadow: 0 0 20px -8px rgba(111, 211, 255, 0.4);
}
.service-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ice);
  box-shadow: 0 0 8px var(--ice), 0 0 14px rgba(111, 211, 255, 0.5);
}
.service-card h3 { font-size: 1.7rem; margin-bottom: 16px; }
.service-card > p { color: var(--fog-1); margin-bottom: 26px; }
.service-list { list-style: none; display: grid; gap: 12px; }
.service-list li {
  position: relative;
  padding-left: 28px;
  font-size: 0.95rem;
  color: var(--fog-1);
  font-family: var(--sans);
}
.service-list li::before {
  content: "▲";
  position: absolute;
  left: 0; top: 1px;
  font-size: 0.62rem;
  color: var(--ice);
}

/* ---------- Work / Case ---------- */
.work { background: linear-gradient(180deg, var(--navy-900), var(--navy-800)); }
.case {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 26px;
  align-items: stretch;
}
.case-body {
  background: linear-gradient(160deg, rgba(20,39,77,0.5), rgba(7,13,28,0.3));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
}
.case-body h3 { font-size: 1.9rem; margin-bottom: 8px; }
.case-tagline {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--ice);
  margin-bottom: 22px;
}
.case-body > p { color: var(--fog-1); }
.case-stats {
  list-style: none;
  display: flex;
  gap: 34px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.case-stats strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--white);
}
.case-stats span {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--fog-2);
}

.case-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.feature {
  background: rgba(111, 211, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
}
.feature:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  background: rgba(111, 211, 255, 0.06);
}
.feature h4 { font-size: 1.1rem; margin-bottom: 10px; }
.feature p { font-size: 0.9rem; color: var(--fog-2); }

/* ---------- Process ---------- */
.process { background: linear-gradient(180deg, var(--navy-800), var(--ink)); }
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  counter-reset: step;
}
.steps li {
  position: relative;
  border: 1px solid var(--line);
  border-top: 2px solid rgba(111,211,255,0.4);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  background: linear-gradient(180deg, rgba(20,39,77,0.4), transparent);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease);
}
.steps li:hover { transform: translateY(-5px); border-top-color: var(--ice); }
.step-num {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--ice);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 18px;
}
.steps h3 { font-size: 1.25rem; margin-bottom: 10px; }
.steps p { color: var(--fog-2); font-size: 0.92rem; }

/* ---------- Contact ---------- */
.contact {
  background:
    radial-gradient(800px 500px at 18% 0%, rgba(111,211,255,0.1), transparent 55%),
    linear-gradient(180deg, var(--ink) 0%, var(--navy-900) 100%);
}
.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.contact-copy > p:not(.eyebrow) { color: var(--fog-1); margin-bottom: 28px; max-width: 420px; }
.contact-email {
  display: inline-block;
  font-family: var(--mono);
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  color: var(--ice);
  border-bottom: 1px solid var(--ice);
  padding-bottom: 4px;
  transition: opacity 0.25s var(--ease);
}
.contact-email:hover { opacity: 0.7; }

.contact-form {
  background: linear-gradient(160deg, rgba(20,39,77,0.4), rgba(7,13,28,0.25));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 34px;
  display: grid;
  gap: 18px;
}
.field { display: grid; gap: 8px; }
.field label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fog-2);
}
.field input, .field select, .field textarea {
  background: rgba(5, 7, 14, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 15px;
  color: var(--white);
  font-family: var(--sans);
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--ice);
  box-shadow: 0 0 0 3px rgba(111, 211, 255, 0.12);
}
.form-status {
  font-family: var(--mono);
  font-size: 0.82rem;
  min-height: 1.2em;
  margin-top: 2px;
}
.form-status.ok { color: #6ee7a8; }
.form-status.err { color: #ff8080; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  border-top: 1px solid var(--line);
  padding: 40px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.footer-links a {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--fog-2);
  transition: color 0.25s var(--ease);
}
.footer-links a:hover { color: var(--ice); }
.footer-note {
  font-family: var(--mono);
  color: var(--fog-2);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

/* ============================================================
   Motion — orchestrated page load + scroll reveals
   ============================================================ */
@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Hero load: staggered reveal of each child */
.hero-inner > * {
  opacity: 0;
  animation: rise 0.9s var(--ease) forwards;
}
.hero-inner > .eyebrow      { animation-delay: 0.10s; }
.hero-inner > h1            { animation-delay: 0.22s; }
.hero-inner > .hero-lead    { animation-delay: 0.38s; }
.hero-inner > .hero-actions { animation-delay: 0.52s; }

/* header drops in */
@keyframes dropIn { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
.site-header { animation: dropIn 0.7s var(--ease) both; }

/* Scroll reveal (JS toggles .in) */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal].d1 { transition-delay: 0.08s; }
[data-reveal].d2 { transition-delay: 0.16s; }
[data-reveal].d3 { transition-delay: 0.24s; }
[data-reveal].d4 { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .hero-inner > * { opacity: 1; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 880px) {
  /* Mobile menu — full-width flat dropdown, not the desktop pill */
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(5, 7, 14, 0.98);
    backdrop-filter: blur(16px);
    border: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 12px 20px 20px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 16px 4px;
    width: 100%;
    border-bottom: 1px solid rgba(180, 205, 255, 0.06);
    border-radius: 0;
  }
  .nav-links a:last-child { border-bottom: 0; }

  /* Reset the ice-filled CTA on mobile — matches the other nav links visually */
  .nav-links a.nav-cta {
    background: transparent;
    color: var(--ice);
    padding: 16px 4px;
    border-radius: 0;
    font-weight: 500;
    box-shadow: none;
  }
  .nav-links a.nav-cta:hover {
    background: transparent;
    transform: none;
    box-shadow: none;
  }

  .nav-toggle { display: flex; }

  /* Shrink the header logo on smaller screens so it doesn't dominate the viewport */
  .brand-logo--header { height: 72px; }
  .nav { height: 96px; }

  .service-grid,
  .case,
  .case-features,
  .contact-inner { grid-template-columns: 1fr; }

  .steps { grid-template-columns: 1fr 1fr; }
  section { padding: 78px 0; }
  .hero { padding: 110px 0 120px; }
}

@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
  .case-stats { gap: 24px; }
  .service-card, .case-body, .contact-form { padding: 32px 26px; }
}

/* ============================================================
   Accessibility — skip to main content link
   ============================================================ */
.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 100;
  background: var(--ice);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip-link:focus {
  top: 12px;
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

/* ============================================================
   Legal page (privacy policy, terms, etc.)
   ============================================================ */
.legal {
  padding: 170px 0 120px;
  position: relative;
  z-index: 2;
  max-width: 780px;
}
.legal h1 {
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  margin-bottom: 8px;
}
.legal .updated {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--fog-2);
  margin-bottom: 48px;
}
.legal h2 {
  font-size: 1.35rem;
  margin-top: 44px;
  margin-bottom: 14px;
}
.legal p,
.legal li {
  color: var(--fog-1);
  font-size: 1rem;
  line-height: 1.75;
}
.legal ul {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 18px 0;
}
.legal li {
  position: relative;
  padding-left: 26px;
}
.legal li::before {
  content: "▲";
  position: absolute;
  left: 0;
  top: 3px;
  font-size: 0.6rem;
  color: var(--ice);
}
.legal a {
  color: var(--ice);
  border-bottom: 1px solid rgba(111, 211, 255, 0.4);
}
.legal a:hover { opacity: 0.75; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fog-2);
  margin-bottom: 36px;
}
.back-link:hover { color: var(--ice); }
