/* ============================================================
   Proteus Group - styles.css
   Plain CSS, custom properties, mobile-first.
   ------------------------------------------------------------
   Sections:
   1. Design tokens (custom properties)
   2. Reset & base
   3. Layout primitives (container, section, grid)
   4. Typography helpers (kicker, titles, prose)
   5. Header & navigation
   6. Hero (animated blobs)
   7. Cards (pillars + value)
   8. Thesis list
   9. Approach + closing band
   10. Footer
   11. Scroll-reveal motion
   12. Grain overlay
   13. Reduced-motion overrides
   ============================================================ */

/* ---------- 1. Design tokens ---------- */
:root {
  --bg: #070B14;
  --bg-soft: #0C1320;
  --surface: #111A2B;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #EDF1F8;
  --text-muted: #97A0B2;
  --text-faint: #6B7589;
  --accent: #5BD9C4;
  --accent-blue: #5B8DEF;
  --accent-grad: linear-gradient(120deg, #5BD9C4 0%, #5B8DEF 100%);

  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --container: 1180px;
  --pad-x: clamp(1.25rem, 5vw, 2.5rem);
  --section-y: clamp(5rem, 12vh, 9rem);
  --radius: 16px;

  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 2. Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Offset in-page anchors so the sticky header doesn't cover headings */
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: clamp(1.0625rem, 0.4vw + 0.95rem, 1.125rem);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

/* Visible focus for keyboard users */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

/* ---------- 3. Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.section {
  padding-block: var(--section-y);
}

.section-alt {
  background-color: var(--bg-soft);
  border-block: 1px solid var(--border);
}

.grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 720px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 1000px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- 4. Typography helpers ---------- */
.kicker {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  max-width: 22ch;
  margin-bottom: 1.75rem;
}

.section-intro {
  color: var(--text-muted);
  max-width: 60ch;
  margin-bottom: 2.5rem;
  font-size: 1.125rem;
}

/* Gradient-filled highlight word */
.grad-text {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Long-form reading column */
.prose {
  max-width: 65ch;
}

.prose p {
  color: var(--text-muted);
  margin-bottom: 1.4rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* ---------- 5. Header & navigation ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background-color 0.35s var(--ease),
              border-color 0.35s var(--ease),
              backdrop-filter 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}

/* Scrolled state - added by JS */
.site-header.scrolled {
  background-color: rgba(7, 11, 20, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: var(--accent-grad);
  box-shadow: 0 0 18px rgba(91, 217, 196, 0.35);
}

.brand-word {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.18em;
  font-size: 0.95rem;
}

.nav-list {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-list a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}

.nav-list a:hover {
  color: var(--text);
}

/* Hide desktop nav on small screens */
@media (max-width: 819px) {
  .nav {
    display: none;
  }
}

/* Hamburger button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  margin-inline: auto;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}

/* Animate hamburger into an X when open */
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 819px) {
  .nav-toggle {
    display: flex;
  }
}

/* Mobile menu panel */
.mobile-menu {
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  background-color: rgba(7, 11, 20, 0.96);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 99;
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-menu-list {
  display: flex;
  flex-direction: column;
  padding: 1rem var(--pad-x) 2rem;
}

.mobile-menu-list a {
  display: block;
  padding: 1rem 0;
  font-size: 1.15rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.mobile-menu-list li:last-child a {
  border-bottom: none;
}

/* ---------- 6. Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-block: calc(var(--header-h) + 3rem) clamp(4rem, 10vh, 7rem);
  overflow: hidden;
  isolation: isolate;
}

.hero-inner {
  position: relative;
  z-index: 2;
}

/* Decorative oceanic blobs */
.hero-blobs {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  will-change: transform;
}

.blob-1 {
  width: 46vw;
  height: 46vw;
  max-width: 620px;
  max-height: 620px;
  top: -8%;
  left: -6%;
  background: radial-gradient(circle at 30% 30%, rgba(91, 217, 196, 0.55), transparent 68%);
  animation: drift-1 22s ease-in-out infinite;
}

.blob-2 {
  width: 50vw;
  height: 50vw;
  max-width: 680px;
  max-height: 680px;
  top: 8%;
  right: -12%;
  background: radial-gradient(circle at 60% 40%, rgba(91, 141, 239, 0.5), transparent 68%);
  animation: drift-2 28s ease-in-out infinite;
}

.blob-3 {
  width: 38vw;
  height: 38vw;
  max-width: 520px;
  max-height: 520px;
  bottom: -14%;
  left: 26%;
  background: radial-gradient(circle at 50% 50%, rgba(91, 217, 196, 0.32), transparent 66%);
  animation: drift-3 25s ease-in-out infinite;
}

@keyframes drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(8%, 10%) scale(1.12); }
  66%      { transform: translate(-6%, 4%) scale(0.94); }
}

@keyframes drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40%      { transform: translate(-10%, 8%) scale(1.08); }
  70%      { transform: translate(4%, -6%) scale(0.9); }
}

@keyframes drift-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(10%, -8%) scale(1.15); }
}

