/* =========================================================================
   Portfolio landing (page2)
   Aesthetic: cool porcelain spec-sheet · ink type · one cobalt accent
   Monospace as a signature for labels & data.
   ========================================================================= */

:root {
  --ground: #e9edf3;        /* cool pale slate-white */
  --surface: #ffffff;       /* raised cards lift off the ground */
  --text: #131922;          /* cool near-black ink */
  --muted: #5a6573;         /* secondary text */
  --line: #d2dae5;          /* hairline borders */
  --line-strong: #b9c4d4;
  --accent: #1f3be0;        /* electric cobalt — the one bold move */
  --accent-ink: #16259e;    /* darker cobalt for hover/contrast */
  --signal: #e0a03a;        /* warm amber — live data ticks only */

  --display: "Helvetica Neue", "Inter", system-ui, -apple-system, "Segoe UI",
    Roboto, Arial, sans-serif;
  --body: var(--display);
  --mono: ui-monospace, "Cascadia Code", "SF Mono", "Segoe UI Mono", Menlo,
    Consolas, monospace;

  --maxw: 1140px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --radius: 14px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden; /* safety net — no element should ever scroll the body sideways */
  background-color: var(--ground);
  /* faint engineering grid — quiet atmosphere, not a pattern you "notice" */
  background-image:
    linear-gradient(rgba(31, 59, 224, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 59, 224, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

p {
  margin: 0;
}

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

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Shared utility face: eyebrows + labels --------------------------------- */
.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

/* =========================== MASTHEAD ================================== */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem var(--gutter);
  background: rgba(233, 237, 243, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.masthead[data-scrolled="true"] {
  border-bottom-color: var(--line);
  background: rgba(233, 237, 243, 0.94);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--accent);
  color: #fff;
  border-radius: 9px;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand-name {
  font-size: 0.98rem;
}

.masthead-nav {
  display: flex;
  gap: 1.6rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.masthead-nav a {
  position: relative;
  padding: 0.2rem 0;
  transition: color 0.2s ease;
}
.masthead-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.masthead-nav a:hover {
  color: var(--text);
}
.masthead-nav a:hover::after {
  transform: scaleX(1);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 rgba(224, 160, 58, 0.5);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(224, 160, 58, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(224, 160, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 160, 58, 0); }
}

/* =========================== BUTTONS =================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.4rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: transform 0.18s ease, background 0.2s ease, border-color 0.2s ease,
    color 0.2s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn-solid {
  background: var(--accent);
  color: #fff;
}
.btn-solid:hover {
  background: var(--accent-ink);
}
.btn-ghost {
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-invert {
  background: #fff;
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 0.9rem;
}
.btn-invert:hover {
  background: rgba(255, 255, 255, 0.9);
}
.btn-ghost-invert {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}
.btn-ghost-invert:hover {
  border-color: #fff;
}

/* =========================== HERO ===================================== */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6.5rem) var(--gutter) clamp(3rem, 7vw, 5rem);
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.hero-title {
  margin: 1.4rem 0 0;
  font-size: clamp(2.05rem, 6.2vw, 4.4rem);
  overflow-wrap: break-word;
}
.hero-title em {
  font-style: normal;
  color: var(--accent);
}
.hero-lede {
  margin-top: 1.5rem;
  max-width: 34ch;
  color: var(--muted);
  font-size: 1.08rem;
}
.hero-actions {
  margin-top: 2.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* Instrument readout card */
.readout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -34px rgba(19, 25, 34, 0.35);
  overflow: hidden;
}
.readout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.readout-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
}
.readout-rows {
  margin: 0;
  padding: 0.4rem 1.1rem;
}
.readout-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px dashed var(--line);
}
.readout-row:last-child {
  border-bottom: 0;
}
.readout-row dt {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.readout-row dd {
  margin: 0;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: right;
}
.readout-row dt {
  flex: none;
}
.readout-spark {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

/* =========================== SECTION SCAFFOLD ========================= */
.index,
.capabilities,
.principles {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter);
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line-strong);
}
.section-count {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* =========================== INDEX / RECORDS ========================= */
.records {
  list-style: none;
  margin: 0;
  padding: 0;
}
.record {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(2rem, 4vw, 3rem) 0;
  border-bottom: 1px solid var(--line);
  position: relative;
}
/* cobalt rule on top of each record — draws in when the record reveals */
.record::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  height: 2px;
  width: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(1);
}
.record.is-pending::before {
  transform: scaleX(0);
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.1s;
}
.record.is-revealed::before {
  transform: scaleX(1);
}
.record-no {
  font-family: var(--mono);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
  color: var(--line-strong);
  line-height: 1;
}
.record-kicker {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.record-title {
  margin: 0.5rem 0 0;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
}
.record-desc {
  margin: 1rem 0 0;
  max-width: 62ch;
  color: var(--muted);
}

.spec {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2.4rem;
  margin: 1.6rem 0 0;
}
.spec-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.spec-item dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.spec-item dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.record-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--accent-ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.record-link:first-child {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.record-link:hover {
  border-color: var(--accent);
}

/* =========================== CAPABILITIES =========================== */
.capabilities-title {
  margin: 1.8rem 0 0;
  max-width: 18ch;
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
}
.matrix {
  margin-top: 2.4rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.cell {
  background: var(--surface);
  padding: 1.6rem 1.4rem;
}
.cell h3 {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.cell p {
  margin-top: 0.7rem;
  font-size: 0.92rem;
  color: var(--muted);
}

/* =========================== PRINCIPLES ============================= */
.principle-row {
  margin-top: 2.2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
}
.principle {
  position: relative;
  padding-top: 1.4rem;
  border-top: 2px solid var(--accent);
  color: var(--muted);
  font-size: 0.98rem;
}
.principle span {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}

/* =========================== CONTACT ================================ */
.contact {
  margin-top: clamp(2rem, 5vw, 4rem);
  background: var(--accent);
  color: #fff;
}
.contact-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) var(--gutter);
}
.eyebrow-invert {
  color: rgba(255, 255, 255, 0.72);
}
.contact-title {
  margin: 1.2rem 0 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  max-width: 16ch;
}
.contact-copy {
  margin-top: 1.3rem;
  max-width: 48ch;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.06rem;
}
.contact-actions {
  margin-top: 2.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* =========================== FOOTER ================================ */
.colophon {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* =========================== ENTRANCE ============================== */
/* Pure-CSS entrance: animations run on load and always finish visible,
   so content never depends on JavaScript to appear. */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.hero-statement {
  animation: rise 0.7s 0.04s both;
}
.readout {
  animation: rise 0.7s 0.16s both;
}

/* Scroll reveal for below-the-fold blocks. The hidden state (.is-pending)
   is added by JavaScript only — so with no JS, everything stays visible. */
.is-pending {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.is-pending.is-revealed {
  opacity: 1;
  transform: none;
}

/* =========================== RESPONSIVE ============================ */
@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .matrix {
    grid-template-columns: repeat(2, 1fr);
  }
  .principle-row {
    grid-template-columns: 1fr;
  }
  .masthead-nav {
    display: none;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }
  .record {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .record-no {
    font-size: 1.3rem;
  }
  .matrix {
    grid-template-columns: 1fr;
  }
  .status-pill {
    display: none;
  }
  /* stack readout label above value so long values never crowd */
  .readout-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  .readout-row dd {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .hero-statement,
  .readout,
  .is-pending,
  .is-pending.is-revealed {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .record.is-pending::before,
  .record::before {
    transition: none;
    transform: scaleX(1);
  }
}
