/* ==========================================================================
   AlgorizmCore — design tokens
   ========================================================================== */
:root {
  /* Brand palette */
  --c-black: #0B0D10;
  --c-graphite: #171A20;
  --c-graphite-deep: #11141A;
  --c-cyan: #27D3E6;
  --c-violet: #7657FF;
  --c-white: #F5F7FA;

  /* Neutrals derived from Off White over Core Black */
  --t-1: var(--c-white);
  --t-2: rgba(245, 247, 250, .68);
  --t-3: rgba(245, 247, 250, .44);
  --line: rgba(245, 247, 250, .09);
  --line-2: rgba(245, 247, 250, .18);
  --line-3: rgba(245, 247, 250, .34);

  /* Type */
  --f-head: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --f-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --fs-xs: .8125rem;
  --fs-sm: .9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: clamp(1.5rem, 1.15rem + 1.2vw, 2rem);
  --fs-2xl: clamp(2rem, 1.4rem + 2.2vw, 3.25rem);
  --fs-3xl: clamp(2.75rem, 1.6rem + 5vw, 5.75rem);

  /* Space */
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem; --s-7: 3rem; --s-8: 4rem; --s-9: 6rem; --s-10: 8rem;
  --section: clamp(5rem, 4rem + 5vw, 9rem);
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --container: 1200px;

  --r-sm: 4px; --r-md: 8px; --r-lg: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur: .35s;
  --nav-h: 72px;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--c-black);
  color: var(--t-1);
  font: 400 var(--fs-md)/1.65 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--f-head); font-weight: 600; line-height: 1.08; letter-spacing: -.015em; }
