/* ==========================================================================
   OVRLK Labs — landing page
   Tokens

   Brand palette
     Night Sky    #101820  — page background
     Granite      #343A40  — surfaces, ridge layers
     Glacier      #DCE8E8  — primary text
     Alpine Blue  #4C7A8C  — interactive (links, pulse, focus)
     Sandstone    #C7A77A  — warm accent (eyebrows, CTA)

   Derived (not brand swatches): fg-dim, line, *hover, ridge-mid/back
   ========================================================================== */

:root {
  /* Brand */
  --bg: #101820; /* Night Sky */
  --bg-2: #343A40; /* Granite */
  --fg: #DCE8E8; /* Glacier */
  --accent: #4C7A8C; /* Alpine Blue */
  --warm: #C7A77A; /* Sandstone */

  /* Derived */
  --fg-dim: #8A9B9E; /* Glacier × Alpine */
  --line: rgba(220, 232, 232, 0.1);
  --accent-hover: #5E90A3;
  --warm-hover: #D4B88F;
  --ridge-back: #2A3238;
  --ridge-mid: #1A2228;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --max-width: 1200px;
  --edge: clamp(24px, 5vw, 64px);
}

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

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

/* Visible keyboard focus */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ==========================================================================
   Background grid overlay — subtle lab-schematic texture
   ========================================================================== */

.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 90%);
}

/* ==========================================================================
   Topbar
   ========================================================================== */

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px var(--edge);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.wordmark:hover {
  opacity: 0.85;
}

.logo-mark {
  height: 18px;
  width: auto;
  display: block;
}

.labs-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--fg-dim);
  padding-top: 1px;
}

.coords {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s ease;
}

@media (max-width: 640px) {
  .coords {
    display: none;
  }
}

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

.hero {
  position: relative;
  z-index: 1;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  overflow: hidden;
  padding: 0 var(--edge);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
  /* Keep copy just above the ridge band / CTA */
  margin-bottom: clamp(48px, 8vh, 88px);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--warm);
  margin: 0 0 20px;
  text-transform: uppercase;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
}

.sub {
  font-size: 17px;
  color: var(--fg-dim);
  max-width: 480px;
  margin: 0;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--bg);
  background: var(--warm);
  padding: 14px 22px;
  transition: transform 0.15s ease, background 0.15s ease;
}

/* Sit the CTA down in the ridge band, clear of the copy above */
.hero-cta {
  position: relative;
  z-index: 2;
  margin-bottom: clamp(56px, 12vh, 110px);
}

.cta:hover {
  background: var(--warm-hover);
  transform: translateY(-1px);
}

.cta .arrow {
  transition: transform 0.15s ease;
}

.cta:hover .arrow {
  transform: translateX(3px);
}

/* ==========================================================================
   Horizon SVG — signature element
   ========================================================================== */

.horizon {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 340px;
  z-index: 1;
  overflow: visible;
}

.ridge {
  fill: var(--bg-2);
  stroke: none;
}

.ridge-back {
  fill: var(--ridge-back);
  opacity: 0.9;
}

.ridge-mid {
  fill: var(--ridge-mid);
  opacity: 0.95;
}

.ridge-front {
  fill: var(--bg);
}

/* Ridge drift — each layer creeps sideways at a different, slow pace.
   Readable ambient motion; still far from a spotlight sweep.
   CSS transforms on SVG <g> need transform-box for reliable animation. */
.ridge-layer {
  transform-box: view-box;
  transform-origin: center;
  will-change: transform;
}

.ridge-back-layer {
  animation: driftBack 28s ease-in-out infinite;
}

.ridge-mid-layer {
  animation: driftMid 20s ease-in-out infinite;
  animation-delay: -4s;
}

.ridge-front-layer {
  animation: driftFront 24s ease-in-out infinite;
  animation-delay: -11s;
}

@keyframes driftBack {
  0%, 100% { transform: translate3d(-40px, 0, 0); }
  50% { transform: translate3d(40px, 0, 0); }
}

@keyframes driftMid {
  0%, 100% { transform: translate3d(32px, 0, 0); }
  50% { transform: translate3d(-32px, 0, 0); }
}

@keyframes driftFront {
  0%, 100% { transform: translate3d(-24px, 0, 0); }
  50% { transform: translate3d(24px, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .ridge-back-layer,
  .ridge-mid-layer,
  .ridge-front-layer {
    animation: none;
  }
}

/* ==========================================================================
   Status board
   ========================================================================== */

.status-board {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px var(--edge) 120px;
  border-top: 1px solid var(--line);
}

.status-board .eyebrow {
  margin-bottom: 28px;
}

.rows {
  display: grid;
  gap: 0;
  margin: 0;
}

.row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.row dt {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: 0.08em;
}

.row dd {
  margin: 0;
  font-size: 15px;
}

.row dd a {
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.row dd a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: middle;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(76, 122, 140, 0.45);
  }
  50% {
    opacity: 0.6;
    box-shadow: 0 0 0 6px rgba(76, 122, 140, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pulse-dot {
    animation: none;
  }
}

@media (max-width: 560px) {
  .row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* ==========================================================================
   Projects page
   ========================================================================== */

.page-intro {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 72px var(--edge) 48px;
}

.page-intro h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}

.page-intro .sub {
  margin-bottom: 0;
}

.projects {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--edge) 120px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.project {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 28px 32px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(76, 122, 140, 0.08) 0%, transparent 42%),
    var(--bg-2);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.project:hover {
  border-color: rgba(76, 122, 140, 0.45);
  transform: translateY(-2px);
}

.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-status {
  color: var(--fg);
  display: inline-flex;
  align-items: center;
}

.project-tag {
  color: var(--fg-dim);
}

.project-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.15;
}

.project-desc {
  margin: 0;
  color: var(--fg-dim);
  font-size: 15px;
  max-width: 42ch;
  flex: 1;
}

.project-stack {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
}

.project-stack li {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-dim);
  border: 1px solid var(--line);
  padding: 6px 10px;
}

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

footer {
  position: relative;
  z-index: 2;
  padding: 28px var(--edge) 40px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-dim);
}
