/* PluriSI site styles (polish v2). Colors and type from assets/PluriSI-Web-Content.pdf.
   CSS only: the CSP allows no scripts. All motion is inside
   @media screen and (prefers-reduced-motion: no-preference), so with reduced motion
   or in print the page is static in its final state. */

@font-face {
  font-family: "SUSE";
  src: url("../fonts/suse-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans";
  src: url("../fonts/noto-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Colors */
  --navy: #1b1c4b;
  --indigo: #34368f;
  --teal: #20c4be;
  --white: #fff;
  --muted: #c9cbe6;
  --card-bg: rgba(27, 28, 75, 0.92);
  --edge: rgba(32, 196, 190, 0.18);

  /* Type */
  --font-title: "SUSE", system-ui, sans-serif;
  --font-label: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Noto Sans", system-ui, sans-serif;
  --text-body: 17px;
  --leading-body: 1.7;
  --leading-title: 1.05;
  --text-h1: clamp(44px, 6.5vw, 84px);
  --text-h2: clamp(28px, 3vw, 36px);
  --text-small: 13px;
  --text-tiny: 12px;
  --tracking-caps: 0.3em;

  /* Layout and spacing (8px base) */
  --col: 1120px;
  --side: clamp(20px, 5vw, 72px);
  --card-gap: 56px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-9: 72px;
  --space-12: 96px;
  --header-h: 81px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--navy);
  scroll-padding-top: calc(var(--header-h) + var(--space-2));
}

/* No body background: it would paint over the fixed backdrop (z-index -1). The navy is on html. */
body {
  margin: 0;
  min-height: 100vh;
  color: var(--white);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

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

a {
  color: var(--teal);
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 4px;
}

.wrap,
.stack {
  width: 100%;
  max-width: calc(var(--col) + 2 * var(--side));
  margin: 0 auto;
  padding: 0 var(--side);
}

/* ---------- Fixed backdrop: soft glows, then a faint grid ---------- */

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
}

/* Glows: softness comes from the gradient falloff, not filter: blur(). */
body::before {
  inset: -15%;
  background:
    radial-gradient(circle at 22% 18%, rgba(52, 54, 143, 0.4) 0%, rgba(52, 54, 143, 0.16) 28%, transparent 55%),
    radial-gradient(circle at 82% 70%, rgba(52, 54, 143, 0.38) 0%, rgba(52, 54, 143, 0.14) 30%, transparent 58%),
    radial-gradient(circle at 62% 24%, rgba(32, 196, 190, 0.1) 0%, rgba(32, 196, 190, 0.04) 26%, transparent 50%);
}

/* Grid: 1px lines every 56px, faded toward the edges. One step taller than the viewport so it can loop. */
body::after {
  inset: -56px 0 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 65% at 50% 40%, #000 0%, rgba(0, 0, 0, 0.5) 45%, transparent 85%);
  mask-image: radial-gradient(ellipse 70% 65% at 50% 40%, #000 0%, rgba(0, 0, 0, 0.5) 45%, transparent 85%);
}

/* ---------- Skip link ---------- */

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--teal);
  color: var(--navy);
  text-decoration: none;
}

.skip:focus {
  top: 16px;
}

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

/* Solid state. With scroll-driven animations it starts transparent over the hero (see Motion). */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  background-color: rgba(27, 28, 75, 0.93);
  border-bottom: 1px solid var(--edge);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  font-family: var(--font-label);
  font-size: var(--text-small);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
}

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

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: clamp(720px, 80vh, 760px);
  margin-top: calc(-1 * var(--header-h));
  padding: calc(var(--header-h) + var(--space-6)) 0 var(--space-8);
  text-align: center;
}

.hero-inner {
  position: relative;
}

/* Soft navy darkening behind the text block, for contrast against the backdrop. */
.hero-inner::before {
  content: "";
  position: absolute;
  inset: -12% -8%;
  z-index: -1;
  background: radial-gradient(ellipse closest-side, rgba(27, 28, 75, 0.6), rgba(27, 28, 75, 0.35) 55%, transparent);
}

.hero-logo {
  position: relative;
  width: 168px;
  margin: 0 auto var(--space-4);
}

/* Teal glow behind the logo */
.hero-logo::before {
  content: "";
  position: absolute;
  inset: -35%;
  z-index: -1;
  background: radial-gradient(circle closest-side, rgba(32, 196, 190, 0.32), rgba(32, 196, 190, 0.08) 55%, transparent);
  opacity: 0.45;
}

