/* PHV Technologies — cinematic site. No external requests (CSP: 'self' only). */

@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-var.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-italic.woff2") format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #06070a;
  --bg-2: #0b0d12;
  --bg-3: #11141b;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --ink: #f1f2f6;
  --muted: #9aa0b0;
  --dim: #636a7b;
  --blue: #5b7cff;
  --blue-deep: #1d2fd6;
  --green: #3fd97f;
  --red: #ff4f58;
  --paper: #f4f2ec;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1240px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; line-height: 1.05; margin: 0; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; color: #fff;
     background: linear-gradient(100deg, #fff 10%, #b9c6ff 50%, #9ff0c4 90%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; padding-right: .06em; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: #fff; color: #000; padding: 10px 14px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- film grain + letterbox intro ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-6%, 4%); } 40% { transform: translate(5%, -7%); }
  60% { transform: translate(-3%, 8%); } 80% { transform: translate(7%, 2%); } 100% { transform: translate(0, 0); }
}
.letterbox span { position: fixed; left: 0; right: 0; height: 13vh; background: #000; z-index: 80; pointer-events: none;
  transition: transform 1.4s var(--ease) .5s; }
.letterbox span:first-child { top: 0; }
.letterbox span:last-child { bottom: 0; }
.is-loaded .letterbox span:first-child { transform: translateY(-100%); }
.is-loaded .letterbox span:last-child { transform: translateY(100%); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 60; display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter); transition: background .4s, padding .4s, border-color .4s; border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: rgba(6, 7, 10, .72); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); padding-block: 10px; border-bottom-color: var(--line); }
.nav__brand img { width: 124px; }
.nav__links { display: flex; gap: 30px; align-items: center; }
.nav__links a { text-decoration: none; font-size: 14px; color: var(--muted); transition: color .2s; }
.nav__links a:hover { color: #fff; }
.nav__links .nav__cta { color: #fff; border: 1px solid var(--line-2); padding: 9px 16px; border-radius: 999px; }
.nav__links .nav__cta:hover { background: #fff; color: #000; }
.nav__toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; position: relative; }
.nav__toggle span { position: absolute; left: 11px; right: 11px; height: 1.5px; background: #fff; transition: transform .3s; }
.nav__toggle span:first-child { top: 18px; } .nav__toggle span:last-child { top: 25px; }
.nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav__toggle { display: block; z-index: 2; }
  .nav__links {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 26px; background: rgba(6, 7, 10, .97);
    opacity: 0; pointer-events: none; transition: opacity .35s;
  }
  .nav__links a { font: 500 26px var(--display); color: #fff; }
  .nav.is-open .nav__links { opacity: 1; pointer-events: auto; }
}

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 120px var(--gutter) 40px; overflow: hidden; isolation: isolate; }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero__glow {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px circle at var(--mx, 70%) var(--my, 40%), rgba(91, 124, 255, .16), transparent 60%),
    radial-gradient(900px 500px at 85% 10%, rgba(29, 47, 214, .22), transparent 70%),
    radial-gradient(700px 500px at 0% 100%, rgba(63, 217, 127, .10), transparent 70%),
    linear-gradient(180deg, transparent 60%, var(--bg) 100%);
}
.hero__inner { max-width: var(--max); width: 100%; margin: 0 auto; }
.eyebrow { font: 500 12px/1 var(--body); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin: 0 0 22px; }
.hero__title { font-size: clamp(46px, 9.4vw, 136px); line-height: .94; letter-spacing: -.045em; font-weight: 600; }
.hero__title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero__title .line > span { display: inline-block; transform: translateY(110%); transition: transform 1.3s var(--ease); }
.is-loaded .hero__title .line > span { transform: none; }
.is-loaded .hero__title .line:nth-child(1) > span { transition-delay: .9s; }
.is-loaded .hero__title .line:nth-child(2) > span { transition-delay: 1.02s; }
.is-loaded .hero__title .line:nth-child(3) > span { transition-delay: 1.14s; }
.hero__sub { max-width: 560px; color: var(--muted); font-size: clamp(16px, 1.6vw, 18px); margin: 30px 0 34px; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.reveal-up { opacity: 0; transform: translateY(18px); transition: opacity 1s var(--ease) 1.45s, transform 1s var(--ease) 1.45s; }
.is-loaded .reveal-up { opacity: 1; transform: none; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 24px; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: 15px; transition: transform .25s var(--ease), background .25s, color .25s, border-color .25s; }
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: #fff; color: #000; }
.btn--primary:hover { background: #dfe5ff; }
.btn--ghost { border: 1px solid var(--line-2); color: #fff; }
.btn--ghost:hover { border-color: #fff; }

.hero__stats { max-width: var(--max); width: 100%; margin: 70px auto 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.hero__stats > div { padding: 20px 0 0; }
.hero__stats > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.hero__stats dt { font-size: 12px; color: var(--dim); letter-spacing: .08em; text-transform: uppercase; }
.hero__stats dd { margin: 6px 0 0; font: 500 clamp(26px, 3.6vw, 44px)/1 var(--display); letter-spacing: -.03em; }
.hero__scroll { position: absolute; left: 50%; bottom: 22px; width: 22px; height: 36px; border: 1.5px solid var(--line-2); border-radius: 12px; transform: translateX(-50%); }
.hero__scroll span { position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: #fff; animation: wheel 1.8s infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }
@media (max-width: 640px) {
  .hero__stats > div + div { padding-left: 12px; }
  .hero__scroll { display: none; }
}

/* ---------- clients marquee ---------- */
.clients { padding: 56px 0 30px; border-block: 1px solid var(--line); background: var(--bg-2); }
.clients__label { text-align: center; color: var(--dim); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 26px; padding: 0 var(--gutter); }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee__track { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0 0 26px; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track li { width: 112px; height: 112px; border-radius: 18px; overflow: hidden; flex: none; background: #fff; filter: grayscale(1) contrast(1.05); opacity: .72; transition: filter .4s, opacity .4s, transform .4s var(--ease); }
.marquee__track li:hover { filter: none; opacity: 1; transform: translateY(-4px); }
.marquee__track img { width: 100%; height: 100%; object-fit: cover; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; padding: clamp(80px, 12vw, 150px) var(--gutter); }
.section__head { margin-bottom: clamp(36px, 6vw, 64px); }
.section h2 { font-size: clamp(34px, 5.6vw, 72px); max-width: 15ch; }
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- work ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 30px; }
.chip { font: 500 14px var(--body); color: var(--muted); background: transparent; border: 1px solid var(--line-2); padding: 8px 16px; border-radius: 999px; cursor: pointer; transition: all .25s; }
.chip:hover { color: #fff; border-color: #fff; }
.chip.is-active { background: #fff; color: #000; border-color: #fff; }
.work__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 28px); }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; transition: border-color .4s, transform .6s var(--ease), opacity .6s; }
.card.is-hidden { display: none; }
.card:hover { border-color: var(--line-2); }
.card__media { position: relative; aspect-ratio: 585 / 400; overflow: hidden; }
.card__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(6, 7, 10, .55)); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); filter: saturate(.85) contrast(1.05); transition: transform 1.2s var(--ease), filter .8s; }
.card:hover .card__media img { transform: scale(1.1); filter: saturate(1.05) contrast(1.05); }
.card__body { padding: 22px 24px 26px; }
.card h3 { font-size: 24px; margin: 10px 0 8px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.tag { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); }
@media (min-width: 1000px) {
  .work__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* 8 cards + 1 wide = 9 cells = 3 full rows; the wide card's cinemascope crop matches its neighbours' image height */
  .work__grid .card:nth-child(1) { grid-column: span 2; }
  .work__grid .card:nth-child(1) .card__media { aspect-ratio: 2.95 / 1; }
  .work__grid .card:nth-child(1) .card__media img { object-position: 50% 35%; }
}
@media (max-width: 640px) { .work__grid { grid-template-columns: 1fr; } }

/* ---------- services ---------- */
.services { border-top: 1px solid var(--line); }
.services__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.pillar { background: var(--bg); padding: clamp(26px, 3vw, 40px); position: relative; transition: background .5s; }
.pillar:hover { background: var(--bg-2); }
.pillar__num { font: 500 13px var(--display); color: var(--dim); }
.pillar h3 { font-size: clamp(26px, 2.6vw, 34px); margin: 40px 0 10px; }
.pillar p { color: var(--muted); margin: 0 0 22px; }
.pillar ul { list-style: none; padding: 0; margin: 0; }
.pillar li { padding: 11px 0; border-top: 1px solid var(--line); font-size: 15px; }
.pillar li::before { content: "↗"; color: var(--green); margin-right: 10px; font-size: 13px; }
@media (max-width: 900px) { .services__grid { grid-template-columns: 1fr; } }

.process { list-style: none; padding: 0; margin: clamp(56px, 8vw, 96px) 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; counter-reset: p; }
.process li { border-top: 1px solid var(--line-2); padding-top: 20px; }
.process span { font: 500 13px var(--display); color: var(--blue); }
.process h4 { font-size: 22px; margin: 12px 0 8px; }
.process p { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 900px) { .process { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .process { grid-template-columns: 1fr; } }

/* ---------- trust ---------- */
.trust { border-top: 1px solid var(--line); }
.trust__grid { display: grid; grid-template-columns: .95fr 1.05fr; gap: clamp(20px, 3vw, 32px); }
.paper { background: var(--paper); color: #16181d; border-radius: 22px; padding: clamp(26px, 3vw, 40px); box-shadow: 0 40px 80px -40px rgba(91, 124, 255, .35); }
.paper img { width: 190px; margin-bottom: 26px; }
.paper dl { margin: 0; }
.paper dl > div { padding: 13px 0; border-top: 1px solid rgba(0, 0, 0, .09); }
.paper dt { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #6b7080; }
.paper dd { margin: 4px 0 0; font: 500 16px/1.4 var(--display); }
.trust__cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2vw, 20px); }
.tcard { border: 1px solid var(--line); border-radius: 20px; padding: 24px; background: var(--bg-2); }
.tcard h3 { font-size: 19px; margin-bottom: 10px; }
.tcard p { margin: 0; color: var(--muted); font-size: 14.5px; }
.tcard a { color: #fff; }
.policies { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.policies a { text-decoration: none; border: 1px solid var(--line-2); border-radius: 999px; padding: 10px 18px; font-size: 14px; transition: all .25s; }
.policies a:hover { background: #fff; color: #000; }
@media (max-width: 900px) { .trust__grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .trust__cards { grid-template-columns: 1fr; } }

/* ---------- contact ---------- */
.contact { border-top: 1px solid var(--line); text-align: center; }
.contact .eyebrow { margin-bottom: 26px; }
.contact__title { font-size: clamp(42px, 8vw, 112px) !important; max-width: 13ch !important; margin: 0 auto; line-height: .98; letter-spacing: -.045em; }
.contact__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: clamp(40px, 6vw, 70px) 0 30px; text-align: left; }
.ccard { text-decoration: none; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--bg-2); display: flex; flex-direction: column; gap: 6px; transition: border-color .3s, transform .4s var(--ease), background .3s; }
.ccard:hover { border-color: #fff; transform: translateY(-3px); background: var(--bg-3); }
.ccard span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.ccard b { font: 500 clamp(18px, 1.8vw, 22px) var(--display); overflow-wrap: anywhere; }
.addresses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; text-align: left; }
.addresses > div { padding: 22px 24px; border-top: 1px solid var(--line); }
.addresses span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.addresses p { margin: 6px 0 0; color: var(--muted); }
@media (max-width: 760px) { .contact__grid, .addresses { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 56px var(--gutter) 34px; }
.footer > * { max-width: var(--max); margin-inline: auto; }
.footer__top { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding-bottom: 36px; border-bottom: 1px solid var(--line); }
.footer__top img { width: 150px; }
.footer__tag { margin: 0; color: var(--dim); font-size: 14px; }
.footer__cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr .8fr; gap: 28px; padding: 36px 0; }
.footer h4 { font: 500 12px var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin-bottom: 12px; }
.footer p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.9; }
.footer a { text-decoration: none; } .footer a:hover { color: #fff; text-decoration: underline; }
.footer .footer__legal { color: var(--dim); font-size: 13px; margin: 0 auto; padding-top: 24px; border-top: 1px solid var(--line); }
@media (max-width: 760px) { .footer__cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .footer__cols { grid-template-columns: 1fr; } }

/* ---------- legal / document pages ---------- */
.doc-hero { padding: 150px var(--gutter) 40px; border-bottom: 1px solid var(--line); background:
  radial-gradient(700px 360px at 80% 0%, rgba(29, 47, 214, .22), transparent 70%), var(--bg); }
.doc-hero > * { max-width: 820px; margin-inline: auto; }
.doc-hero h1 { font-size: clamp(40px, 7vw, 76px); letter-spacing: -.04em; }
.doc-hero p { color: var(--muted); margin-top: 16px; }
.doc { max-width: 820px; margin: 0 auto; padding: 56px var(--gutter) 100px; }
.doc h2 { font-size: 24px; margin: 46px 0 14px; letter-spacing: -.01em; }
.doc h3 { font-size: 18px; margin: 26px 0 8px; }
.doc p, .doc li { color: #c9cdd8; }
.doc ul, .doc ol { padding-left: 22px; } .doc li { margin: 6px 0; }
.doc a { color: #fff; text-underline-offset: 3px; }
.doc .box { border: 1px solid var(--line-2); border-radius: 16px; padding: 20px 22px; background: var(--bg-2); margin: 22px 0; }
.doc .box p { margin: 4px 0; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 14px 0; }
.doc th, .doc td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; color: #c9cdd8; }
.doc th { color: #fff; font-weight: 600; }
.doc-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.doc-nav a { text-decoration: none; font-size: 13.5px; border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 14px; color: var(--muted); }
.doc-nav a[aria-current="page"], .doc-nav a:hover { background: #fff; color: #000; border-color: #fff; }
.doc-page .letterbox { display: none; }
.doc-page .reveal-up { opacity: 1; transform: none; }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  html { scroll-behavior: auto; }
  .reveal, .reveal-up, .hero__title .line > span { opacity: 1 !important; transform: none !important; }
  .letterbox { display: none; }
}