/* Dark vignette keeps hero text legible over the blobs */
.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(120% 90% at 50% 30%, transparent 40%, rgba(7, 11, 20, 0.75) 100%),
    linear-gradient(180deg, rgba(7, 11, 20, 0.35) 0%, rgba(7, 11, 20, 0.1) 35%, var(--bg) 100%);
}

.hero-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 16ch;
  margin-bottom: 1.75rem;
}

.hero-subhead {
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 56ch;
  margin-bottom: 2.25rem;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border-strong);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.hero-cta:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.hero-cta .arrow-down {
  transition: transform 0.25s var(--ease);
}

.hero-cta:hover .arrow-down {
  transform: translateY(3px);
}

/* ---------- 7. Cards ---------- */
.card {
  position: relative;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 3vw, 2.25rem);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

/* Thin accent-gradient top edge */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent-grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
}

.card:hover::before {
  transform: scaleX(1);
}

.card-layer {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.card-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.85rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 0.9rem;
}

.card-title.sm {
  font-size: 1.4rem;
}

.card-body {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* ---------- 8. Thesis list ---------- */
.thesis-list {
  display: grid;
  gap: 1.25rem;
  margin-top: 3rem;
  margin-bottom: 2.75rem;
}

@media (min-width: 760px) {
  .thesis-list {
    gap: 0;
  }
}

.thesis-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
}

.thesis-item:last-child {
  border-bottom: 1px solid var(--border);
}

.thesis-num {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  flex: 0 0 auto;
  min-width: 2.5ch;
}

.thesis-item-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.005em;
}

.thesis-body p {
  color: var(--text-muted);
  margin: 0;
  max-width: 60ch;
}

.thesis-close {
  font-size: 1.15rem;
  color: var(--text);
}

@media (min-width: 760px) {
  .thesis-item {
    gap: 2rem;
  }
  .thesis-num {
    font-size: 1.75rem;
  }
}

/* ---------- 9. Approach + closing band ---------- */
.approach {
  background-color: var(--bg-soft);
  border-block: 1px solid var(--border);
}

.approach-inner {
  max-width: 760px;
}

.approach-body {
  color: var(--text-muted);
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
  line-height: 1.65;
  max-width: 62ch;
}

.closing {
  padding-block: clamp(5rem, 14vh, 10rem);
  text-align: center;
}

.closing-line {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.75rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 18ch;
  margin-inline: auto;
}

/* ---------- 10. Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: clamp(3rem, 6vh, 4.5rem);
  background-color: var(--bg);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-word {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.18em;
  font-size: 1rem;
}

.footer-tagline {
  color: var(--text-muted);
  max-width: 50ch;
}

.footer-legal {
  color: var(--text-faint);
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

/* ---------- 11. Scroll-reveal motion ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}

.reveal.in-view {
  opacity: 1;
  transform: none;
}

/* Subtle stagger for cards inside a grid */
.grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.grid .reveal:nth-child(3) { transition-delay: 0.16s; }
.grid .reveal:nth-child(4) { transition-delay: 0.08s; }
.grid .reveal:nth-child(5) { transition-delay: 0.16s; }
.grid .reveal:nth-child(6) { transition-delay: 0.24s; }

/* ---------- 12. Grain overlay (premium texture) ---------- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 13. Reduced-motion overrides ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .blob {
    animation: none;
  }

  /* Show all content immediately, no slide */
  .reveal {
    opacity: 1;
    transform: none;
  }
}
