/* Niche Compute. All values are exact per the design handoff. Radius is 0 everywhere. */

:root {
  --ink: #06090f;
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.85);
  --link-hover: #ffd166;
  --panel: rgba(6, 9, 15, 0.45);
  --hairline: rgba(255, 255, 255, 0.35);
  --text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
  /* Flat scrim over the photo. The prototype exposes 0–0.7 (step 0.05); 0.25 ships. */
  --overlay-opacity: 0.25;
}

/* Honk (MORF 15, SHLN 0) with the design's `grayscale brightness invert contrast` filter baked
   in as a two-colour COLRv0 font. The live COLRv1 + filter version renders black in WebKit.
   Regenerate with tools/build_wordmark.py. */
@font-face {
  font-family: 'NC Wordmark';
  src: url("assets/nc-wordmark.woff2") format("woff2");
  font-display: block;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--ink);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Background photo, fixed behind everything. Full-res for phones (portrait `cover`
   crops by height) and hi-DPI; a 1920w cut for 1x–1.25x screens that can't use more. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url("assets/nc-2744.jpg");
  background-image: image-set(
    url("assets/nc-2744.avif") type("image/avif"),
    url("assets/nc-2744.webp") type("image/webp"),
    url("assets/nc-2744.jpg") type("image/jpeg")
  );
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

@media (max-resolution: 1dppx) and (max-width: 2100px) and (max-height: 1175px),
  (max-resolution: 1.25dppx) and (max-width: 1680px) and (max-height: 940px) {
  body::before {
    background-image: url("assets/nc-1920.jpg");
    background-image: image-set(
      url("assets/nc-1920.avif") type("image/avif"),
      url("assets/nc-1920.webp") type("image/webp"),
      url("assets/nc-1920.jpg") type("image/jpeg")
    );
  }
}

a {
  color: var(--text);
}

a:hover {
  color: var(--link-hover);
}

a:focus-visible {
  outline: 2px solid var(--link-hover);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Shell ---------- */

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: clamp(20px, 4vw, 48px);
  color: var(--text);
  font-family: 'Courier Prime', monospace;
  background: linear-gradient(rgba(6, 9, 15, var(--overlay-opacity)), rgba(6, 9, 15, var(--overlay-opacity)));
}

.header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  margin: 0;
  font-family: 'NC Wordmark', system-ui;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 1px;
}

.wordmark-link {
  color: inherit;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 28px;
  font-size: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-link {
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
}

.nav-link[aria-current="page"] {
  border-bottom-color: var(--text);
}

.main {
  flex: 1;
  display: flex;
  align-items: flex-end;
}

.main.is-glitching {
  animation: nc-glitch 0.26s steps(3) 1;
}

.footer {
  font-size: 10px;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 32px;
}

.footer p {
  margin: 0;
}

.footer p + p {
  margin-top: 4px;
}

/* ---------- About ---------- */

/* A fixed width (the design's 520px maximum) so the panel doesn't widen as the tagline and
   easter-egg text type in. It still shrinks to fit narrow screens, as a flex item. */
.about {
  width: 520px;
  text-shadow: var(--text-shadow);
  border: 1px solid var(--hairline);
  padding: 24px 28px;
  background: var(--panel);
}

.tagline {
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.7;
  margin: 0 0 20px 0;
}

.egg {
  color: rgba(255, 255, 255, 0.75);
  font-style: italic;
}

.cursor {
  animation: nc-blink 1.1s step-end infinite;
  color: rgba(255, 255, 255, 0.8);
}

.about-body {
  font-size: 15px;
  line-height: 1.8;
  margin: 0;
  color: var(--text-muted);
}

.about-body + .about-body {
  margin-top: 14px;
}

/* ---------- Projects ---------- */

/* A fixed width (the design's 560px maximum): with the projects masked, the cards' short text
   would otherwise shrink them to the width of their titles. */
.projects {
  width: 560px;
  text-shadow: var(--text-shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 0;
}

.card {
  border: 1px solid var(--hairline);
  padding: 20px 26px;
  background: var(--panel);
}

.card-index {
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
}

.card-title {
  font-size: 19px;
  margin: 0 0 10px 0;
  font-weight: 700;
}

.card-body {
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
  color: var(--text-muted);
}

.card--placeholder {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(6, 9, 15, 0.3);
}

.card--placeholder .card-index {
  color: rgba(255, 255, 255, 0.4);
}

.card--placeholder .card-title {
  color: rgba(255, 255, 255, 0.5);
}

.card--placeholder .card-body {
  color: rgba(255, 255, 255, 0.45);
}

/* ---------- Motion ---------- */

@keyframes nc-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes nc-glitch {
  0% { transform: translateX(0); opacity: 1; }
  25% { transform: translateX(-3px); opacity: 0.55; }
  55% { transform: translateX(2px); opacity: 0.85; }
  80% { transform: translateX(-1px); opacity: 0.7; }
  100% { transform: translateX(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .main.is-glitching,
  .cursor {
    animation: none;
  }
}
