/* OptiDetect EDGE AI — optidetect.uk */

@font-face { font-family: "Ubuntu"; font-style: normal; font-weight: 300; font-display: swap; src: url("../fonts/ubuntu-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ubuntu-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ubuntu-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/ubuntu-latin-700-normal.woff2") format("woff2"); }

:root {
  --black: #000000;
  --charcoal: #1e2023;
  --graphite: #34373b;
  --line: #45494e;
  --ash: #a4a8ad;
  --smoke: #d9dbde;
  --white: #ffffff;

  --font: "Ubuntu", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section: clamp(4.5rem, 10vw, 8rem);
  --header-h: 4.25rem;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--black);
  color: var(--smoke);
  font-family: var(--font);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--white); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; border-radius: 2px; }
strong { font-weight: 500; color: var(--white); }

h1, h2, h3 { color: var(--white); margin: 0; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); font-weight: 300; line-height: 1.12; letter-spacing: -0.015em; margin-bottom: 1.25rem; }
h3 { font-size: 1.125rem; font-weight: 500; line-height: 1.3; }
p { margin: 0 0 1rem; max-width: 40rem; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 44rem; }
.section { padding-block: var(--section); border-top: 1px solid var(--graphite); }

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--white); color: var(--black); padding: 0.6rem 1rem; }
.skip-link:focus { top: calc(1rem + env(safe-area-inset-top, 0px)); }

/* Smoke: static procedural texture, no image download */
.smoke {
  position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='600'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.004 0.009' numOctaves='4' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 -0.35'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)'/%3E%3C/svg%3E");
  background-size: cover;
  opacity: 0.22;
  mix-blend-mode: screen;
}

/* Header */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.brand .logo { height: 34px; width: auto; display: block; }
.brand .logo text { font-family: var(--font); }
.brand-product { font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.08em; color: var(--ash); padding-left: 0.75rem; border-left: 1px solid var(--line); }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 1.75rem; }
.site-nav a { color: var(--smoke); text-decoration: none; font-size: 0.9375rem; font-weight: 400; }
.site-nav a:hover { color: var(--white); text-decoration: underline; }
.site-nav .nav-cta { color: var(--white); border: 1px solid var(--line); padding: 0.45rem 0.95rem; border-radius: 2px; }
.site-nav .nav-cta:hover { border-color: var(--white); text-decoration: none; }

.nav-toggle { display: none; align-items: center; gap: 0.6rem; background: none; border: 1px solid var(--line); color: var(--white); font: 400 0.9375rem var(--font); padding: 0.5rem 0.8rem; border-radius: 2px; cursor: pointer; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 16px; height: 1.5px; background: currentColor; position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--black); border-bottom: 1px solid var(--graphite); display: none; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem var(--gutter) 1.25rem; }
  .site-nav a { display: block; padding: 0.85rem 0; border-bottom: 1px solid var(--charcoal); font-size: 1.0625rem; }
  .site-nav .nav-cta { margin-top: 1rem; text-align: center; border-bottom: 1px solid var(--line); }
}

/* Buttons */
.btn { display: inline-block; font: 500 1rem var(--font); text-decoration: none; padding: 0.9rem 1.5rem; border-radius: 2px; border: 1px solid var(--white); transition: background-color 0.15s, color 0.15s; }
.btn-light { background: var(--white); color: var(--black); }
.btn-light:hover { background: transparent; color: var(--white); }