p { max-width: 62ch; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible { outline: 2px solid var(--c-cyan); outline-offset: 3px; border-radius: 2px; }
.skip-link {
  position: absolute; left: var(--s-4); top: -100px; z-index: 100;
  background: var(--c-white); color: var(--c-black); padding: var(--s-3) var(--s-4);
  font-family: var(--f-head); font-weight: 600; border-radius: var(--r-sm);
}
.skip-link:focus { top: var(--s-4); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: min(var(--container), 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { padding-block: var(--section); }
.section--alt { background: var(--c-graphite-deep); }
.section__head { max-width: 52rem; margin-bottom: clamp(2.5rem, 2rem + 3vw, 4.5rem); }
.section__head h2 { font-size: var(--fs-2xl); margin-bottom: var(--s-4); }
.section__head .lead { color: var(--t-2); font-size: var(--fs-lg); line-height: 1.5; }
.kicker { font-family: var(--f-head); font-size: var(--fs-sm); color: var(--c-cyan); margin-bottom: var(--s-4); display: inline-flex; align-items: center; gap: var(--s-3); }
.kicker::before { content: ""; width: 20px; height: 1px; background: currentColor; }
.muted { color: var(--t-2); }

/* ==========================================================================
   Logo
   ========================================================================== */
.logo { display: inline-flex; align-items: center; gap: var(--s-3); }
.logo__mark { width: 28px; height: 28px; color: var(--t-1); }
.logo__mark circle { transform-origin: 50px 68px; }
.logo__word { font-family: var(--f-head); font-weight: 700; font-size: .9375rem; letter-spacing: .08em; }
@media (prefers-reduced-motion: no-preference) {
  .logo:hover .logo__mark circle { animation: core-pulse 1.4s var(--ease); }
  @keyframes core-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
}

/* ==========================================================================
   Buttons & links
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  font-family: var(--f-head); font-weight: 600; font-size: var(--fs-sm); letter-spacing: .01em;
  padding: .875rem 1.375rem; border-radius: var(--r-sm); border: 1px solid transparent;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  will-change: transform;
}
.btn--primary { background: var(--c-white); color: var(--c-black); }
.btn--primary:hover { background: #fff; }
.btn--ghost { border-color: var(--line-2); color: var(--t-1); }
.btn--ghost:hover { border-color: var(--line-3); }
.btn--sm { padding: .625rem 1rem; }
.link { color: var(--t-1); border-bottom: 1px solid var(--line-2); transition: border-color var(--dur); }
.link:hover { border-color: var(--c-cyan); }
.link--accent { color: var(--c-cyan); border-bottom-color: transparent; }
.link--accent:hover { border-bottom-color: var(--c-cyan); }

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  background: rgba(11, 13, 16, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color var(--dur);
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--s-6); }
.nav__links { display: flex; gap: var(--s-6); }
.nav__links a { font-family: var(--f-head); font-size: var(--fs-sm); color: var(--t-2); padding: var(--s-2) 0; position: relative; transition: color var(--dur); }
.nav__links a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px; background: var(--c-cyan); transition: right var(--dur) var(--ease); }
.nav__links a:hover, .nav__links a[aria-current="true"] { color: var(--t-1); }
.nav__links a:hover::after, .nav__links a[aria-current="true"]::after { right: 0; }
.nav__cta { display: inline-flex; }
.nav__toggle { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: var(--r-sm); }
.nav__toggle span { position: relative; width: 22px; height: 2px; background: var(--t-1); transition: transform var(--dur) var(--ease), background var(--dur); }
.nav__toggle span::before, .nav__toggle span::after { content: ""; position: absolute; left: 0; width: 22px; height: 2px; background: var(--t-1); transition: transform var(--dur) var(--ease); }
.nav__toggle span::before { top: -7px; } .nav__toggle span::after { top: 7px; }
.nav__toggle[aria-expanded="true"] span { background: transparent; }
.nav__toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

.nav__menu { display: contents; }
@media (max-width: 900px) {
  .nav__toggle { display: inline-flex; }
  .nav__menu {
    display: flex; flex-direction: column; justify-content: space-between;
    position: fixed; top: var(--nav-h); left: 0; right: 0; height: calc(100dvh - var(--nav-h)); background: var(--c-black); overflow-y: auto;
    padding: var(--s-7) var(--gutter) var(--s-8);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s var(--dur);
  }
  .nav__menu.is-open { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
  .nav__links { flex-direction: column; gap: 0; }
  .nav__links a { display: block; font-size: 2rem; font-weight: 500; padding: var(--s-3) 0; border-bottom: 1px solid var(--line); color: var(--t-1); }
  .nav__links a::after { display: none; }
  .nav__cta { width: 100%; padding: 1.125rem; font-size: var(--fs-md); }
  body.menu-open { overflow: hidden; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { position: relative; min-height: calc(100svh - var(--nav-h)); display: grid; align-items: center; overflow: hidden; }
.hero__visual { position: absolute; inset: 0; z-index: 0; }
.hero__visual canvas { width: 100%; height: 100%; display: block; }
.hero__visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--c-black) 0%, rgba(11, 13, 16, .85) 32%, rgba(11, 13, 16, .2) 62%, rgba(11, 13, 16, 0) 100%); pointer-events: none; }
.hero__inner { position: relative; z-index: 1; padding-block: var(--s-10) var(--s-9); }
.hero__eyebrow { font-family: var(--f-head); font-size: var(--fs-xs); letter-spacing: .12em; color: var(--t-3); margin-bottom: var(--s-6); }
.hero__eyebrow span + span::before { content: "•"; margin-inline: .75em; color: var(--c-cyan); }
.hero h1 { font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -.03em; max-width: 12ch; }
.hero__copy { font-size: var(--fs-lg); color: var(--t-2); margin-top: var(--s-6); max-width: 34rem; line-height: 1.5; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-7); }
.hero__foot { display: flex; gap: var(--s-6); margin-top: var(--s-9); font-family: var(--f-head); font-size: var(--fs-sm); color: var(--t-3); }
@media (max-width: 900px) {
  .hero { min-height: auto; }
  .hero__visual::after { background: linear-gradient(180deg, rgba(11,13,16,.3) 0%, rgba(11,13,16,.85) 55%, var(--c-black) 100%); }
  .hero__inner { padding-block: var(--s-9) var(--s-8); }
  .hero__foot { display: none; }
}
@media (max-width: 480px) {
  .hero__actions .btn { flex: 1 1 100%; }
  .hero__inner { padding-block: var(--s-8) var(--s-7); }
}

/* ==========================================================================
   Statement strip
   ========================================================================== */
.statement { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--c-graphite-deep); }
.statement__inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--s-8); padding-block: var(--s-8); align-items: center; }
.statement h2 { font-size: var(--fs-xl); font-weight: 500; line-height: 1.25; }
.statement p { color: var(--t-2); }
@media (max-width: 900px) { .statement__inner { grid-template-columns: 1fr; gap: var(--s-5); padding-block: var(--s-7); } }

/* ==========================================================================
   Capabilities
   ========================================================================== */
