/* ============================================================
   TWO TOWERS STUDIO — twotowers.studio
   Game development & custom software studio
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:        #0a0c12;
  --bg-2:      #0e111a;
  --panel:     rgba(22, 26, 38, 0.55);
  --panel-2:   rgba(28, 33, 48, 0.7);
  --edge:      rgba(140, 150, 190, 0.14);
  --edge-soft: rgba(140, 150, 190, 0.08);

  --ink:       #eef1f8;
  --ink-dim:   rgba(206, 213, 232, 0.66);
  --ink-faint: rgba(206, 213, 232, 0.42);

  --violet:    #8a78ff;
  --violet-br: #a99bff;
  --indigo:    #5a3cff;
  --amber:     #ffb23e;
  --teal:      #34e0c4;

  --max: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 86px; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; line-height: 1.08; letter-spacing: -0.02em;
}

::selection { background: rgba(138, 120, 255, 0.32); color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #06070b; }
::-webkit-scrollbar-thumb { background: #20253a; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--indigo); }

/* ---------- background atmosphere ---------- */
.bg-fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.bg-fx .glow {
  position: absolute; inset: -30%;
  background:
    radial-gradient(38% 38% at 22% 18%, rgba(90, 60, 255, 0.16), transparent 60%),
    radial-gradient(34% 34% at 82% 26%, rgba(52, 224, 196, 0.10), transparent 60%),
    radial-gradient(40% 40% at 60% 92%, rgba(255, 178, 62, 0.07), transparent 62%);
  filter: blur(20px);
  animation: drift 34s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate(-2%, -1%) scale(1.02); }
  100% { transform: translate(2%, 2%) scale(1.1); }
}
.bg-fx .grid {
  position: absolute; inset: 0; opacity: 0.5;
  background-image:
    linear-gradient(rgba(140,150,190,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140,150,190,0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 78%);
}

/* ---------- layout helpers ---------- */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
.section { position: relative; z-index: 2; padding: clamp(3.5rem, 9vw, 7rem) 0; }
.section--tight { padding: clamp(2.5rem, 6vw, 4rem) 0; }
.center { text-align: center; }

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--violet-br); display: inline-flex; align-items: center; gap: 0.6rem;
  margin-bottom: 1rem;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--violet); opacity: 0.7; }
.center .eyebrow::after { content: ""; width: 26px; height: 1px; background: var(--violet); opacity: 0.7; }

.section-title {
  font-size: clamp(1.9rem, 4.6vw, 3rem); letter-spacing: -0.025em; margin-bottom: 1rem;
}
.section-lead { max-width: 60ch; color: var(--ink-dim); font-size: clamp(1rem, 2vw, 1.14rem); }
.center .section-lead { margin-left: auto; margin-right: auto; }
.section-head { margin-bottom: clamp(2.2rem, 5vw, 3.4rem); }

.grad { background: linear-gradient(100deg, var(--violet) 8%, var(--teal) 92%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.2rem);
  background: linear-gradient(180deg, rgba(8,10,16,0.86), rgba(8,10,16,0.3) 75%, transparent);
  backdrop-filter: blur(10px);
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(9,11,18,0.94); box-shadow: 0 10px 30px rgba(0,0,0,0.45); border-bottom-color: var(--edge-soft); }

.brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.brand .mark { width: 30px; height: 30px; flex: none; }
.brand .brand-name {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.02rem;
  letter-spacing: 0.02em; line-height: 1; color: var(--ink);
}
.brand .brand-name small { display: block; font-size: 0.6rem; font-weight: 500; letter-spacing: 0.34em; color: var(--ink-faint); margin-top: 3px; font-family: 'JetBrains Mono', monospace; }