.hero-logo img {
  width: 168px;
  height: 168px;
}

h1 {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: var(--text-h1);
  line-height: var(--leading-title);
}

.rule {
  width: 56px;
  height: 1px;
  margin: var(--space-4) auto;
  background: var(--teal);
}

.tagline {
  font-size: clamp(19px, 2vw, 22px);
  line-height: 1.5;
}

.si-note {
  margin-top: var(--space-2);
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Section cards ---------- */

.stack {
  display: grid;
  gap: var(--card-gap);
  padding-bottom: var(--space-12);
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--edge);
  padding: var(--space-8) var(--space-9);
}

.card h2,
.card h1 {
  margin-bottom: var(--space-6);
  font-family: var(--font-title);
  font-weight: 400;
  font-size: var(--text-h2);
  line-height: var(--leading-title);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  max-width: 62ch;
  margin-bottom: var(--space-6);
  font-size: clamp(19px, 1.8vw, 21px);
  line-height: 1.55;
}

.problem .lead {
  font-size: clamp(24px, 2.4vw, 28px);
  line-height: 1.4;
}

.card h3 {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Numerals 01, 02... drawn with counters, so they are not page text. Screen readers skip them. */
.items,
.tiles {
  counter-reset: item;
}

.numbered {
  counter-increment: item;
}

.numbered::before {
  content: counter(item, decimal-leading-zero);
  content: counter(item, decimal-leading-zero) / "";
  display: block;
  margin-bottom: var(--space-2);
  color: var(--teal);
  font-family: var(--font-label);
  font-size: var(--text-tiny);
  letter-spacing: var(--tracking-caps);
}

/* The problem: two lists with teal dash markers and a hairline between them */
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.col {
  padding-right: var(--space-6);
}

.col + .col {
  padding: 0 0 0 var(--space-6);
  border-left: 1px solid rgba(32, 196, 190, 0.45);
}

.dash {
  list-style: none;
  padding: 0;
  margin-top: var(--space-3);
}

.dash li {
  position: relative;
  padding-left: var(--space-4);
}

.dash li + li {
  margin-top: var(--space-2);
}

.dash li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 16px;
  height: 2px;
  background: var(--teal);
}

/* The idea: auto-fit grid with numbered items */
.idea {
  container-type: inline-size;
}

.items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6) var(--space-9);
}

.item {
  position: relative;
}

.item p + p {
  margin-top: var(--space-2);
}

.card .label {
  margin-bottom: var(--space-2);
  color: var(--teal);
  font-family: var(--font-label);
  font-size: var(--text-small);
  letter-spacing: var(--tracking-caps);
}

/* Two columns (300 + 72 + 300): full-height hairline centered in the gap, columns top-aligned */
@container (min-width: 672px) {
  .item + .item::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(-1 * var(--space-9) / 2);
    width: 1px;
    background: rgba(32, 196, 190, 0.45);
  }
}

