/* ENT Studios — site styles (vanilla, no dependencies) */

@font-face {
  font-family: "Neue Haas";
  src: url("../fonts/nhaas-55.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Neue Haas";
  src: url("../fonts/nhaas-65.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --blue: #0099ff;
  --blue-dark: #0077cc;
  --navy: #0a4870;
  --navy-deep: #083a5b;
  --ink: #1b2330;
  --text: #3d4654;
  --muted: #6b7482;
  --line: #e4e8ee;
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --surface: #ffffff;
  --link: var(--blue-dark);
  --shadow: rgba(10, 40, 80, 0.3);
  --media-bg: linear-gradient(180deg, #fff, #f1f4f8);
  --logo-filter: grayscale(1);
  --logo-filter-hover: none;
  --team-bg: var(--navy);
  --footer-bg: var(--navy-deep);

  --font: "Neue Haas", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --section: clamp(64px, 10vw, 112px);
  --radius: 10px;
  --header-h: 64px;

  color-scheme: light dark;
}

/* Dark theme follows the operating system setting. */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef2f7;
    --text: #b9c2ce;
    --muted: #8a96a6;
    --line: #223043;
    --bg: #0a111a;
    --bg-alt: #0e1722;
    --surface: #111b27;
    --link: #5cc0ff;
    --shadow: rgba(0, 0, 0, 0.6);
    /* Keep a light backdrop behind renders so they look as intended. */
    --media-bg: linear-gradient(180deg, #e9eef4, #d6dde6);
    /* Logos are mostly dark-on-transparent: flip them to light monochrome. */
    --logo-filter: grayscale(1) invert(1) brightness(1.1);
    --logo-filter-hover: grayscale(1) invert(1) brightness(1.4);
    --team-bg: #0b2438;
    --footer-bg: #060c13;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--header-h);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3 {
  margin: 0;
  font-weight: 500;
  line-height: 1.15;
  color: var(--ink);
}
p { margin: 0; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--fill { fill: currentColor; stroke: none; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
}
.skip-link:focus { top: 8px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 1.125rem;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 6px; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 24px;
  cursor: pointer;
}

.site-nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text);
}
.site-nav a:hover { color: var(--ink); background: var(--bg-alt); text-decoration: none; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px var(--shadow);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px; }
  .site-nav a { padding: 12px 0; font-size: 1.0625rem; border-radius: 0; }
  .site-nav a:hover { background: none; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(88vh, 820px);
  padding: 96px 0 120px;
  overflow: hidden;
  color: #fff;
  text-align: center;
  background: #1c1f2a;
  isolation: isolate;
}
/* Background photo on its own layer so it can slowly zoom. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("../img/hero-1920.webp") center 70% / cover no-repeat;
  transform-origin: 50% 70%;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% 110%, rgba(0, 153, 255, 0.35), transparent 70%),
    linear-gradient(180deg, rgba(8, 20, 35, 0.4), rgba(8, 20, 35, 0.65));
}
@media (max-width: 960px) {
  .hero::before { background-image: url("../img/hero-960.webp"); }
}

.hero__logo {
  width: clamp(140px, 22vw, 200px);
  height: auto;
  margin: 0 auto 32px;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 153, 255, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35);
}

.pillar-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.1em 0.6em;
  color: #fff;
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  letter-spacing: -0.01em;
}
.pillar-links a + a::before {
  content: "";
  display: inline-block;
  width: 2px;
  height: 0.8em;
  margin-right: 0.6em;
  vertical-align: -0.05em;
  background: var(--blue);
}
.pillar-links a { color: #fff; transition: color 0.2s; }
.pillar-links a:hover { color: #9fd6ff; text-decoration: none; }

/* Twinkling speckles around the pillar words. */
.hero__pillars { position: relative; width: fit-content; margin-inline: auto; }
.sparkles {
  position: absolute;
  inset: -22px -36px;
  pointer-events: none;
}
.sparkles i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s, 3px);
  height: var(--s, 3px);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.9), 0 0 14px 3px rgba(120, 200, 255, 0.45);
  opacity: 0.6;
}
/* A few larger ones get a four-point flare. */
.sparkles i.flare::before,
.sparkles i.flare::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 1px;
  margin: -0.5px 0 0 -9px;
  background: linear-gradient(90deg, transparent, #fff, transparent);
}
.sparkles i.flare::after { transform: rotate(90deg); }
/* Fading in and out involves no movement, so it also runs with reduced motion. */
.sparkles i { animation: twinkle var(--t, 3s) calc(var(--d, 0s) * -1) ease-in-out infinite; }
@media (prefers-reduced-motion: no-preference) {
  .sparkles i {
    animation:
      twinkle-grow var(--t, 3s) calc(var(--d, 0s) * -1) ease-in-out infinite,
      drift calc(var(--t, 3s) * 3) calc(var(--d, 0s) * -1) ease-in-out infinite alternate;
  }
  .sparkles i.flare::before,
  .sparkles i.flare::after { animation: spin calc(var(--t, 3s) * 2) linear infinite; }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 1; }
}
@keyframes twinkle-grow {
  0%, 100% { opacity: 0; scale: 0.3; }
  50% { opacity: 1; scale: 1.2; }
}
@keyframes drift {
  from { translate: 0 0; }
  to { translate: 6px -10px; }
}
@keyframes spin {
  to { rotate: 180deg; }
}