.nav-links { display: flex; align-items: center; gap: 1.7rem; list-style: none; }
.nav-links a {
  font-size: 0.88rem; font-weight: 500; color: var(--ink-dim);
  position: relative; padding: 0.3rem 0; transition: color 0.2s;
}
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--violet), var(--teal)); transition: width 0.25s var(--ease); }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 40px; height: 40px; position: relative; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 8px; right: 8px; height: 2px; background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.nav-toggle span { top: 50%; }
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }
.nav-toggle.open span { background: transparent; }
.nav-toggle.open span::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span::after { transform: translateY(-7px) rotate(-45deg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 0.94rem;
  cursor: pointer; padding: 0.82rem 1.5rem; border-radius: 10px; border: 1px solid transparent;
  transition: transform 0.18s var(--ease), box-shadow 0.25s, background 0.25s, color 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: linear-gradient(100deg, var(--indigo), var(--violet)); color: #fff; box-shadow: 0 8px 24px rgba(90,60,255,0.28); }
.btn--primary:hover { box-shadow: 0 12px 34px rgba(90,60,255,0.42); }
.btn--ghost { background: rgba(140,150,190,0.05); color: var(--ink); border-color: var(--edge); }
.btn--ghost:hover { background: rgba(140,150,190,0.1); border-color: rgba(140,150,190,0.28); }
.btn--lg { padding: 1rem 2rem; font-size: 1.02rem; }
.btn-arrow { transition: transform 0.2s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ---------- hero ---------- */
.hero { position: relative; z-index: 2; padding: clamp(8rem, 16vw, 11rem) 1.5rem clamp(4rem, 8vw, 6rem); }
.hero-inner { max-width: var(--max); margin: 0 auto; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.55rem; margin-bottom: 1.6rem;
  font-family: 'JetBrains Mono', monospace; font-size: 0.74rem; letter-spacing: 0.12em;
  color: var(--ink-dim); border: 1px solid var(--edge); border-radius: 100px; padding: 0.4rem 0.95rem;
  background: var(--panel);
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }
.hero h1 {
  font-size: clamp(2.6rem, 7.4vw, 5.4rem); letter-spacing: -0.035em; max-width: 16ch;
}
.hero h1 em { font-style: normal; }
.hero-sub { margin-top: 1.5rem; max-width: 56ch; font-size: clamp(1.05rem, 2.3vw, 1.32rem); color: var(--ink-dim); }
.hero-cta { margin-top: 2.4rem; display: flex; gap: 0.9rem; flex-wrap: wrap; }
.hero-meta { margin-top: 3rem; display: flex; gap: 2.4rem; flex-wrap: wrap; color: var(--ink-faint); font-size: 0.82rem; font-family: 'JetBrains Mono', monospace; letter-spacing: 0.04em; }
.hero-meta b { color: var(--ink); font-weight: 600; }

/* ---------- marquee / capabilities ---------- */
.marquee { position: relative; z-index: 2; border-top: 1px solid var(--edge-soft); border-bottom: 1px solid var(--edge-soft); overflow: hidden; padding: 1.1rem 0; background: rgba(8,10,16,0.4); }
.marquee-track { display: flex; gap: 3rem; width: max-content; animation: scroll 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; display: inline-flex; align-items: center; gap: 3rem; }
.marquee-track span::after { content: "◆"; color: var(--violet); font-size: 0.6rem; opacity: 0.6; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- service cards ---------- */
.grid { display: grid; gap: 1.1rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.service {
  position: relative; background: var(--panel); border: 1px solid var(--edge); border-radius: 16px;
  padding: 1.7rem 1.6rem; overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.service::after { content: ""; position: absolute; inset: 0; border-radius: 16px; padding: 1px; background: linear-gradient(130deg, rgba(138,120,255,0.5), transparent 40%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.service:hover { transform: translateY(-5px); border-color: transparent; box-shadow: 0 22px 50px rgba(0,0,0,0.5); background: var(--panel-2); }
.service:hover::after { opacity: 1; }
.service .svc-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 1.1rem; background: linear-gradient(135deg, rgba(90,60,255,0.22), rgba(52,224,196,0.12)); border: 1px solid var(--edge); }
.service .svc-ico svg { width: 22px; height: 22px; stroke: var(--violet-br); }
.service h3 { font-size: 1.2rem; margin-bottom: 0.45rem; }
.service p { color: var(--ink-dim); font-size: 0.96rem; }
.service .tags { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.service .tags span { font-family: 'JetBrains Mono', monospace; font-size: 0.66rem; letter-spacing: 0.06em; color: var(--ink-faint); border: 1px solid var(--edge); border-radius: 100px; padding: 0.2rem 0.6rem; }

/* ---------- work / projects ---------- */
.work-feature {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: stretch;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 20px; overflow: hidden;
}
.work-visual {
  position: relative; min-height: 320px; display: grid; place-items: center; padding: 2rem;
  background:
    radial-gradient(circle at 30% 25%, rgba(124,181,24,0.16), transparent 55%),
    radial-gradient(circle at 75% 80%, rgba(139,0,0,0.28), transparent 55%),
    linear-gradient(160deg, #16210f, #0a0703 75%);
  border-right: 1px solid var(--edge);
}
.work-visual .zlogo { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: clamp(3rem, 9vw, 5.5rem); letter-spacing: 0.06em; color: #d8d2c2; text-shadow: 0 0 26px rgba(124,181,24,0.4), 0 0 40px rgba(139,0,0,0.4); }
.work-visual .zsub { position: absolute; bottom: 1.2rem; font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(216,210,194,0.7); }
.work-body { padding: clamp(1.8rem, 4vw, 2.6rem); display: flex; flex-direction: column; }
.work-kicker { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--teal); margin-bottom: 0.8rem; }
.work-body h3 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin-bottom: 0.7rem; }
.work-body > p { color: var(--ink-dim); margin-bottom: 1.2rem; }
.work-stats { display: flex; gap: 1.6rem; flex-wrap: wrap; margin: 0.4rem 0 1.5rem; }
.work-stats .ws { }
.work-stats .ws b { font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; color: var(--ink); display: block; line-height: 1; }
.work-stats .ws span { font-size: 0.74rem; color: var(--ink-faint); letter-spacing: 0.04em; }
.chiprow { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1.6rem; }
.chiprow span { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; color: var(--ink-dim); border: 1px solid var(--edge); border-radius: 100px; padding: 0.24rem 0.7rem; }
.work-body .work-links { margin-top: auto; display: flex; gap: 0.7rem; flex-wrap: wrap; }

.work-mini { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; margin-top: 1.1rem; }
.mini {
  background: var(--panel); border: 1px solid var(--edge); border-radius: 16px; padding: 1.5rem;
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
}
.mini:hover { transform: translateY(-4px); border-color: rgba(140,150,190,0.28); background: var(--panel-2); }
.mini .mini-tag { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--amber); }
.mini h4 { font-size: 1.18rem; margin: 0.5rem 0 0.4rem; }
.mini p { color: var(--ink-dim); font-size: 0.92rem; }

/* ---------- process ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; counter-reset: step; }
.step { position: relative; background: var(--panel); border: 1px solid var(--edge); border-radius: 16px; padding: 1.6rem 1.4rem; }
.step .num { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: var(--violet-br); letter-spacing: 0.1em; margin-bottom: 0.8rem; }
.step h4 { font-size: 1.12rem; margin-bottom: 0.4rem; }
.step p { color: var(--ink-dim); font-size: 0.92rem; }

/* ---------- about / values ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.6rem, 5vw, 3.5rem); align-items: center; }
.values { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.values li { position: relative; padding-left: 2.2rem; color: var(--ink-dim); }
.values li b { color: var(--ink); font-family: 'Space Grotesk', sans-serif; font-weight: 600; }
.values li::before { content: ""; position: absolute; left: 0; top: 6px; width: 18px; height: 18px; border-radius: 6px; background: linear-gradient(135deg, var(--violet), var(--teal)); opacity: 0.85; }
.values li::after { content: "✓"; position: absolute; left: 4px; top: 3px; font-size: 0.74rem; color: #0a0c12; font-weight: 700; }

/* ---------- stats band ---------- */
.statband { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; text-align: center; }
.statband .num { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: clamp(2.2rem, 5.5vw, 3.2rem); line-height: 1; }
.statband .num em { font-style: normal; background: linear-gradient(100deg, var(--violet), var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.statband .lbl { font-size: 0.76rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); margin-top: 0.5rem; }

/* ---------- contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.6rem, 5vw, 3.5rem); align-items: start; }
.contact-aside h2 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); margin-bottom: 0.9rem; }
.contact-aside p { color: var(--ink-dim); margin-bottom: 1.6rem; max-width: 42ch; }
.contact-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.contact-list a, .contact-list span { display: inline-flex; align-items: center; gap: 0.7rem; color: var(--ink); font-weight: 500; }
.contact-list .ci { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--edge); }
.contact-list .ci svg { width: 18px; height: 18px; stroke: var(--violet-br); }
.contact-list a:hover { color: var(--violet-br); }
.contact-list small { display: block; color: var(--ink-faint); font-size: 0.74rem; font-weight: 400; }

.form { background: var(--panel); border: 1px solid var(--edge); border-radius: 18px; padding: clamp(1.4rem, 3vw, 2rem); }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.4rem; font-family: 'JetBrains Mono', monospace; }
.field input, .field textarea, .field select {
  width: 100%; background: rgba(6,8,13,0.6); border: 1px solid var(--edge); border-radius: 10px;
  color: var(--ink); padding: 0.8rem 0.95rem; font-family: 'Inter', sans-serif; font-size: 0.96rem; resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(138,120,255,0.16); }
.field textarea { min-height: 120px; }
.form .btn { width: 100%; justify-content: center; }
.form-note { margin-top: 0.9rem; font-size: 0.8rem; color: var(--ink-faint); text-align: center; }
.form-note.ok { color: var(--teal); }

/* ---------- footer ---------- */
.footer { position: relative; z-index: 2; border-top: 1px solid var(--edge-soft); background: rgba(6,7,12,0.7); padding: 3rem 1.5rem 2rem; }
.footer-grid { max-width: var(--max); margin: 0 auto; display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer-brand { max-width: 30ch; }
.footer-brand p { color: var(--ink-dim); font-size: 0.9rem; margin-top: 0.9rem; }
.footer-cols { display: flex; gap: 3rem; flex-wrap: wrap; }
.footer-col h5 { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink); margin-bottom: 0.8rem; font-family: 'JetBrains Mono', monospace; }
.footer-col a { display: block; color: var(--ink-dim); font-size: 0.9rem; padding: 0.22rem 0; transition: color 0.2s; }
.footer-col a:hover { color: var(--violet-br); }
.footer-bottom { max-width: var(--max); margin: 2.4rem auto 0; padding-top: 1.4rem; border-top: 1px solid var(--edge-soft); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 0.8rem; color: var(--ink-faint); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.07s; }
.reveal.d2 { transition-delay: 0.14s; }
.reveal.d3 { transition-delay: 0.21s; }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .work-feature { grid-template-columns: 1fr; }
  .work-visual { border-right: 0; border-bottom: 1px solid var(--edge); min-height: 220px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .about, .contact { grid-template-columns: 1fr; }
  .statband { grid-template-columns: repeat(2, 1fr); gap: 1.6rem; }

  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; top: 60px; right: 0; left: 0; flex-direction: column; gap: 0; align-items: stretch;
    background: rgba(9,11,18,0.98); border-top: 1px solid var(--edge-soft);
    max-height: 0; overflow: hidden; transition: max-height 0.35s var(--ease);
  }
  .nav-links.open { max-height: 80vh; }
  .nav-links li { border-bottom: 1px solid var(--edge-soft); }
  .nav-links a { display: block; padding: 1rem 1.6rem; }
  .nav-links a::after { display: none; }
  .nav .btn-nav { display: none; }
}
@media (max-width: 620px) {
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .work-mini { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