/* Designed for trust: tiles alternate teal / indigo in reading order */
.tiles {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.tile {
  padding: var(--space-4) var(--space-4) var(--space-5);
}

.tile h3 {
  margin-bottom: var(--space-1);
}

/* Navy on teal: 7.4:1. Flat teal, nothing over the text. */
.tile:nth-child(odd) {
  background: var(--teal);
  color: var(--navy);
}

.tile:nth-child(odd)::before {
  color: var(--navy);
}

.tile:nth-child(even) {
  background: var(--indigo);
  color: var(--white);
}

/* Contact: closing card, centered */
.contact,
.notfound {
  text-align: center;
}

.contact .rule {
  margin-top: 0;
}

.contact-link {
  display: inline-block;
  color: var(--white);
  font-size: var(--text-small);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 8px;
}

/* Email links keep their written case. Uppercase would display "ADMIN@PLURISI.AI": a capital
   "AI" in PluriSI's own voice, which the brand rules don't allow (Nate, PR #9 review).
   Don't change this back to uppercase. "Back to home" on the 404 page stays uppercase. */
.contact-link[href^="mailto:"] {
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: none;
}

/* ---------- Content pages: Privacy and 404 ---------- */

.page {
  min-height: calc(100vh - var(--header-h) - 160px);
  padding-top: var(--space-6);
}

.prose p {
  max-width: 62ch;
}

.prose p + p {
  margin-top: var(--space-2);
}

.prose .updated {
  margin-top: var(--space-4);
  color: var(--muted);
  font-size: 15px;
}

.notfound h1 {
  margin-bottom: 0;
}

/* ---------- Footer: three-column strip ---------- */

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-4);
  padding-top: var(--space-5);
  padding-bottom: var(--space-8);
  border-top: 1px solid var(--edge);
  color: var(--muted);
  font-size: 14px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand img {
  width: 28px;
  height: 28px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.site-footer a {
  color: var(--muted);
  font-size: var(--text-tiny);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
}

/* The footer email keeps its written case, for the same reason as the contact link:
   never display plurisi.ai in capitals. "Privacy" stays uppercase. */
.site-footer a[href^="mailto:"] {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: none;
}

.copyright {
  font-size: 13px;
}

/* ---------- Hover (pointer devices only) ---------- */

@media (hover: hover) {
  .site-footer a:hover {
    color: var(--teal);
  }

  .contact-link:hover {
    text-decoration-color: var(--white);
    text-decoration-thickness: 2px;
  }

  .tile:hover {
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 820px) {
  :root {
    --header-h: 64px;
    --card-gap: 32px;
  }

  .hero {
    min-height: 520px;
  }

  .hero-logo,
  .hero-logo img {
    width: 128px;
    height: 128px;
  }

  .card {
    padding: 36px 24px;
  }

  .columns,
  .tiles {
    grid-template-columns: 1fr;
  }

  .col {
    padding: 0;
  }

  .col + .col {
    margin-top: var(--space-4);
    padding: var(--space-4) 0 0;
    border-left: 0;
    border-top: 1px solid rgba(32, 196, 190, 0.45);
  }

  .tile {
    padding: var(--space-3) var(--space-3) var(--space-4);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
}

/* ---------- Motion ---------- */

@media screen and (prefers-reduced-motion: no-preference) {
  /* Backdrop: slow drift, noticeable only if you look */
  body::before {
    animation: glow-drift 60s ease-in-out infinite alternate;
  }

  body::after {
    animation: grid-drift 60s linear infinite;
  }

  /* Hero, once on load */
  .hero-logo img {
    animation: logo-in 1200ms var(--ease) both;
  }

  .hero h1,
  .hero .tagline,
  .hero .si-note {
    animation: fade-up 700ms var(--ease) both;
  }

  .hero .rule {
    animation: rule-grow 700ms var(--ease) both;
  }

  .hero h1 {
    animation-delay: 360ms;
  }

  .hero .rule {
    animation-delay: 480ms;
  }

  .hero .tagline {
    animation-delay: 600ms;
  }

  .hero .si-note {
    animation-delay: 720ms;
  }

  /* Logo glow breathes */
  .hero-logo::before {
    animation: breathe 8s ease-in-out infinite alternate;
  }

  /* Header: transparent over the hero, solid within the first 120px of scrolling */
  @supports (animation-timeline: scroll()) {
    .site-header {
      animation: header-solid linear both;
      animation-timeline: scroll(root);
      animation-range: 0 120px;
    }
  }

  /* Cards fade up as they enter the viewport */
  @supports (animation-timeline: view()) {
    .stack > .card {
      animation: fade-up-card var(--ease) both;
      animation-timeline: view();
      animation-range: entry 5% cover 25%;
    }
  }

  @media (hover: hover) {
    .tile {
      transition: transform 250ms var(--ease), box-shadow 250ms var(--ease);
    }

    .tile:hover {
      transform: translateY(-3px);
    }
  }
}

@keyframes glow-drift {
  from {
    transform: translate(0, 0) rotate(0deg);
  }

  to {
    transform: translate(3%, -2%) rotate(4deg);
  }
}

@keyframes grid-drift {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(56px);
  }
}

@keyframes logo-in {
  from {
    opacity: 0;
    transform: scale(0.94) rotate(-15deg);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes rule-grow {
  from {
    opacity: 0;
    transform: scaleX(0);
  }

  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes breathe {
  from {
    opacity: 0.3;
  }

  to {
    opacity: 0.55;
  }
}

@keyframes header-solid {
  from {
    background-color: rgba(27, 28, 75, 0);
    border-bottom-color: rgba(32, 196, 190, 0);
    -webkit-backdrop-filter: blur(0);
    backdrop-filter: blur(0);
  }

  to {
    background-color: rgba(27, 28, 75, 0.93);
    border-bottom-color: var(--edge);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}

@keyframes fade-up-card {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Print ---------- */

@media print {
  body::before,
  body::after {
    display: none;
  }

  .site-header {
    position: static;
  }
}
