/* ============================================================
   Refract — design tokens
   Palette drawn from the existing wordmark ("Specter"):
   near-black ground, off-white signal ray, grey carriers,
   with a single warm copper accent standing in for the
   heat/cost imposed at the point of refraction.
   ============================================================ */

:root {
  --bg: #2b2e33;
  --bg-elevated: #353940;
  --line: rgba(232, 237, 245, 0.12);
  --line-strong: rgba(232, 237, 245, 0.22);

  --fg: #e8edf5;
  --fg-muted: #9aaabb;
  --fg-faint: #5a6e82;

  --accent: #c68a4e;
  --accent-dim: rgba(198, 138, 78, 0.35);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, Menlo, monospace;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --space-7: 96px;
  --space-8: 144px;

  --container: 1180px;
  --header-h: 80px;
  --radius: 2px;

  --dur-fast: 180ms;
  --dur-med: 300ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================
   Reset
   ============================================================ */

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

@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;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

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

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

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

ul { padding: 0; list-style: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

::selection {
  background: var(--accent-dim);
  color: var(--fg);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: var(--space-2);
  background: var(--fg);
  color: var(--bg);
  padding: var(--space-1) var(--space-2);
  z-index: 1000;
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--space-2); }

/* ============================================================
   Layout primitives
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

@media (min-width: 768px) {
  .container { padding-inline: var(--space-4); }
}

section {
  padding-block: var(--space-7);
  border-top: 1px solid var(--line);
  position: relative;
}

.section-head {
  max-width: 760px;
  margin-bottom: var(--space-6);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-mono);
  font-size: clamp(15px, 1.5vw, 19px);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1.5px;
  background: var(--accent);
}

h2.section-title {
  font-weight: 300;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.25;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.section-lede {
  margin-top: var(--space-3);
  color: var(--fg-muted);
  font-size: 17px;
  max-width: 56ch;
}

.section-body {
  margin-top: var(--space-3);
  color: var(--fg-muted);
  font-size: 16px;
  max-width: 68ch;
}
.section-body p + p { margin-top: var(--space-2); }

.domains-intro {
  max-width: 68ch;
  margin-bottom: var(--space-4);
  color: var(--fg);
  font-size: 17px;
}

/* ============================================================
   Header / Nav
   ============================================================ */

.site-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  background: rgba(43, 46, 51, 0);
  transition: background var(--dur-med) var(--ease-out), border-color var(--dur-med) var(--ease-out);
}

.site-header.is-scrolled {
  background: rgba(43, 46, 51, 0.88);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.brand-word {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 24px;
  letter-spacing: 0.2em;
  color: var(--fg);
}

@media (min-width: 900px) {
  :root { --header-h: 100px; }
  .brand { gap: 20px; }
  .brand-mark { width: 56px; height: 56px; }
  .brand-word { font-size: 32px; }
}

.hud {
  display: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  text-align: right;
  line-height: 1.5;
  white-space: nowrap;
}

.hud span { color: var(--fg-muted); }

@media (min-width: 1024px) {
  .hud { display: block; }
}

.primary-nav {
  display: none;
}

.primary-nav ul {
  display: flex;
  gap: var(--space-4);
}

.primary-nav a {
  font-size: 14px;
  color: var(--fg-muted);
  position: relative;
  padding-block: var(--space-1);
  transition: color var(--dur-fast) var(--ease-out);
}

.primary-nav a:hover,
.primary-nav a.is-active {
  color: var(--fg);
}

.primary-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--accent);
}

@media (min-width: 900px) {
  .primary-nav { display: block; }
  .nav-toggle { display: none; }
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-right: calc(var(--space-1) * -1);
}

.nav-toggle span {
  width: 22px;
  height: 1px;
  background: var(--fg);
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--bg);
  z-index: 90;
  padding: var(--space-5) var(--space-3);
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out);
}

.mobile-nav.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-nav ul { display: flex; flex-direction: column; gap: var(--space-3); }

.mobile-nav a {
  display: block;
  padding-block: var(--space-1);
  font-size: 22px;
  font-weight: 300;
  color: var(--fg);
}

