/* ============================================================
   MAD TECH SOLUTIONS — v2
   Black & white, classy and simple. Blue only as a rare accent.
   Tanker (display) × Instrument Serif italic (accent).
   ============================================================ */

:root {
  --bg: #0a0a0b;
  --ink: #f2f2f0;
  --ink-dim: rgba(242, 242, 240, 0.55);
  --ink-faint: rgba(242, 242, 240, 0.26);
  --blue: #2e9bff; /* brand accent — used sparingly */
  --hairline: rgba(255, 255, 255, 0.12);
  --font-display: "Tanker", sans-serif;
  --font-serif: "Instrument Serif", serif;
  --font-body: "Space Grotesk", sans-serif;
  --pad: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
}

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

html { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--ink); color: #0a0a0b; }

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

/* ---------- WebGL canvas ---------- */
#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Scroll world ---------- */
#scroll { position: relative; z-index: 1; }

body.virtual-scroll #scroll {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  will-change: transform;
}

main { position: relative; }

section { padding: 0 var(--pad); }

/* ---------- Cursor ---------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--ink);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.35s var(--ease), height 0.35s var(--ease), background 0.35s;
  display: none;
  align-items: center;
  justify-content: center;
}
.cursor-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 500;
  color: #0a0a0b;
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.25s;
}
.cursor.is-hover {
  width: 88px; height: 88px;
  background: rgba(242, 242, 240, 0.95);
}
.cursor.is-hover .cursor-label { opacity: 1; }
@media (pointer: fine) {
  .cursor { display: flex; }
}

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  display: flex;
  align-items: flex-end;
  transition: opacity 0.8s var(--ease), visibility 0.8s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-inner {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: var(--pad);
}
.loader-logo {
  height: clamp(28px, 4.5vw, 36px);
  width: auto;
  display: block;
}
.loader-count {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(64px, 14vw, 180px);
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1px rgba(242, 242, 240, 0.35);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(18px, 3vw, 28px) var(--pad);
  mix-blend-mode: difference;
}
.nav-logo {
  height: clamp(22px, 3.5vw, 28px);
  width: auto;
  display: block;
}
.nav-links {
  display: flex;
  gap: clamp(18px, 3vw, 40px);
  align-items: center;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav-links a { color: var(--ink-dim); transition: color 0.3s; }
.nav-cta {
  color: var(--ink) !important;
  border: 1px solid var(--hairline);
  padding: 10px 18px;
  border-radius: 100px;
  transition: background 0.4s var(--ease), border-color 0.4s, color 0.4s,
              transform 0.3s var(--ease);
}
@media (hover: hover) {
  .nav-links a:hover { color: var(--ink); }
  .nav-cta:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: #0a0a0b !important;
  }
}

/* ---------- Shared bits ---------- */
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  display: flex;
  align-items: center;
  gap: 12px;
}
.tick {
  width: 32px; height: 1px;
  background: var(--blue);
  display: inline-block;
}
.section-tag {
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: clamp(28px, 5vh, 56px);
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 1s var(--ease), transform 1.2s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

/* Split words (big statements) */
[data-split] .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
[data-split] .w > span {
  display: inline-block;
  transform: translateY(110%) rotate(4deg);
  transform-origin: left bottom;
  transition: transform 1.1s var(--ease);
}
[data-split].in .w > span { transform: none; }
/* serif-accent words inside split statements */
.w.serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(24px, 4vh, 48px);
  padding-top: 90px;
  position: relative;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, min(12.5vw, 23vh), 200px);
  line-height: 0.94;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}
