/* =========================================================
   Zachary Schroeder — personal site
   Graphic-realism (ANTIREAL / Marathon poster) treatment
   on a paper-white ground, Dieter Rams restraint underneath:
   one grid, one accent, no ornament that isn't doing work.
   ========================================================= */

:root {
  --bg: #fbfaf6;
  --ink: #15130f;
  --ink-soft: #55503f;
  --accent: #d8451c;
  --accent-deep: #a3330f;
  --teal: #0f4c4c;
  --green: #cfff04;
  --green-deep: #7c9900;
  --magenta: #ff2e9a;
  --line: rgba(21, 19, 15, 0.16);
  --line-strong: rgba(21, 19, 15, 0.9);

  --font-display: "Archivo", "Arial Narrow", sans-serif;
  --font-hero: "Big Shoulders Display", "Archivo", "Arial Narrow", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", monospace;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 1180px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

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

ul {
  list-style: none;
}

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

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

/* focus states — visible everywhere, no exceptions */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--gutter);
  background: rgba(251, 250, 246, 0.86);
  backdrop-filter: blur(6px) saturate(1.1);
  border-bottom: 1px solid var(--line);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.mark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.mark-dot {
  color: var(--accent);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--green);
  color: var(--ink);
  padding: 0.32rem 0.65rem 0.32rem 0.55rem;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  animation: statusPulse 1.6s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* ---------- pi stats (live, header) ---------- */
.pi-stats {
  display: flex;
  align-items: stretch;
  opacity: 0;
  transform: translateY(-2px);
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.pi-stats.is-live {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.pi-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
  padding: 0 1.1rem;
  border-left: 1px solid var(--line);
  min-width: 4.6rem;
}

.pi-stat:first-child {
  border-left: none;
  padding-left: 0;
}

.pi-stat-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.pi-stat-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.pi-stat-meter {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--line);
  overflow: hidden;
  border-radius: 1px;
}

.pi-stat-fill {
  display: block;
  height: 100%;
  width: 0%;
  transition: width 0.7s ease;
}

.pi-stat[data-stat="temp"] .pi-stat-fill { background: var(--accent); }
.pi-stat[data-stat="cpu"] .pi-stat-fill { background: var(--magenta); }
.pi-stat[data-stat="ghz"] .pi-stat-fill { background: var(--teal); }
.pi-stat[data-stat="ram"] .pi-stat-fill { background: var(--green-deep); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 6rem var(--gutter) 4rem;
  overflow: hidden;
  border-bottom: 2px solid var(--ink);
}

.hero-halftone {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 780px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 1.4rem;
}

.hero-title {
  position: relative;
  font-family: var(--font-hero);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.88;
  font-size: clamp(3.2rem, 11vw, 8.4rem);
  letter-spacing: 0.005em;
}

.hero-title > span {
  display: block;
}

.hero-title > span:last-child {
  color: var(--accent);
}

.hero-tagline {
  margin-top: 1.75rem;
  max-width: 34rem;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--ink-soft);
}

.scroll-cue {
  margin-top: 3.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
}

.scroll-cue-line {
  width: 34px;
  height: 1px;
  background: var(--ink);
}

.scroll-cue-text {
  background-image: linear-gradient(
    90deg,
    var(--ink) 40%,
    var(--accent) 50%,
    var(--ink) 60%
  );
  background-size: 300% 100%;
  background-repeat: no-repeat;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: cue 13s ease-in-out infinite;
}

@keyframes cue {
  0% { background-position: 100% 0; }
  16% { background-position: 0% 0; }
  100% { background-position: 0% 0; }
}

.hero-shape-wrap {
  position: absolute;
  right: clamp(4rem, 8vw, 9rem);
  top: 50%;
  transform: translateY(-50%);
  width: min(78vw, 350px);
  z-index: 1;
}

.cluster-panel {
  position: relative;
  border: 1.5px solid var(--ink);
  background: var(--bg);
}

.cluster-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.cluster-panel-head span:first-child {
  color: var(--ink);
  font-weight: 600;
}

.cluster-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

.cluster-table th,
.cluster-table td {
  padding: 0.5rem 0.4rem;
  text-align: left;
  white-space: nowrap;
}

.cluster-table th {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}

