/* ---------------------------------------------------------
   Nikhil Krishna, personal site
   Direction: an actual cyanotype blueprint sheet. White
   drafting ink on blueprint blue. A light coral carries
   interactive text (needs to stay readable against the
   lighter field); a deeper redline red is reserved for
   drawn linework and borders, where only visual contrast,
   not text contrast, applies.
   Surface brief: .impeccable/surfaces/index.md
--------------------------------------------------------- */

@font-face {
  font-family: 'Architects Daughter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/architects-daughter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/space-grotesk-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/space-grotesk-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/space-grotesk-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/nunito-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/nunito-latin-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/nunito-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/nunito-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/nunito-latin-800-normal.woff2') format('woff2');
}

:root {
  --bg: #1f4d78;
  --bg-deep: #163d60;
  --ink: #f6f9fc;
  --ink-soft: #c7dcef;
  --ink-faint: #a0bfda;
  --line: rgba(246, 249, 252, 0.24);
  --line-strong: rgba(246, 249, 252, 0.48);
  --accent: #ffab9b;
  --accent-line: #e2483a;
  --accent-dim: rgba(255, 171, 155, 0.35);

  --font-hand: 'Architects Daughter', cursive;
  --font-display: 'Space Grotesk', var(--font);
  --font: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 760px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    linear-gradient(rgba(246, 249, 252, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246, 249, 252, 0.1) 1px, transparent 1px);
  background-size: 170px 170px, 170px 170px, 17px 17px, 17px 17px;
  color: var(--ink-soft);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  position: relative;
  cursor: url('../assets/cursor-pencil.svg') 6 26, auto;
}

a, button { cursor: url('../assets/cursor-pencil.svg') 6 26, pointer; }

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

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

/* ---------------- Drafting sheet frame ---------------- */

.frame {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.frame .c {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--line-strong);
}

.frame .tl { top: 14px; left: 14px; border-right: none; border-bottom: none; }
.frame .tr { top: 14px; right: 14px; border-left: none; border-bottom: none; }
.frame .bl { bottom: 14px; left: 14px; border-right: none; border-top: none; }
.frame .br { bottom: 14px; right: 14px; border-left: none; border-top: none; }

/* Sheet peeled up at the top corner, like a real blueprint print curling. */
.corner-fold {
  position: fixed;
  top: 0;
  right: 0;
  width: 72px;
  height: 72px;
  z-index: 2;
  pointer-events: none;
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  background: linear-gradient(225deg, var(--bg) 0%, var(--bg) 40%, var(--bg-deep) 41%, var(--bg-deep) 100%);
  box-shadow: -10px 8px 16px rgba(4, 12, 22, 0.45);
}

.corner-fold::after {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  background: linear-gradient(225deg, rgba(246, 249, 252, 0.14), transparent 55%);
}

/* ---------------- Layout ---------------- */

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px 24px 48px;
  position: relative;
}

/* Margin sketches: generic engineering doodles in the side gutters.
   Only shown once there's genuinely spare width beside the column. */
.side-deco {
  position: absolute;
  top: 0;
  width: 150px;
  height: 100%;
  pointer-events: none;
  display: none;
}

.side-deco.left { right: 100%; margin-right: 30px; }
.side-deco.right { left: 100%; margin-left: 30px; }

.doodle {
  position: absolute;
  width: 116px;
  height: 116px;
  opacity: 0.4;
}

.side-deco.left .doodle:nth-child(odd) { transform: rotate(-6deg); }
.side-deco.left .doodle:nth-child(even) { transform: rotate(5deg); }
.side-deco.right .doodle:nth-child(odd) { transform: rotate(7deg); }
.side-deco.right .doodle:nth-child(even) { transform: rotate(-4deg); }

.doodle-svg { width: 100%; height: 100%; display: block; }

@media (min-width: 1280px) {
  .side-deco { display: block; }
}

.row {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 36px 0 28px;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

a:hover, a:focus-visible { border-bottom-color: var(--accent); }

strong { color: var(--ink); font-weight: 700; }

p { margin: 0 0 22px; max-width: 62ch; }

ul { margin: 0 0 8px; padding-left: 22px; }
li { margin-bottom: 12px; padding-left: 4px; }
li::marker { color: var(--ink-faint); }

/* ---------------- Name ---------------- */

.name {
  font-family: var(--font-hand);
  font-weight: 400;
  font-size: clamp(3rem, 10vw, 5.4rem);
  color: var(--ink);
  text-align: center;
  margin: 0 0 6px;
  letter-spacing: 0.01em;
  line-height: 1.05;
  transform: rotate(-1.2deg);
}

.kicker {
  text-align: center;
  color: var(--ink-faint);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  margin: 0 0 40px;
  max-width: none;
}

/* ---------------- Fact blocks: drawing beside its own text ---------------- */

.fact-block {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 24px;
  align-items: center;
  margin-bottom: 28px;
}

.fact-block.reverse { grid-template-columns: 190px 1fr; }
.fact-block.reverse .fact-figure { order: -1; }

.fact-block p { margin-bottom: 0; max-width: none; }

.fact-figure {
  margin: 0;
}

.fact-art {
  width: 100%;
  height: auto;
  overflow: hidden;
  display: block;
}

/* Debris drawing */
.debris-earth { fill: var(--bg); stroke: var(--line-strong); stroke-width: 1.5; }
.orbit { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 4; }
.debris-cross { stroke: var(--accent-line); stroke-width: 1.2; fill: none; }
.debris-frag rect, .debris-frag path { fill: var(--ink-soft); }

/* Fragments drawn live by rough.js pick up their color/roughness from
   inline attributes set in js/illustrations.js, so most of the CSS below
   only styles the small moving parts layered on top of that sketched
   linework. */

.debris-frag-ghost rect,
.debris-frag-ghost path { fill: var(--ink-faint); }

.sat-rig { animation: sat-tumble 7s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 50%; }

@keyframes sat-tumble {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

.sat-light {
  fill: var(--accent-line);
  animation: sat-blink 2.4s ease-in-out infinite;
}

@keyframes sat-blink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.car-rig { animation: car-idle 0.5s ease-in-out infinite; }

@keyframes car-idle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-0.6px); }
}

.car-wheel-spin {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: spin-cw 1.1s linear infinite;
}

@keyframes spin-cw {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .sat-light { animation: none; opacity: 0.7; }
  .sat-rig, .car-rig, .car-wheel-spin { animation: none; }
  .debris-frag animateMotion, .debris-frag-ghost animateMotion { display: none; }
  .debris-frag-ghost { display: none; }
}

/* ---------------- Contact / footer ---------------- */

.contact-row {
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.contact-row a { font-size: 1rem; }

.personal-line {
  font-family: var(--font-hand);
  color: var(--ink);
  font-size: 1.5rem;
  transform: rotate(-0.6deg);
}

.proof-link {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92em;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .page { padding: 48px 20px 32px; }
  .fact-block, .fact-block.reverse {
    grid-template-columns: 1fr;
  }
  .fact-block.reverse .fact-figure { order: 0; }
  .fact-figure { max-width: 220px; margin: 0 auto; }
}