/* 1. Hero / problem */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; background: var(--black); }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 55%; opacity: 0.8; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.55) 45%, rgba(0,0,0,0) 78%), linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0.6) 70%, #000 100%); }
.hero-note { position: absolute; right: var(--gutter); bottom: 1rem; margin: 0; font-size: 0.75rem; color: var(--ash); max-width: 22rem; text-align: right; z-index: 1; }
@media (max-width: 720px) {
  .hero { display: block; min-height: 0; padding-top: var(--header-h); }
  .hero-media { position: relative; inset: auto; aspect-ratio: 4 / 3; }
  .hero-media img { opacity: 1; object-position: 50% 50%; }
  .hero-media::after { background: linear-gradient(180deg, rgba(0,0,0,0) 55%, #000 100%); }
  .hero .hero-content { padding-top: 0; margin-top: -2rem; padding-bottom: 1.5rem; }
  .hero-note { position: static; text-align: left; padding: 0 var(--gutter) 2rem; max-width: none; }
}
.hero-content { position: relative; padding-top: calc(var(--header-h) + 5rem); padding-bottom: clamp(3rem, 8vh, 6rem); }
.hero h1 { font-size: clamp(2.75rem, 8.5vw, 6.5rem); font-weight: 300; line-height: 0.98; letter-spacing: -0.035em; margin-bottom: 2rem; }
.hero h1 span { display: block; }
.hero h1 .dim { color: var(--ash); font-weight: 700; }
.lede { font-size: clamp(1.0625rem, 1.6vw, 1.25rem); color: var(--smoke); max-width: 38rem; }
.challenges { list-style: none; padding: 0; margin: 2.25rem 0 2.5rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); max-width: 60rem; }
.challenges li { padding: 1.1rem 1.5rem 0 0; font-size: 0.9375rem; color: var(--ash); }
.challenges li + li { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.challenges strong { display: block; margin-bottom: 0.25rem; }
@media (max-width: 720px) {
  .challenges { grid-template-columns: 1fr; }
  .challenges li, .challenges li + li { padding: 0.9rem 0; border-left: 0; border-bottom: 1px solid var(--charcoal); }
}

/* Page-load sequence: the one orchestrated moment */
@media (prefers-reduced-motion: no-preference) {
  .hero h1 span { opacity: 0; transform: translateY(0.4em); animation: rise 0.9s cubic-bezier(.2,.7,.2,1) forwards; }
  .hero h1 span:nth-child(2) { animation-delay: 0.18s; }
  .hero h1 span:nth-child(3) { animation-delay: 0.5s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}

/* 2. Node */
.node { background: var(--black); }
.node-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.status { display: inline-block; font-size: 0.8125rem; font-weight: 500; color: var(--white); border: 1px solid var(--line); padding: 0.2rem 0.6rem; border-radius: 2px; margin-bottom: 1.25rem; }
.node-figure { margin: 0; position: relative; }
.node-figure img { width: 100%; border: 1px solid var(--graphite); }
.node-figure figcaption, .video-block figcaption { font-size: 0.8125rem; color: var(--ash); margin-top: 0.75rem; }
@media (max-width: 860px) { .node-grid { grid-template-columns: 1fr; } .node-figure { order: -1; } }

.video-block { margin: clamp(3rem, 7vw, 5rem) 0 0; }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: var(--charcoal); border: 1px solid var(--graphite); overflow: hidden; }
.video-frame img, .video-frame video { width: 100%; height: 100%; object-fit: cover; }

.video-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 0.75rem; background: rgba(0,0,0,0.7); color: var(--white); border: 1px solid rgba(255,255,255,0.5); border-radius: 2px; padding: 0.9rem 1.4rem; font: 500 1rem var(--font); cursor: pointer; transition: background-color 0.15s, border-color 0.15s; }
.video-play svg { width: 1.5rem; height: 1.5rem; }
.video-play:hover { background: #000; border-color: var(--white); }

/* 3. Connectivity */
.connectivity { background: var(--charcoal); }
.arch { margin: clamp(2.5rem, 6vw, 4rem) 0 0; }
.arch-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) 4.5rem minmax(0, 1fr) 4.5rem minmax(0, 1.25fr) 4.5rem minmax(0, 1fr); align-items: stretch; }
.arch-col { border: 1px solid var(--line); padding: 1.25rem; background: var(--black); display: flex; flex-direction: column; }
.arch-col h3 { font-size: 1rem; margin-bottom: 0.6rem; }
.arch-col p, .arch-col li { font-size: 0.875rem; color: var(--ash); margin: 0; }
.arch-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.arch-col ul li::before { content: ""; display: inline-block; width: 6px; height: 6px; border: 1px solid var(--ash); margin-right: 0.6rem; vertical-align: 0.1em; }
.arch-net { background: transparent; border-style: dashed; }
.arch-node { border: 2px solid var(--white); background: #000; box-shadow: 0 0 0 6px rgba(255,255,255,0.06); }
.arch-node h3 { font-size: 1.125rem; }
.arch-peers { margin-top: auto; padding-top: 1rem; border-top: 1px dashed var(--line); display: flex; align-items: center; gap: 0.75rem; }
.arch-peers p { font-size: 0.8125rem; }
.arch-link { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 0.5rem; padding-inline: 0.35rem; }
.arch-link em { font-style: normal; font-size: 0.75rem; color: var(--ash); text-align: center; line-height: 1.25; }
.arch-link-out em { color: var(--white); }

.flow { display: block; width: 100%; height: 2px; position: relative; background-image: linear-gradient(90deg, var(--ash) 50%, transparent 50%); background-size: 8px 2px; }
.flow::after { content: ""; position: absolute; right: -1px; top: 50%; width: 7px; height: 7px; border-top: 2px solid var(--ash); border-right: 2px solid var(--ash); transform: translateY(-50%) rotate(45deg); }
.flow-out { background-image: linear-gradient(90deg, var(--white) 60%, transparent 60%); height: 2px; }
.flow-out::after { border-color: var(--white); }
.flow-peer { width: 2.25rem; flex: none; background-image: linear-gradient(90deg, var(--ash) 50%, transparent 50%); }
.flow-peer::before { content: ""; position: absolute; left: -1px; top: 50%; width: 7px; height: 7px; border-bottom: 2px solid var(--ash); border-left: 2px solid var(--ash); transform: translateY(-50%) rotate(45deg); }
@media (prefers-reduced-motion: no-preference) {
  .flow-in, .flow-out { animation: travel 1.1s linear infinite; }
  @keyframes travel { from { background-position: 0 0; } to { background-position: 16px 0; } }
  @keyframes travel-y { from { background-position: 0 0; } to { background-position: 0 16px; } }
}

@media (max-width: 960px) {
  .arch-flow { grid-template-columns: 1fr; max-width: 28rem; }
  .arch-link { flex-direction: row; justify-content: flex-start; padding: 0.5rem 0 0.5rem 1.5rem; min-height: 3.5rem; }
  .arch-link em { text-align: left; }
  .arch-link .flow { width: 2px; height: 2.5rem; flex: none; background-image: linear-gradient(180deg, var(--ash) 50%, transparent 50%); background-size: 2px 8px; }
  .arch-link .flow-out { background-image: linear-gradient(180deg, var(--white) 60%, transparent 60%); }
  .arch-link .flow::after { right: auto; left: 50%; top: auto; bottom: -1px; transform: translateX(-50%) rotate(135deg); }
  .arch-link .flow-in, .arch-link .flow-out { animation-name: travel-y; }
}

.arch figcaption { font-size: 0.875rem; color: var(--ash); margin-top: 1.5rem; max-width: 44rem; }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: clamp(2.5rem, 5vw, 3.5rem); border-top: 1px solid var(--line); }
.facts p { font-size: 0.9375rem; color: var(--ash); padding: 1.25rem 1.5rem 0 0; margin: 0; }
.facts p + p { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.facts strong { display: block; margin-bottom: 0.3rem; }
@media (max-width: 760px) {
  .facts { grid-template-columns: 1fr; }
  .facts p, .facts p + p { padding: 1rem 0; border-left: 0; border-bottom: 1px solid var(--graphite); }
}

.details { margin-top: 2.5rem; border: 1px solid var(--line); max-width: 44rem; }
.details summary { cursor: pointer; padding: 1rem 1.25rem; font-weight: 500; color: var(--white); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.details summary::-webkit-details-marker { display: none; }
.details summary::after { content: "+"; font-weight: 300; font-size: 1.5rem; line-height: 1; }
.details[open] summary::after { content: "−"; }
.details-body { padding: 0 1.25rem 1.25rem; }
.details-body ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.6rem; }
.details-body li { font-size: 0.9375rem; color: var(--ash); }

/* 4. Inside the node — a real sequence, so numbered */
.inside { background: var(--black); }
.steps { list-style: none; counter-reset: step; margin: clamp(2rem, 5vw, 3rem) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--white); }
.steps li { counter-increment: step; padding: 1.5rem 1.5rem 0 0; position: relative; }
.steps li + li { padding-left: 1.5rem; border-left: 1px solid var(--graphite); }
.steps li::before { content: counter(step); display: block; font-size: clamp(2.5rem, 5vw, 3.75rem); font-weight: 300; line-height: 1; color: var(--graphite); margin-bottom: 1rem; letter-spacing: -0.03em; }
.steps h3 { font-size: 1.375rem; font-weight: 500; margin-bottom: 0.5rem; }
.steps p { font-size: 0.9375rem; color: var(--ash); margin: 0; }
.benefit { margin-top: clamp(2.5rem, 5vw, 3.5rem); font-size: clamp(1.125rem, 2vw, 1.375rem); color: var(--white); font-weight: 300; }
@media (max-width: 860px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps li:nth-child(3) { padding-left: 0; border-left: 0; }
  .steps li:nth-child(n+3) { margin-top: 2rem; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
  .steps li:nth-child(n) { padding: 1.25rem 0; border-left: 0; margin: 0; border-bottom: 1px solid var(--graphite); }
  .steps li::before { font-size: 2.25rem; margin-bottom: 0.5rem; }
}

/* 5. Distributed */
.distributed { background: var(--charcoal); }
.maturity { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-top: 2.5rem; }
.maturity-col { border: 1px solid var(--line); padding: 1.5rem; background: var(--black); }
.maturity-dev { border-style: dashed; background: transparent; }
.maturity-col h3 { margin-bottom: 0.9rem; }
.maturity-col ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.45rem; }
.maturity-col li { font-size: 0.9375rem; color: var(--ash); }
@media (max-width: 720px) { .maturity { grid-template-columns: 1fr; } }
.principle { margin: clamp(2.5rem, 5vw, 3.5rem) 0 0; padding: 0 0 0 1.5rem; border-left: 2px solid var(--white); }
.principle p { font-size: clamp(1.25rem, 2.4vw, 1.75rem); font-weight: 300; line-height: 1.3; color: var(--white); margin: 0; max-width: 36rem; }