@media (min-width: 900px) {
  .mobile-nav, .nav-toggle { display: none; }
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  border-top: none;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-block: var(--space-8) var(--space-7);
  overflow: hidden;
  isolation: isolate;
}

.hero-field {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-field svg {
  width: 100%;
  height: 100%;
}

.hero-field::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 35%, rgba(43, 46, 51, 0) 0%, rgba(43, 46, 51, 0.55) 100%);
}

.ray-pulse {
  stroke-dasharray: 14 12;
  animation: travel 3.2s linear infinite;
}
@keyframes travel {
  to { stroke-dashoffset: -208; }
}

.hero-content {
  max-width: 900px;
}

.hero-content .eyebrow { color: var(--fg-muted); }
.hero-content .eyebrow::before { background: var(--fg-muted); }

.hero-title {
  font-weight: 300;
  font-size: clamp(38px, 6.4vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.hero-title-sub {
  display: block;
  margin-top: 0.3em;
  font-size: 0.56em;
  line-height: 1.25;
  max-width: 24em;
}

.hero-title em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  margin-top: var(--space-3);
  font-size: clamp(16px, 2vw, 19px);
  color: var(--fg-muted);
  max-width: 58ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 14px 28px;
  font-size: 14px;
  letter-spacing: 0.04em;
  border-radius: var(--radius);
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  cursor: pointer;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #14100a;
  border: 1px solid var(--accent);
}
.btn-primary:hover { background: #d69958; }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { border-color: var(--fg-muted); }

/* ============================================================
   About
   ============================================================ */

.about-grid {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: start;
  }
}

.about-copy p + p { margin-top: var(--space-3); }
.about-copy p { color: var(--fg-muted); max-width: 62ch; }
.about-copy strong { color: var(--fg); font-weight: 500; }

.principle-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--line);
}

.principle-list li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: var(--space-2);
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--line);
}

.principle-list .idx {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
  padding-top: 3px;
}

.principle-list h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 4px;
}

.principle-list p {
  color: var(--fg-muted);
  font-size: 14.5px;
}

/* ============================================================
   Capabilities
   ============================================================ */

.domain-grid {
  display: grid;
  gap: 20px;
}

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

.domain-tile {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: 220px;
  padding: var(--space-4);
  background: linear-gradient(160deg, var(--bg-elevated) 0%, var(--bg) 100%);
  border: 1px solid var(--line);
  border-radius: 6px;
  transition:
    transform var(--dur-med) var(--ease-out),
    border-color var(--dur-med) var(--ease-out),
    box-shadow var(--dur-med) var(--ease-out);
}

/* copper edge that sweeps across the top on hover */
.domain-tile::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 500ms var(--ease-out);
}

/* faint refraction motif in the corner, echoing the logo */
.domain-tile::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -12px; bottom: -12px;
  width: 180px; height: 124px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 110'%3E%3Cg stroke='%23e8edf5' stroke-width='2' stroke-linecap='round' fill='none'%3E%3Cline x1='0' y1='30' x2='70' y2='30'/%3E%3Cline x1='0' y1='55' x2='70' y2='55'/%3E%3Cline x1='0' y1='80' x2='70' y2='80'/%3E%3Cline x1='70' y1='15' x2='70' y2='95'/%3E%3Cline x1='70' y1='30' x2='150' y2='8'/%3E%3Cline x1='70' y1='55' x2='150' y2='55'/%3E%3Cline x1='70' y1='80' x2='150' y2='102'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / contain;
  opacity: 0.07;
  transition: opacity var(--dur-med) var(--ease-out), transform 500ms var(--ease-out);
}

.tile-num {
  position: absolute;
  top: 14px;
  right: 22px;
  font-family: var(--font-mono);
  font-size: 58px;
  font-weight: 500;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(232, 237, 245, 0.18);
  transition: -webkit-text-stroke-color var(--dur-med) var(--ease-out);
  user-select: none;
}

.tile-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(232, 237, 245, 0.04);
  color: var(--fg-muted);
  transition: color var(--dur-med) var(--ease-out), border-color var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out);
}
.tile-icon svg { width: 54px; height: 54px; }
.tile-icon .dot { fill: var(--accent); stroke: none; }