.caps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.cap { background: var(--c-black); padding: clamp(1.5rem, 1rem + 2vw, 2.75rem); display: grid; grid-template-rows: auto auto 1fr auto; gap: var(--s-4); position: relative; transition: background var(--dur); }
.cap:hover, .cap:focus-within { background: var(--c-graphite-deep); }
.cap__figure { height: 120px; margin-bottom: var(--s-2); color: var(--t-3); transition: color var(--dur); }
.cap:hover .cap__figure { color: var(--c-cyan); }
.cap__figure svg { height: 100%; width: auto; }
.cap h3 { font-size: var(--fs-xl); }
.cap__summary { color: var(--t-1); font-size: var(--fs-md); }
.cap__detail { color: var(--t-2); font-size: var(--fs-sm); }
.cap__items { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.cap__items li { font-family: var(--f-head); font-size: var(--fs-xs); color: var(--t-2); border: 1px solid var(--line-2); border-radius: 999px; padding: .3rem .7rem; }
@media (prefers-reduced-motion: no-preference) {
  .cap__figure .move { transition: transform .6s var(--ease); }
  .cap:hover .cap__figure .move { transform: var(--figure-shift, translate(0, -4px)); }
}
@media (max-width: 720px) { .caps { grid-template-columns: 1fr; } .cap__figure { height: 88px; } }

/* ==========================================================================
   Intelligence
   ========================================================================== */
.intel { position: relative; overflow: hidden; }
.intel::before { content: ""; position: absolute; right: -20%; top: -30%; width: 60vw; height: 60vw; max-width: 900px; max-height: 900px; border-radius: 50%; background: radial-gradient(closest-side, rgba(118, 87, 255, .16), rgba(39, 211, 230, .05) 55%, transparent 72%); pointer-events: none; }
.intel__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-8); align-items: start; position: relative; }
.intel__list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.intel__item { display: grid; grid-template-columns: 200px 1fr; gap: var(--s-5); padding: var(--s-5) 0; border-bottom: 1px solid var(--line); }
.intel__item h3 { font-size: var(--fs-md); font-weight: 500; }
.intel__item p { color: var(--t-2); font-size: var(--fs-sm); }
.intel__note { margin-top: var(--s-5); font-size: var(--fs-sm); color: var(--t-3); }
@media (max-width: 900px) { .intel__grid { grid-template-columns: 1fr; gap: var(--s-6); } }
@media (max-width: 560px) { .intel__item { grid-template-columns: 1fr; gap: var(--s-2); } }

/* ==========================================================================
   Principles
   ========================================================================== */
.principles { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s-5); counter-reset: p; }
.principle { border-top: 1px solid var(--line-2); padding-top: var(--s-5); counter-increment: p; }
.principle::before { content: "0" counter(p); font-family: var(--f-head); font-size: var(--fs-xs); color: var(--c-cyan); display: block; margin-bottom: var(--s-5); }
.principle h3 { font-size: var(--fs-lg); margin-bottom: var(--s-3); }
.principle p { color: var(--t-2); font-size: var(--fs-sm); }
@media (max-width: 1100px) { .principles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .principles { grid-template-columns: 1fr; gap: var(--s-4); } .principle::before { margin-bottom: var(--s-3); } }

/* ==========================================================================
   Process
   ========================================================================== */
.process { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s-5); counter-reset: step; }
.process::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 1px; background: var(--line-2); }
.step { position: relative; padding-top: var(--s-6); counter-increment: step; }
.step::before { content: ""; position: absolute; top: 6px; left: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--c-black); border: 2px solid var(--line-3); transition: background var(--dur), border-color var(--dur); }
.step:hover::before, .step.is-active::before { background: var(--c-cyan); border-color: var(--c-cyan); }
.step__num { font-family: var(--f-head); font-size: var(--fs-xs); color: var(--t-3); }
.step h3 { font-size: var(--fs-lg); margin: var(--s-2) 0 var(--s-3); }
.step p { color: var(--t-2); font-size: var(--fs-sm); }
@media (max-width: 900px) {
  .process { grid-template-columns: 1fr; gap: 0; }
  .process::before { top: 0; bottom: 0; left: 5px; right: auto; width: 1px; height: auto; }
  .step { padding: 0 0 var(--s-6) var(--s-6); }
  .step::before { left: 0; top: 4px; }
  .step:last-child { padding-bottom: 0; }
}

/* ==========================================================================
   Technology
   ========================================================================== */
.tech { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); }
.tech__area { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-5); background: var(--c-graphite-deep); }
.tech__area h3 { font-size: var(--fs-md); font-weight: 500; margin-bottom: var(--s-3); display: flex; align-items: center; gap: var(--s-3); }
.tech__area h3::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c-cyan); }
.tech__area li { color: var(--t-2); font-size: var(--fs-sm); padding: .2rem 0; }
@media (max-width: 900px) { .tech { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .tech { grid-template-columns: 1fr; } }

/* ==========================================================================
   Work
   ========================================================================== */
.work { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-5); }
.project { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-6); background: var(--c-graphite-deep); display: grid; gap: var(--s-4); transition: border-color var(--dur), transform var(--dur) var(--ease); }
.project:hover { border-color: var(--line-2); transform: translateY(-3px); }
.project__sector { font-family: var(--f-head); font-size: var(--fs-xs); color: var(--c-cyan); }
.project h3 { font-size: var(--fs-xl); }
.project dl { display: grid; grid-template-columns: 110px 1fr; gap: var(--s-2) var(--s-4); font-size: var(--fs-sm); }
.project dt { color: var(--t-3); font-family: var(--f-head); } .project dd { color: var(--t-2); }
.work-empty { border: 1px dashed var(--line-2); border-radius: var(--r-md); padding: clamp(2rem, 1rem + 4vw, 4rem); display: grid; grid-template-columns: 1fr auto; gap: var(--s-6); align-items: center; }
.work-empty h3 { font-size: var(--fs-xl); font-weight: 500; margin-bottom: var(--s-3); }
.work-empty p { color: var(--t-2); }
@media (max-width: 900px) { .work, .work-empty { grid-template-columns: 1fr; } }