.hero-title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}
.hero-title .word { display: inline-block; white-space: nowrap; }
.hero-title .char {
  display: inline-block;
  transform: translateY(115%) rotate(5deg);
  transform-origin: left bottom;
  transition: transform 1.1s var(--ease);
}
body.ready .hero-title .char { transform: none; }
.hero-title .char.accent {
  color: var(--blue);
  -webkit-text-stroke: 0;
}
.hero-title .ghost {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  text-transform: lowercase;
  font-size: 0.9em;
  color: var(--ink);
  letter-spacing: 0;
}
.hero-title .grad {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(242, 242, 240, 0.6);
}
.hero-title em { font-style: normal; }

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}
.hero-sub {
  font-size: clamp(15px, 1.4vw, 19px);
  line-height: 1.65;
  color: var(--ink-dim);
  max-width: 46ch;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 16px 32px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  background: var(--ink);
  color: #0a0a0b;
  overflow: hidden;
  transition: transform 0.3s var(--ease), background 0.4s;
}
.btn span { position: relative; z-index: 1; }
.btn.ghost-btn {
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--ink);
  font-weight: 300;
}
@media (hover: hover) {
  .btn:hover { background: #ffffff; }
  .btn.ghost-btn:hover { border-color: rgba(242, 242, 240, 0.45); background: transparent; }
}

/* rotating circular badge — fills the hero's right side */
.hero-badge {
  position: absolute;
  right: calc(var(--pad) + 4vw);
  top: 50%;
  margin-top: -105px;
  width: 210px;
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition-delay: 0.6s;
}
.hero-badge svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: badge-spin 22s linear infinite;
}
.hero-badge text {
  font-family: var(--font-body);
  font-size: 11.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  fill: var(--ink-dim);
}
.hero-badge-core {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--blue);
}
@keyframes badge-spin {
  to { transform: rotate(360deg); }
}
@media (max-width: 1000px) {
  .hero-badge { display: none; }
}

.scroll-cue {
  position: absolute;
  bottom: 28px;
  right: var(--pad);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ink-faint);
}
.scroll-cue span {
  width: 1px; height: 48px;
  background: linear-gradient(to bottom, transparent, rgba(242, 242, 240, 0.8));
  animation: cue 2.2s var(--ease) infinite;
  transform-origin: top;
}
.scroll-cue .cue-swipe { display: none; }
@media (max-width: 768px) {
  .scroll-cue .cue-scroll { display: none; }
  .scroll-cue .cue-swipe { display: inline; }
}
@keyframes cue {
  0% { transform: scaleY(0); }
  50% { transform: scaleY(1); }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* Touch ripple for mobile tactile feedback */
.touch-ripple {
  position: fixed;
  width: 32px;
  height: 32px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 999;
  transform: translate(-50%, -50%) scale(0);
  animation: ripple-out 0.6s var(--ease) forwards;
  opacity: 0.6;
}
@keyframes ripple-out {
  to {
    transform: translate(-50%, -50%) scale(2.2);
    opacity: 0;
  }
}

/* ---------- Manifesto ---------- */
.manifesto {
  min-height: 90svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1400px;
}
.statement {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(38px, 6.6vw, 100px);
  line-height: 1.04;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  max-width: 18ch;
}
.statement .w.serif { text-transform: none; font-size: 1.02em; }
.manifesto-note {
  margin-top: clamp(28px, 5vh, 56px);
  font-size: clamp(14px, 1.3vw, 17px);
  line-height: 1.7;
  color: var(--ink-dim);
  max-width: 52ch;
  transition-delay: 0.25s;
}

/* ---------- Work ---------- */
.work { padding-top: 12vh; padding-bottom: 14vh; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.section-count { font-size: 12px; letter-spacing: 0.2em; color: var(--ink-faint); }

.work-list { list-style: none; border-top: 1px solid var(--hairline); }
.work-item { border-bottom: 1px solid var(--hairline); }
.work-item a {
  display: grid;
  grid-template-columns: 64px 1fr auto 40px;
  align-items: baseline;
  gap: clamp(12px, 3vw, 40px);
  padding: clamp(22px, 3.6vh, 40px) 8px;
  position: relative;
  transition: padding-left 0.5s var(--ease);
}
.work-item a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 65%);
  opacity: 0;
  transition: opacity 0.5s;
}
.work-idx {
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
}
.work-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 5.2vw, 76px);
  line-height: 1;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: color 0.4s;
}
.work-meta {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-align: right;
}
.work-arrow {
  font-size: 20px;
  color: var(--ink-faint);
  transition: transform 0.5s var(--ease), color 0.4s;
}
@media (hover: hover) {
  .work-item a:hover { padding-left: 26px; }
  .work-item a:hover::before { opacity: 1; }
  .work-item a:hover .work-name { color: var(--ink); }
  .work-item a:hover .work-arrow {
    transform: translate(4px, -4px);
    color: var(--ink);
  }
}