.domain-tile h3 {
  position: relative;
  max-width: 17em;
  font-size: clamp(19px, 1.7vw, 22px);
  font-weight: 400;
  line-height: 1.3;
  color: var(--fg);
}

@media (min-width: 700px) {
  .domain-tile { min-height: 270px; }
}

@media (hover: hover) {
  .domain-tile:hover {
    transform: translateY(-6px);
    border-color: var(--accent-dim);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.35);
  }
  .domain-tile:hover::before { width: 100%; }
  .domain-tile:hover::after { opacity: 0.16; transform: translate(-6px, -4px); }
  .domain-tile:hover .tile-num { -webkit-text-stroke-color: rgba(198, 138, 78, 0.7); }
  .domain-tile:hover .tile-icon { color: var(--fg); border-color: var(--accent-dim); transform: scale(1.06); }
}

/* ============================================================
   Engagement model
   ============================================================ */

.step-grid {
  display: grid;
  gap: 20px;
}

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

/* phase tiles reuse the .domain-tile look; they just carry more text */
.step-tile { min-height: 0; }

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

.tile-phase {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.tile-body p {
  position: relative;
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-muted);
}

/* ============================================================
   Team
   ============================================================ */

.team-card {
  display: grid;
  gap: var(--space-5);
  border: 1px solid var(--line);
  padding: var(--space-5);
  background: var(--bg-elevated);
}

@media (min-width: 900px) {
  .team-card { grid-template-columns: 220px 1fr; padding: var(--space-6); }
}

.team-mark {
  width: 96px;
  height: 96px;
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
}
.team-mark svg { width: 48px; height: 48px; }

.team-name {
  font-size: 22px;
  font-weight: 500;
  color: var(--fg);
  margin-top: var(--space-3);
}

.team-role {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 4px;
}

.team-bio {
  color: var(--fg-muted);
  font-size: 15px;
  max-width: 72ch;
}
.team-bio p + p { margin-top: var(--space-2); }
.team-bio em { font-style: italic; color: var(--fg); }

.affiliations-title {
  margin-top: var(--space-5);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.profile-link {
  display: inline-block;
  margin-top: var(--space-4);
  padding-block: var(--space-1);
  font-size: 14px;
  letter-spacing: 0.03em;
  color: var(--fg);
  border-bottom: 1px solid var(--line-strong);
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.profile-link:hover { color: var(--accent); border-color: var(--accent); }

.affiliations { margin-top: var(--space-2); }
.affiliations li {
  padding-block: var(--space-1);
  color: var(--fg);
  font-size: 14.5px;
}

/* ============================================================
   Contact
   ============================================================ */

.contact-panel {
  display: grid;
  gap: var(--space-5);
  align-items: center;
}

@media (min-width: 900px) {
  .contact-panel { grid-template-columns: 1.2fr 0.8fr; }
}

.contact-detail {
  border: 1px solid var(--line);
  padding: var(--space-4);
}

.contact-detail dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.contact-detail dd {
  margin: 4px 0 var(--space-3) 0;
  font-size: 17px;
  color: var(--fg);
}

.contact-detail dd:last-child { margin-bottom: 0; }

.contact-detail a.email-link {
  color: var(--fg);
  border-bottom: 1px solid var(--line-strong);
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.contact-detail a.email-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--space-5);
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: flex-start;
  justify-content: space-between;
  font-size: 13px;
  color: var(--fg-muted);
}

@media (min-width: 700px) {
  .site-footer .container { flex-direction: row; align-items: center; }
}

.footer-mark {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.footer-mark svg { width: 18px; height: 18px; }

/* ============================================================
   Reveal on scroll
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* No-JS / script-blocked fallback: never hide content behind a script
   that might not run. JS only adds the entrance motion when available. */
.no-js .reveal {
  opacity: 1;
  transform: none;
}

@keyframes hero-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-content {
  opacity: 0;
  animation: hero-in 700ms var(--ease-out) 120ms forwards;
}

@media (prefers-reduced-motion: reduce) {
  .hero-content { animation: none; opacity: 1; }
}
