/* ============================================================
   TTy32 Software Services — static site (dark theme, 3D variant)
   Brand: blue #0078d8 / #2f9bef · slate #78849c
   ============================================================ */

/* 3D backdrop canvas — fixed behind all content, fades on scroll */
#bg3d {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
  pointer-events: none;
  transition: opacity .25s linear;
}
/* The 3D scene supplies the hero texture, so drop the CSS grid overlay here */
.hero::after { display: none; }

:root {
  --blue:        #2f9bef;
  --blue-bright: #57b0ff;
  --blue-deep:   #0f6fc7;

  --bg:          #080c14;
  --bg-soft:     #0c1220;
  --panel:       #0e1728;
  --panel-2:     #111c31;
  --line:        rgba(255,255,255,.08);
  --line-soft:   rgba(255,255,255,.05);

  --ink:         #e9eefb;
  --ink-soft:    #9aa8c2;
  --ink-dim:     #6d7c96;

  --radius:  16px;
  --maxw:    1080px;
  --ease:    cubic-bezier(.16,.84,.44,1);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3 { line-height: 1.18; margin: 0; letter-spacing: -.02em; color: var(--ink); font-weight: 700; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 18px;
}

/* Quiet text link (replaces buttons) */
.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid rgba(255,255,255,.18);
  padding-bottom: 3px;
  transition: color .18s, border-color .18s;
}
.link:hover { color: var(--blue-bright); border-color: var(--blue); }
.link svg { transition: transform .2s var(--ease); }
.link:hover svg { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8,12,20,.72);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand img { height: 38px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink-soft); font-weight: 500; font-size: 15px; transition: color .15s; }
.nav-links a:hover { color: var(--ink); }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 132px 0 118px;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(680px 380px at 50% -6%, rgba(47,155,239,.16), transparent 62%),
    radial-gradient(500px 300px at 50% 118%, rgba(47,155,239,.06), transparent 60%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(620px 420px at 50% 34%, #000, transparent 72%);
          mask-image: radial-gradient(620px 420px at 50% 34%, #000, transparent 72%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(36px, 6vw, 62px); font-weight: 800; letter-spacing: -.03em; }
.hero h1 .accent {
  background: linear-gradient(120deg, var(--blue-bright), var(--blue-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead {
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--ink-soft);
  margin: 26px auto 38px;
  max-width: 54ch;
}
.hero .link { font-size: 16px; }

/* ---------- Section shell ---------- */
section { scroll-margin-top: 82px; }
.section { padding: 96px 0; }
.section-soft { background: var(--bg-soft); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.section-head { max-width: 620px; margin: 0 auto 60px; text-align: center; }
.section-head h2 { font-size: clamp(27px, 3.6vw, 38px); font-weight: 800; }
.section-head p { color: var(--ink-soft); margin: 16px 0 0; font-size: 17.5px; }

/* ---------- Services ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  transition: transform .2s var(--ease), border-color .2s, background .2s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(47,155,239,.4); background: var(--panel-2); }
.card .ic {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(47,155,239,.12);
  color: var(--blue-bright);
  margin-bottom: 20px;
}
.card h3 { font-size: 19px; font-weight: 700; margin-bottom: 9px; }
.card p { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.62; }

/* ---------- Why ---------- */
.why { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.why-item {
  padding: 30px 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .2s var(--ease), border-color .2s, background .2s;
}
.why-item:hover { transform: translateY(-4px); border-color: rgba(47,155,239,.4); background: var(--panel-2); }
.why-label {
  display: block;
  font-size: 12.5px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--blue-bright);
  margin-bottom: 14px;
}
.why-item p { margin: 0; color: var(--ink-soft); font-size: 15.5px; line-height: 1.62; }

/* ---------- Approach ---------- */
.split { display: grid; grid-template-columns: .95fr 1.05fr; gap: 60px; align-items: center; }
.split .lead-text { color: var(--ink-soft); margin-top: 18px; font-size: 17px; }
.principles { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.principle {
  padding: 22px 4px;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: baseline;
}
.principle:last-child { border-bottom: 0; }
.principle .idx { color: var(--blue); font-size: 14px; font-weight: 600; letter-spacing: .05em; }
.principle strong { display: block; font-size: 17px; color: var(--ink); font-weight: 600; }
.principle span { color: var(--ink-soft); font-size: 15px; }

/* ---------- Process ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.step {
  padding: 28px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.step .n {
  counter-increment: step;
  font-size: 14px; font-weight: 800; color: var(--blue-bright);
  width: 40px; height: 40px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: rgba(47,155,239,.12);
  border: 1px solid rgba(47,155,239,.22);
  margin-bottom: 16px;
}
.step .n::before { content: "0" counter(step); }
.step h3 { font-size: 17px; font-weight: 700; margin-bottom: 7px; }
.step p { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact h2 { font-size: clamp(27px, 3.6vw, 40px); font-weight: 800; }
.contact p { max-width: 48ch; margin: 18px auto 30px; color: var(--ink-soft); font-size: 18px; }
.contact .mail {
  display: inline-block;
  font-size: clamp(19px, 3vw, 26px);
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
  border-bottom: 1px solid rgba(255,255,255,.2);
  padding-bottom: 4px;
  transition: color .18s, border-color .18s;
}
.contact .mail:hover { color: var(--blue-bright); border-color: var(--blue); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line-soft);
  padding: 40px 0;
}
.footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer .logo-mark { font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.footer .logo-mark b { color: var(--blue); }
.footer .logo-mark span { font-weight: 500; font-size: 14px; color: var(--ink-dim); }
.footer .meta { color: var(--ink-dim); font-size: 13.5px; text-align: right; }
.footer .meta .reg { margin-top: 4px; font-size: 12.5px; opacity: .8; }

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

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .why { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .nav-links { display: none; }
  .nav-toggle {
    display: inline-flex;
    background: none; border: 1px solid var(--line);
    border-radius: 10px; padding: 9px; cursor: pointer; color: var(--ink);
  }
  .nav-links.open {
    display: flex;
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 2px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
    padding: 12px 24px 20px;
  }
  .nav-links.open a { padding: 9px 0; width: 100%; }
  .hero { padding: 92px 0 84px; }
  .section { padding: 66px 0; }
}
@media (max-width: 520px) {
  .cards, .steps { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Frosted-glass cards & why-items over the 3D scene (both modes) */
.card, .why-item {
  background: rgba(16, 26, 46, .5);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
          backdrop-filter: blur(10px) saturate(140%);
  border-color: rgba(255, 255, 255, .10);
}
.card:hover, .why-item:hover {
  border-color: rgba(47, 155, 239, .35);
}

/* ============================================================
   SCROLLYTELLING STAGE — pinned 3D scrub
   Content lives as "beats" that eject from the rotating sphere.
   Base styles = the no-JS / reduced-motion / mobile fallback
   (a normal centred stack). `.scrub` on <body> switches on the
   pinned 3D behaviour, driven from index.html.
   ============================================================ */

.scrolly { position: relative; }

/* Fallback: each beat is a normal, readable centred block */
.beat {
  max-width: 680px;
  margin: 0 auto;
  padding: 74px 24px;
  text-align: center;
}
.beat .section-head { margin: 0 auto 40px; }
.beat .card, .beat .why-item { text-align: left; }
.beat .why-item { padding: 30px; border-radius: var(--radius); border: 1px solid var(--line); }

/* ---------- Scrub (pinned 3D) mode ---------- */
.scrub .stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  perspective: 1000px;
  perspective-origin: 50% 46%;
}
/* Darken the centre so beats stay legible over the bright particles */
.scrub .stage::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(58% 52% at 50% 47%, rgba(8,12,20,.88), rgba(8,12,20,.45) 55%, transparent 80%);
  pointer-events: none;
  z-index: 1;
}
.scrub .beats {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  z-index: 2;
}
.scrub .beat {
  position: absolute;
  top: 50%; left: 50%;
  width: min(680px, 90vw);
  max-width: none;
  margin: 0;
  padding: 0 10px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: transform, opacity, filter;
  transform: translate(-50%, -50%);
}
/* Grouped beats (heading + cards / why-items) get more room */
.scrub .beat-wide { width: min(1040px, 94vw); }
.scrub .beat-wide .section-head { margin: 0 auto 26px; }
.scrub .beat .cards { gap: 16px; }
.scrub .beat-wide .card { padding: 22px 22px; }
.scrub .beat .card p { font-size: 14.5px; line-height: 1.55; }

/* Per-card flow is driven every frame from JS — no CSS transition to fight it */
.scrub .beat .card,
.scrub .beat .why-item { transition: none; will-change: transform, opacity; }

/* Progress rail (scrub only) */
.progress { display: none; }
.scrub .progress {
  display: flex;
  position: fixed;
  right: 22px; top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
  gap: 11px;
  z-index: 40;
}
.progress b {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  transition: background .25s, transform .25s;
}
.progress b.on { background: var(--blue-bright); transform: scale(1.5); }

/* Scroll hint (scrub only) */
.scroll-hint { display: none; }
.scrub .scroll-hint {
  display: block;
  position: absolute;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  color: var(--ink-dim);
  font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase;
  z-index: 3;
  transition: opacity .5s;
  animation: hintPulse 2.4s var(--ease) infinite;
}
.scrub.scrolled .scroll-hint { opacity: 0; }
@keyframes hintPulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .scrub .scroll-hint { animation: none; }
}
