/* =============================================================
   Trizone Systems Limited / Custom stylesheet
   ============================================================= */

/* ---------- Self-hosted web fonts ---------- */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("public/fonts/space-grotesk-500.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("public/fonts/space-grotesk-700.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("public/fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("public/fonts/inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("public/fonts/inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("public/fonts/jetbrains-mono-500.woff2") format("woff2");
}

/* ---------- Design tokens ---------- */
:root {
  --bg:          #050507;
  --bg-alt:      #09090C;
  --surface:     #0E0E0E;
  --surface-2:   #171717;
  --line:        rgba(255, 255, 255, 0.08);
  --line-2:      rgba(255, 255, 255, 0.14);

  --text:        #E8E8EA;
  --text-muted:  #8A8B92;
  --text-dim:    #5C5D64;

  --accent:      #F58220;
  --accent-deep: #E86A0C;

  --font-display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --radius-sm: 3px;
  --radius:    8px;
  --radius-lg: 12px;

  --header-h: 72px;
  --container: 1200px;

  --ease: cubic-bezier(.2,.7,.2,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  background: var(--bg);
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
strong { color: #fff; font-weight: 600; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
  position: relative;
  z-index: 1;
}
main > section {
  position: relative;
  padding: clamp(88px, 10vw, 160px) 0;
  overflow: clip;
  background-color: var(--bg);
  isolation: isolate;
}
main > section:nth-of-type(even) { background-color: var(--bg-alt); }

/* ---------- Decorative shapes ---------- */
.decor {
  position: absolute;
  pointer-events: none;
  user-select: none;
}

.decor--bl-anchor {
  bottom: -180px;
  left: -120px;
  width: min(560px, 44vw);
  height: auto;
  opacity: 0.05;
  transform: rotate(-14deg);
  z-index: 0;
}

.decor--cta-r,
.decor--cta-l {
  top: 50%;
  width: min(620px, 46vw);
  height: auto;
  opacity: 0.14;
  z-index: 0;
}
.decor--cta-r {
  right: 0;
  transform: translateY(-50%);
}
.decor--cta-l {
  left: 0;
  transform: translateY(-50%) scaleX(-1);
}

.decor--cta-l,
.decor--cta-r { transition: opacity .5s var(--ease); }
#cta:has(.btn-primary:hover) .decor--cta-l,
#cta:has(.btn-primary:hover) .decor--cta-r { opacity: 0.02; }

.decor--services-sticky {
  top: 20%;
  right: -200px;
  width: min(560px, 46vw);
  height: auto;
  opacity: 0.06;
  z-index: 0;
  transform: rotate(-4deg);
}

.decor--contact {
  top: 0;
  bottom: 0;
  left: -220px;
  margin-block: auto;
  width: min(420px, 34vw);
  height: min(420px, 34vw);
  opacity: 0.10;
  transform: rotate(-30deg);
  z-index: 0;
  transition: opacity .5s var(--ease);
}
.decor--contact-tr {
  top: -20px;
  right: -30px;
  width: min(220px, 20vw);
  height: min(220px, 20vw);
  opacity: 0.10;
  transform: rotate(15deg);
  z-index: 0;
  transition: opacity .5s var(--ease);
}
#contact:has(.contact-list li:hover) .decor--contact,
#contact:has(.contact-list li:hover) .decor--contact-tr { opacity: 0.28; }

.contact .section-head,
.contact .contact-list {
  margin-left: auto;
  max-width: 880px;
}

#contact { margin-top: clamp(40px, 5vw, 80px); }

main > section > .container,
main > section > header,
main > section > .cards,
main > section > ul { position: relative; z-index: 2; }

/* ---------- Section corner ---------- */
.section-corner {
  position: absolute;
  top: 20px;
  left: clamp(20px, 4vw, 40px);
  width: 22px;
  height: 22px;
  z-index: 2;
  opacity: 0.6;
  pointer-events: none;
}
.section-corner::before,
.section-corner::after {
  content: "";
  position: absolute;
  background: var(--accent);
}
.section-corner::before {
  top: 0; left: 0;
  width: 22px; height: 2px;
}
.section-corner::after {
  top: 0; left: 0;
  width: 2px; height: 22px;
}

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  color: #fff;
  margin: 0 0 .5em;
  font-weight: 700;
}
h1 {
  font-size: clamp(2.5rem, 5vw + 1rem, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}
h2 {
  font-size: clamp(1.7rem, 2.4vw + 1rem, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}
h3 {
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
p  { margin: 0 0 1em; }
.lede {
  font-size: clamp(1.05rem, .4vw + .95rem, 1.2rem);
  color: var(--text-muted);
  max-width: 62ch;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding-bottom: 0.85rem;
  position: relative;
}
.eyebrow::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 40px; height: 1px;
  background: var(--line-2);
}
.eyebrow .tri {
  color: var(--accent);
  font-size: 0.9em;
  transform: translateY(-1px);
}

.band-inner .eyebrow,
.cta-card .eyebrow { justify-content: center; }
.band-inner .eyebrow::after,
.cta-card .eyebrow::after { left: 50%; transform: translateX(-50%); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .95rem 1.6rem;
  font-family: var(--font-body);
  font-weight: 600; font-size: 0.95rem;
  letter-spacing: 0.01em;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  transition: background-color .2s var(--ease), color .2s var(--ease),
              transform .15s var(--ease), box-shadow .2s var(--ease),
              border-color .2s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent); color: #050507;
}
.btn-primary:hover,
.btn-primary:focus-visible { background: var(--accent-deep); color: #fff; }

.btn-ghost {
  background: transparent; color: #fff; border-color: var(--line-2);
}
.btn-ghost:hover,
.btn-ghost:focus-visible { border-color: var(--accent); color: var(--accent); }

.actions { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Reading progress ---------- */
#progress {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0%;
  background: var(--accent);
  z-index: 60;
  transition: width .08s linear;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5,5,7,0.7);
  backdrop-filter: saturate(1.2) blur(12px);
  -webkit-backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(5,5,7,0.9);
  border-bottom-color: var(--line);
}
.nav-row {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.wordmark {
  display: inline-flex; align-items: center; gap: .65rem;
  font-family: var(--font-display);
  font-weight: 700; color: #fff;
  letter-spacing: -0.005em;
}
.wordmark img { width: 32px; height: 32px; object-fit: contain; }

.primary-nav { display: flex; align-items: center; }
.nav-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: 8px;
}
.nav-link {
  position: relative;
  padding: .6rem .95rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color .2s var(--ease);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -8px;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid var(--accent);
  opacity: 0;
  transform: translate(-50%, -4px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.nav-link:hover { color: #fff; }
.nav-link:hover::after,
.nav-link.is-active::after { opacity: 1; transform: translate(-50%, 0); }
.nav-link.is-active { color: #fff; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  background: transparent; border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0; align-items: center; justify-content: center;
  gap: 4px; flex-direction: column;
}
.nav-toggle .bar {
  display: block; width: 20px; height: 2px; background: #fff;
  transition: transform .25s var(--ease), opacity .2s var(--ease);
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(64px, 8vw, 112px); padding-bottom: clamp(72px, 10vw, 160px); }
.hero-grid {
  display: grid; gap: clamp(40px, 6vw, 96px);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1fr 1.15fr; }
}
.hero-visual {
  position: relative;
  width: 100%;
  margin: 0 auto;
  aspect-ratio: 1448 / 1086;
  animation: float-y 7s ease-in-out infinite;
  will-change: transform;
}
.hero-main {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* ---------- Band ---------- */
.band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.band-inner {
  max-width: 780px; text-align: center; margin-inline: auto;
}
.band-inner .lede { margin-inline: auto; }
.band-inner .actions { justify-content: center; }

/* ---------- Services ---------- */
.section-head { max-width: 720px; margin-bottom: clamp(32px, 4vw, 56px); }
.cards {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(28px, 3vw, 40px);
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s var(--ease), background-color .35s var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform .4s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  background: var(--surface-2);
}
.card:hover::before { transform: scaleY(1); }
.card h3 { color: #fff; margin-bottom: .8em; }
.card p  { color: var(--text-muted); }
.card p:last-child { margin-bottom: 0; }

/* ---------- CTA band ---------- */
.cta-band { padding: clamp(56px, 7vw, 112px) 0; }
.cta-card {
  position: relative;
  background: #0E0E0E;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-lg);
  padding: clamp(36px, 5vw, 72px);
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  transition: border-color .5s var(--ease), transform .5s var(--ease);
}
.cta-card::after {
  content: "";
  position: absolute;
  left: 0; top: 0; height: 1px;
  width: 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transition: width .8s var(--ease);
  z-index: 1;
  pointer-events: none;
}
.cta-card:hover {
  border-color: rgba(245,130,32,0.45);
  transform: translateY(-2px);
}
.cta-card:hover::after { width: 100%; }
.cta-card:hover .btn-primary { background: var(--accent-deep); color: #fff; }

.cta-card h2 { color: #fff; margin: 0 0 .5em; }
.cta-card > p { color: #A6A8AE; max-width: 56ch; margin: 0 auto 1em; }
.cta-card .eyebrow { color: #8A8B92; }
.cta-card .eyebrow::after { background: rgba(255,255,255,0.14); }
.cta-card .actions { justify-content: center; margin-top: 1.5rem; }

/* ---------- Contact ---------- */
.contact-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 8px;
  max-width: 720px;
}
.contact-list li {
  position: relative;
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  align-items: baseline;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.contact-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform .4s var(--ease);
}
.contact-list li:hover {
  border-color: var(--line-2);
  background: var(--surface-2);
}
.contact-list li:hover::before { transform: scaleY(1); }
.contact-label {
  min-width: 80px;
  font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-dim); font-weight: 500;
}
.contact-list a,
.contact-list span:last-child { color: #fff; font-family: var(--font-body); }
.contact-list a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer {
  background: #030305;
  color: var(--text-muted);
  padding: clamp(56px, 6vw, 88px) 0 24px;
  margin-top: 40px;
  border-top: 1px solid var(--line);
  position: relative;
  z-index: 1;
}
.site-footer h2 {
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin: 0 0 1.4rem;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--accent); }
.footer-grid {
  display: grid; gap: 48px;
  grid-template-columns: 1fr;
}
@media (min-width: 820px) {
  .footer-grid { grid-template-columns: 1.4fr 1.4fr 1fr; align-items: start; }
}
.footer-brand {
  display: flex; align-items: center; gap: .65rem;
  font-family: var(--font-display);
  color: #fff; font-weight: 700; margin-bottom: 14px;
}
.footer-brand img { width: 32px; height: 32px; object-fit: contain; }
.footer-tag {
  color: var(--text-muted); margin: 0 0 22px; max-width: 32ch;
  font-size: 0.95rem;
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-nav a {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.footer-nav a:hover { color: var(--accent); }

.footer-col p { margin: 0 0 1rem; font-size: 0.92rem; line-height: 1.6; }
.footer-col .disclaimer { color: var(--text-dim); font-size: 0.8rem; margin-top: 16px; }

.footer-contact { list-style: none; margin: 0; padding: 0; }
.footer-contact li { margin: 0 0 .5rem; }

.footer-baseline {
  border-top: 1px solid var(--line);
  padding-top: 24px; margin-top: 48px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
}

/* ---------- Scroll-to-top ---------- */
#to-top {
  position: fixed; right: 22px; bottom: 22px;
  width: 42px; height: 42px;
  border-radius: 999px;
  background: var(--accent); color: #050507;
  border: none;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(10px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), background-color .2s var(--ease);
  z-index: 55;
}
#to-top[hidden] { display: none; }
#to-top.is-visible { opacity: 1; transform: translateY(0); }
#to-top:hover { background: var(--accent-deep); color: #fff; }

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

.reveal.stagger { opacity: 1; transform: none; transition: none; }
.reveal.stagger > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.stagger.is-in > * { opacity: 1; transform: none; }
.reveal.stagger.is-in > *:nth-child(1) { transition-delay: 0ms; }
.reveal.stagger.is-in > *:nth-child(2) { transition-delay: 90ms; }
.reveal.stagger.is-in > *:nth-child(3) { transition-delay: 180ms; }
.reveal.stagger.is-in > *:nth-child(4) { transition-delay: 270ms; }
.reveal.stagger.is-in > *:nth-child(5) { transition-delay: 360ms; }
.reveal.stagger.is-in > *:nth-child(n+6) { transition-delay: 420ms; }

/* ---------- Focus ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Mobile nav ---------- */
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav-list {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    background: rgba(5,5,7,0.98);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px 20px 24px;
    transform: translateY(-8px);
    opacity: 0; pointer-events: none;
    transition: opacity .2s var(--ease), transform .2s var(--ease);
  }
  .nav-list.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-list li { width: 100%; }
  .nav-link { padding: .95rem 1rem; border-radius: var(--radius-sm); }
  .nav-link::after { display: none; }
  body.nav-open { overflow: hidden; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal, .reveal.stagger > * { opacity: 1; transform: none; }
  #progress { display: none; }
  .hero-visual { animation: none !important; }
}