/* ---------- Capabilities ---------- */
.caps {
  padding-top: 10vh;
  padding-bottom: 12vh;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(28px, 4vw, 64px);
  max-width: 1500px;
}
.caps .section-tag { grid-column: 1 / -1; margin-bottom: 0; }
.cap {
  border-top: 1px solid var(--hairline);
  padding-top: 24px;
}
.cap-idx { font-size: 12px; color: var(--ink-faint); letter-spacing: 0.15em; }
.cap h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 3vw, 44px);
  margin: 14px 0 12px;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}
.cap p { color: var(--ink-dim); font-size: 15px; line-height: 1.65; max-width: 36ch; }

.stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: clamp(32px, 6vh, 72px);
  border-top: 1px solid var(--hairline);
  padding-top: clamp(28px, 4vh, 48px);
}
.stats b {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 5vw, 80px);
  color: var(--ink);
  line-height: 1;
}
.stats span {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* ---------- Contact ---------- */
.contact {
  padding-top: 12vh;
  padding-bottom: 14vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(40px, 6vw, 100px);
  margin-top: clamp(28px, 4vh, 56px);
  align-items: start;
}
.contact-info {
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 4vh, 48px);
}
.contact-big {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(56px, 10vw, 140px);
  line-height: 0.9;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(242, 242, 240, 0.5);
  transition: color 0.6s var(--ease), -webkit-text-stroke-color 0.6s;
  width: fit-content;
}
.contact-channels {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.contact-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 14px;
  transition: border-color 0.4s var(--ease);
}
.channel-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  transition: color 0.3s;
}
.channel-icon {
  fill: currentColor;
  flex-shrink: 0;
}
.channel-val {
  font-size: clamp(16px, 1.8vw, 22px);
  color: var(--ink-dim);
  transition: color 0.3s;
}
@media (hover: hover) {
  .contact-big:hover {
    color: var(--ink);
    -webkit-text-stroke-color: transparent;
  }
  .contact-link:hover {
    border-color: var(--ink-dim);
  }
  .contact-link:hover .channel-label {
    color: var(--blue);
  }
  .contact-link:hover .channel-val {
    color: var(--ink);
  }
}
.contact-note {
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

/* Contact Form */
.contact-form-wrap {
  width: 100%;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.form-group {
  position: relative;
  width: 100%;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 300;
  outline: none;
  transition: border-color 0.4s var(--ease);
}
.form-group textarea {
  resize: none;
}
.form-group label {
  position: absolute;
  left: 0;
  top: 12px;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  pointer-events: none;
  transition: transform 0.4s var(--ease), color 0.4s var(--ease), font-size 0.4s var(--ease);
  transform-origin: left top;
}
.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
  transform: translateY(-22px) scale(0.85);
  color: var(--blue);
}
.form-group input:focus,
.form-group textarea:focus {
  border-bottom-color: var(--ink);
}
.contact-form .btn {
  align-self: flex-start;
  cursor: pointer;
  border: none;
}

.footer {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 24px var(--pad);
  border-top: 1px solid var(--hairline);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.footer-tag { color: var(--ink-dim); }
.footer-tag b { color: var(--blue); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .caps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 36px 20px; }
  .work-item a { grid-template-columns: 40px 1fr 24px; }
  .work-meta { display: none; }
  .contact { padding-bottom: 180px; }
  .contact-grid { grid-template-columns: 1fr; gap: 60px; }
}
@media (max-width: 640px) {
  .nav { padding: 14px 16px; }
  .nav-logo { height: 20px; }
  .nav-cta { padding: 8px 14px; font-size: 12px; }
  .nav-links a:not(.nav-cta) { display: none; }
  .hero-foot { flex-direction: column; align-items: flex-start; }
  .footer { flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer-tag { order: -1; }
}
@media (max-width: 480px) {
  .hero-cta { flex-direction: column; width: 100%; }
  .hero-cta .btn { width: 100%; justify-content: center; text-align: center; }
  .contact-form .btn { width: 100%; justify-content: center; text-align: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .reveal, [data-split] .w > span, .hero-title .char {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .scroll-cue span { animation: none; }
  .hero-badge svg { animation: none; }
}