/* ==========================================================================
   About
   ========================================================================== */
.about__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-9); align-items: center; }
.about__copy p + p { margin-top: var(--s-4); }
.about__copy p { color: var(--t-2); font-size: var(--fs-md); }
.about__copy p:first-child { color: var(--t-1); font-size: var(--fs-lg); }
.about__figure { aspect-ratio: 1; border: 1px solid var(--line); border-radius: var(--r-md); display: grid; place-items: center; background:
  radial-gradient(circle at 50% 62%, rgba(39,211,230,.10), transparent 40%),
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23F5F7FA' stroke-opacity='.07' stroke-width='2'%3E%3Cpath d='M30 62l18-38M66 62l-18-38'/%3E%3Ccircle cx='48' cy='52' r='3' fill='%23F5F7FA' fill-opacity='.1' stroke='none'/%3E%3C/g%3E%3C/svg%3E"); }
.about__figure svg { width: 42%; color: var(--t-1); }
@media (max-width: 900px) { .about__grid { grid-template-columns: 1fr; gap: var(--s-6); } .about__figure { max-width: 320px; } }

/* ==========================================================================
   Insights (placeholder until posts exist)
   ========================================================================== */
.insights { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-6); display: grid; grid-template-columns: 1fr auto; gap: var(--s-6); align-items: center; background: var(--c-graphite-deep); }
.insights h3 { font-size: var(--fs-lg); font-weight: 500; margin-bottom: var(--s-2); }
.insights p { color: var(--t-2); font-size: var(--fs-sm); }
@media (max-width: 720px) { .insights { grid-template-columns: 1fr; } }

/* ==========================================================================
   CTA
   ========================================================================== */
.cta { position: relative; overflow: hidden; border-top: 1px solid var(--line); }
.cta::before { content: ""; position: absolute; left: 50%; bottom: -40%; transform: translateX(-50%); width: 80vw; height: 60vw; max-width: 1100px; max-height: 700px; border-radius: 50%; background: radial-gradient(closest-side, rgba(39, 211, 230, .12), rgba(118, 87, 255, .08) 50%, transparent 72%); pointer-events: none; }
.cta__inner { position: relative; text-align: center; max-width: 46rem; margin-inline: auto; }
.cta h2 { font-size: var(--fs-2xl); margin-bottom: var(--s-5); }
.cta p { color: var(--t-2); font-size: var(--fs-lg); margin-inline: auto; line-height: 1.5; }
.cta__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--s-4); margin-top: var(--s-7); align-items: center; }
.cta__mail { font-family: var(--f-head); font-size: var(--fs-md); color: var(--t-1); border-bottom: 1px solid var(--line-2); padding: .6rem 0; }
.cta__mail:hover { border-color: var(--c-cyan); }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { border-top: 1px solid var(--line); background: var(--c-graphite-deep); padding-block: var(--s-8) var(--s-6); }
.footer__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--s-7); }
.footer__brand .logo { margin-bottom: var(--s-4); }
.footer__brand p { color: var(--t-2); font-size: var(--fs-sm); font-family: var(--f-head); }
.footer h3 { font-family: var(--f-head); font-size: var(--fs-xs); letter-spacing: .06em; color: var(--t-3); margin-bottom: var(--s-4); font-weight: 500; }
.footer li { padding: .25rem 0; font-size: var(--fs-sm); color: var(--t-2); }
.footer li a:hover { color: var(--t-1); }
.footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--t-3); font-family: var(--f-head); }
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer__grid { grid-template-columns: 1fr; gap: var(--s-6); } }

/* ==========================================================================
   Scroll reveal
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
  [data-reveal].is-visible { opacity: 1; transform: none; }
  [data-reveal-group] > * { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
  [data-reveal-group].is-visible > * { opacity: 1; transform: none; }
  [data-reveal-group].is-visible > :nth-child(2) { transition-delay: .06s; }
  [data-reveal-group].is-visible > :nth-child(3) { transition-delay: .12s; }
  [data-reveal-group].is-visible > :nth-child(4) { transition-delay: .18s; }
  [data-reveal-group].is-visible > :nth-child(5) { transition-delay: .24s; }
  [data-reveal-group].is-visible > :nth-child(6) { transition-delay: .30s; }
  .btn:hover { transform: translateY(-1px); }
}