/* 6. Applications */
.applications { background: var(--black); }
.apps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 4rem); margin-top: 2.5rem; }
.apps-group { border-top: 1px solid var(--white); padding-top: 1.25rem; }
.apps-group h3 { font-size: 1.375rem; margin-bottom: 1rem; }
.apps-group ul { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.apps-group li { padding: 0.7rem 0; border-bottom: 1px solid var(--charcoal); color: var(--smoke); }
.text-link { font-weight: 400; }
@media (max-width: 720px) { .apps { grid-template-columns: 1fr; } }

/* 7. Contact */
.contact { position: relative; overflow: hidden; background: var(--black); padding-block: clamp(6rem, 14vw, 10rem); border-top: 1px solid var(--graphite); }
.smoke-contact { opacity: 0.18; }
.contact-inner { position: relative; }
.contact h2 { font-size: clamp(2.25rem, 6vw, 4.5rem); line-height: 1.02; letter-spacing: -0.03em; max-width: 52rem; }
.contact p { font-size: 1.125rem; margin-bottom: 2rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--graphite); padding-block: 2rem calc(2rem + env(safe-area-inset-bottom, 0px)); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 0.5rem 2.5rem; }
.footer-inner p { margin: 0; font-size: 0.875rem; color: var(--ash); }
.footer-inner a { color: var(--smoke); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.video-error { position: absolute; left: 1rem; right: 1rem; bottom: 1rem; margin: 0; padding: 0.75rem 1rem; background: #000; border: 1px solid var(--line); color: var(--white); font-size: 0.9375rem; }
.video-play span { white-space: nowrap; }
@media (max-width: 520px) { .video-play { padding: 0.65rem 1rem; font-size: 0.9375rem; } .video-play svg { width: 1.2rem; height: 1.2rem; } }