.cluster-table td {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.cluster-table td:first-child {
  color: var(--accent-deep);
  font-weight: 600;
}

.cluster-table tbody tr {
  border-top: 1px solid var(--line);
}

.cluster-table tbody tr.is-unreachable td {
  color: var(--ink-soft);
  opacity: 0.55;
}

.hero-tag {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(1.5rem, 4vw, 3rem);
  z-index: 2;
}

@media (max-width: 900px) {
  .tag-chip.hero-tag { display: none; }
}

/* ---------- glitch / exploded letter ---------- */
.glitch-char {
  position: relative;
  display: inline-block;
}

.glitch-char::before,
.glitch-char::after {
  content: attr(data-ch);
  position: absolute;
  inset: 0;
  opacity: 0;
}

.glitch-char.is-glitching::before {
  opacity: 1;
  clip-path: polygon(0 0, 100% 0, 100% 42%, 0 42%);
  transform: translate(-0.09em, -0.07em);
  color: var(--green-deep);
}

.glitch-char.is-glitching::after {
  opacity: 1;
  clip-path: polygon(0 58%, 100% 58%, 100% 100%, 0 100%);
  transform: translate(0.09em, 0.06em);
  color: var(--magenta);
}

/* variant 1 — RGB split shift */
.hero-title.glitch-rgb {
  animation: glitchRGB 220ms steps(2, end);
}

@keyframes glitchRGB {
  0% { transform: translate(0, 0); text-shadow: none; }
  20% { transform: translate(-2px, 1px); text-shadow: 2px 0 var(--magenta), -2px 0 var(--green-deep); }
  40% { transform: translate(2px, -1px); text-shadow: -2px 0 var(--accent), 2px 0 var(--teal); }
  60% { transform: translate(-1px, 0); text-shadow: 1px 0 var(--magenta), -1px 0 var(--green-deep); }
  80% { transform: translate(1px, 1px); text-shadow: none; }
  100% { transform: translate(0, 0); text-shadow: none; }
}

/* variant 2 — jitter shake */
.hero-title.glitch-shake {
  animation: glitchShake 220ms steps(2, end);
}

@keyframes glitchShake {
  0% { transform: translate(0, 0) skewX(0deg); }
  15% { transform: translate(-3px, 2px) skewX(-3deg); }
  30% { transform: translate(3px, -2px) skewX(2deg); }
  45% { transform: translate(-2px, 1px) skewX(-1deg); }
  60% { transform: translate(2px, -1px) skewX(1deg); }
  80% { transform: translate(-1px, 0) skewX(0deg); }
  100% { transform: translate(0, 0) skewX(0deg); }
}

/* variant 3 — signal flicker */
.hero-title.glitch-flicker {
  animation: glitchFlicker 220ms steps(2, end);
}

@keyframes glitchFlicker {
  0%, 100% { opacity: 1; }
  20% { opacity: 0.25; }
  35% { opacity: 1; }
  50% { opacity: 0.15; }
  65% { opacity: 1; }
  80% { opacity: 0.4; }
}

/* variant 4 — slice tear */
.hero-title.glitch-slice {
  animation: glitchSlice 220ms steps(2, end);
}

@keyframes glitchSlice {
  0% { clip-path: inset(0 0 0 0); transform: translateX(0); }
  15% { clip-path: inset(0 0 0 0); transform: translateX(9px); }
  30% { clip-path: inset(0 4% 0 0); transform: translateX(-8px); }
  45% { clip-path: inset(0 0 0 3%); transform: translateX(6px); }
  60% { clip-path: inset(0 0 0 0); transform: translateX(-5px); }
  80% { clip-path: inset(0 0 0 0); transform: translateX(2px); }
  100% { clip-path: inset(0 0 0 0); transform: translateX(0); }
}

/* ---------- technical UI marks ---------- */
.ui-mark {
  position: absolute;
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.ui-mark--cross::before,
.ui-mark--cross::after {
  content: "";
  position: absolute;
  background: var(--magenta);
}

.ui-mark--cross::before {
  left: 50%;
  top: 0;
  width: 1.5px;
  height: 100%;
  transform: translateX(-50%);
}

.ui-mark--cross::after {
  top: 50%;
  left: 0;
  height: 1.5px;
  width: 100%;
  transform: translateY(-50%);
}

/* ---------- tag chip (barcode sticker) ---------- */
.tag-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  width: max-content;
}

.tag-code {
  color: var(--ink);
  font-weight: 600;
}

.tag-barcode {
  display: block;
  font-family: "Libre Barcode 39", cursive;
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: nowrap;
}

/* ---------- section rhythm ---------- */
section {
  padding: clamp(4.5rem, 9vw, 7.5rem) var(--gutter);
  max-width: var(--max);
  margin-inline: auto;
}

/* ---------- footer ---------- */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.75rem var(--gutter) 2.5rem;
  max-width: var(--max);
  margin-inline: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}

.footer-mark {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--ink);
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .hero-shape-wrap {
    position: static;
    transform: none;
    width: 100%;
    margin-top: 2.5rem;
  }

  .cluster-table {
    font-size: 0.66rem;
  }
}

@media (max-width: 480px) {
  .cluster-table th:nth-child(4),
  .cluster-table td:nth-child(4) {
    display: none; /* drop the Clock column on very small screens */
  }
}

@media (max-width: 900px) {
  .pi-stats { display: none; }
}

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

@media (max-width: 480px) {
  .mark { font-size: 1.15rem; }
}