.hero__sub {
  margin-top: 16px;
  font-size: clamp(1.0625rem, 2.2vw, 1.375rem);
  color: rgba(255, 255, 255, 0.9);
}

.hero__quote {
  max-width: 34ch;
  margin: 36px auto 0;
  font-size: 1.0625rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.7);
}

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 28px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  transition: background 0.2s, border-color 0.2s;
}
.hero__scroll:hover { background: rgba(255, 255, 255, 0.1); border-color: #fff; }

@media (prefers-reduced-motion: no-preference) {
  .hero::before { animation: hero-zoom 30s ease-out both; }
  .hero .wrap > * { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero .wrap > :nth-child(2) { animation-delay: 0.12s; }
  .hero .wrap > :nth-child(3) { animation-delay: 0.24s; }
  .hero .wrap > :nth-child(4) { animation-delay: 0.36s; }
  .hero__scroll { animation: rise 0.8s 0.6s both, bob 2.4s 1.4s ease-in-out infinite; }
}
@keyframes hero-zoom { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes bob { 50% { transform: translateY(6px); } }

/* ---------- Sections ---------- */

.section { padding-block: var(--section); }
.section--alt { background: var(--bg-alt); }
.section--dark { background: var(--team-bg); color: rgba(255, 255, 255, 0.82); }
.section--dark h2,
.section--dark h3 { color: #fff; }

/* Blueprint-style dot grid, fading out towards the bottom. */
.section--grid {
  background:
    radial-gradient(circle, rgba(0, 153, 255, 0.18) 1px, transparent 1.5px) 0 0 / 24px 24px;
  position: relative;
}
.section--grid::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 20%, transparent), var(--bg) 85%);
}
.section--grid > .wrap { position: relative; z-index: 1; }

.section__head {
  max-width: 720px;
  margin: 0 auto clamp(40px, 6vw, 64px);
  text-align: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}
.eyebrow::before,
.section__head .eyebrow::after {
  content: "";
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.6;
}
.section--dark .eyebrow { color: #7cc6ff; }
.section__head h2 { font-size: clamp(1.875rem, 4vw, 2.625rem); }
.section__head p { margin-top: 18px; font-size: 1.125rem; }
.section__head p + p { margin-top: 12px; }

/* ---------- Pillars ---------- */

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) {
  .pillars { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; }
}

.pillar {
  --accent: var(--blue);
  --accent-soft: rgba(0, 153, 255, 0.1);
  position: relative;
  overflow: hidden;
  padding: 32px 28px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 30, 50, 0.04);
  scroll-margin-top: calc(var(--header-h) + 24px);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
}
.pillar--connect { --accent: #00b3c7; --accent-soft: rgba(0, 179, 199, 0.1); }
.pillar--compute { --accent: #5b5ff0; --accent-soft: rgba(91, 95, 240, 0.1); }

.pillar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 30%, var(--surface)));
}
.pillar:hover,
.pillar:target {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 24px 48px -16px color-mix(in srgb, var(--accent) 40%, transparent);
}

.pillar__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 28px;
  transition: background 0.3s, color 0.3s, transform 0.3s;
}
.pillar:hover .pillar__icon {
  background: var(--accent);
  color: #fff;
  transform: rotate(-6deg) scale(1.05);
}

/* Large outlined number in the corner. */
.pillar__num {
  position: absolute;
  top: 6px;
  right: 18px;
  font-size: 5.5rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1.5px color-mix(in srgb, var(--accent) 30%, transparent);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  transition: -webkit-text-stroke-color 0.3s;
}
.pillar:hover .pillar__num { -webkit-text-stroke-color: color-mix(in srgb, var(--accent) 60%, transparent); }

.pillar h3 { font-size: 1.75rem; }
.pillar__lead { margin-top: 6px; color: var(--accent); font-weight: 500; }
.pillar ul {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.pillar li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.pillar li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  transform: translateY(-2px) rotate(45deg);
}

/* ---------- Company intro ---------- */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 24px 56px;
  margin-top: clamp(56px, 8vw, 88px);
  padding: clamp(28px, 4vw, 44px);
  border-radius: 16px;
  background: linear-gradient(135deg, var(--navy) 0%, #0b5a8c 100%);
  color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 30px 60px -30px rgba(10, 72, 112, 0.6);
}
@media (max-width: 760px) { .intro { grid-template-columns: 1fr; } }
.intro .eyebrow { color: #7cc6ff; }
.intro h3 {
  color: #fff;
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  line-height: 1.2;
}
.intro__body { font-size: 1.125rem; }
.intro__body p + p { margin-top: 14px; }

/* ---------- Projects ---------- */

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
}
.project {
  margin: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.project:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -18px var(--shadow);
}
.project img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  padding: 12px;
  background: var(--media-bg);
  border-bottom: 1px solid var(--line);
  transition: transform 0.35s ease;
}
.project:hover img { transform: scale(1.03); }
/* Photos fill the frame instead of floating on a light panel like renders. */
.project--photo img { object-fit: cover; padding: 0; }
.project figcaption { padding: 16px 18px 18px; }
.project h3 { font-size: 1.0625rem; line-height: 1.3; }
.project p { margin-top: 4px; font-size: 0.9375rem; color: var(--muted); }
.project__link { display: block; color: inherit; }
.project__link:hover { text-decoration: none; }
.project__link:hover h3 { color: var(--link); }
.project__ext {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.875em;
  vertical-align: -0.1em;
  color: var(--muted);
}

/* ---------- Team ---------- */

.team {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 32px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  text-align: center;
}
@media (max-width: 760px) { .team { grid-template-columns: repeat(2, 1fr); gap: 40px 16px; } }

.member img {
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.15);
}
.member h3 { font-size: 1.125rem; }
.member__role { margin-top: 2px; color: #fff; opacity: 0.85; }
.member__skills {
  max-width: 26ch;
  margin: 8px auto 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.6);
}
.member__link {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-top: 10px;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
}
.member__link:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }

/* ---------- References ---------- */

/* Flex (not grid) so an incomplete last row stays centered. */
.logos {
  --cols: 5;
  --gap: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 900px) { .logos { --cols: 4; } }
@media (max-width: 600px) { .logos { --cols: 2; } }
.logos li {
  display: grid;
  place-items: center;
  flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  height: 100px;
  padding: 16px 8px;
}
.logos img {
  width: auto;
  max-width: 100%;
  max-height: calc(56px * var(--s, 1));
  object-fit: contain;
  filter: var(--logo-filter);
  opacity: 0.7;
  transition: filter 0.25s, opacity 0.25s;
}
.logos a {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}
.logos li:hover img,
.logos a:focus-visible img { filter: var(--logo-filter-hover); opacity: 1; }
/* Logos drawn as filled light shapes read badly when inverted in dark mode. */
@media (prefers-color-scheme: dark) {
  .logos img.no-invert { filter: grayscale(1); }
}

/* ---------- Contact ---------- */

.contact {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 760px) { .contact { grid-template-columns: 1fr; gap: 36px; } }

.contact h2 { font-size: clamp(1.875rem, 4vw, 2.625rem); }
.contact__intro { margin-top: 16px; font-size: 1.125rem; max-width: 40ch; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 500;
  transition: background 0.2s;
}
.btn:hover { background: var(--blue-dark); text-decoration: none; }
.btn .icon { font-size: 20px; }

.contact__card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.contact__card address { font-style: normal; color: var(--ink); line-height: 1.55; }
.contact__card dl { margin: 16px 0 0; font-size: 0.9375rem; }
.contact__card dt { color: var(--muted); }
.contact__card dd { margin: 0 0 8px; color: var(--ink); }

.social {
  display: flex;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.social a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 18px;
  transition: color 0.2s, border-color 0.2s;
}
.social a:hover { color: var(--blue); border-color: var(--blue); }

/* ---------- Footer ---------- */

.site-footer {
  padding: 28px 0;
  background: var(--footer-bg);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer a { color: rgba(255, 255, 255, 0.85); }
.site-footer a:hover { color: #fff; }

/* ---------- Legal pages ---------- */

.legal {
  max-width: 760px;
  padding-block: clamp(48px, 8vw, 88px);
}
.legal h1 { font-size: clamp(2rem, 4.5vw, 2.75rem); margin-bottom: 28px; }
.legal h2 { font-size: 1.375rem; margin: 40px 0 12px; }
.legal p { margin-bottom: 16px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  font-weight: 500;
}

/* ---------- Scroll reveal (enabled by main.js) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js-reveal .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: calc(var(--i, 0) * 80ms);
  }
  .js-reveal .reveal.is-visible { opacity: 1; transform: none; }
}
