/* absurd.vision — business card page. No JS, no third-party requests. */

@font-face {
  font-family: "Saira";
  src: url("fonts/saira-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-stretch: 100% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+2010-2027, U+2030, U+2039-203A, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: "Saira";
  src: url("fonts/saira-pl.woff2") format("woff2");
  font-weight: 300 700;
  font-stretch: 100% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0104-0107, U+0118-0119, U+0141-0144, U+015A-015B, U+0179-017C;
}

:root {
  --graphite: #07090b;   /* page */
  --steel: #d5dce1;      /* primary text, brushed-steel highlight */
  --pewter: #8e9ba5;     /* secondary text (7:1 on graphite) */
  --edge: #7cc3cd;       /* the logo's edge light: links, focus */
  --amber: #e3a33b;      /* status LED only */
  --hairline: rgb(124 195 205 / 0.16);

  --logo: min(440px, 76vw, 44vh);
  --font: "Saira", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
@supports (height: 1svh) {
  :root { --logo: min(440px, 76vw, 44svh); }
}

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

html {
  background: var(--graphite);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--graphite);
  color: var(--steel);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 400;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* film grain: dithers the dark light field so it does not band */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("grain.png") repeat;
}

::selection { background: rgb(124 195 205 / 0.32); color: #fff; }

p, h1 { margin: 0; }

a {
  color: var(--edge);
  text-decoration: underline;
  text-decoration-color: var(--hairline);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: text-decoration-color 0.2s;
}
a:hover { text-decoration-color: var(--edge); }
a:focus-visible {
  outline: 2px solid var(--edge);
  outline-offset: 3px;
  border-radius: 2px;
  text-decoration: none;
}

/* ---- stage ------------------------------------------------------------ */

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.75rem, 4.5vh, 3rem);
  padding: clamp(2rem, 7vh, 4.5rem) 1.25rem clamp(1.5rem, 4vh, 3rem);
  text-align: center;
  overflow: hidden;  /* fallback for Safari < 16 */
  overflow: clip;    /* the glow behind the logo must not widen the page on phones */
}

/* the logo is brushed metal: the only effect on the page is light on it */
.mark {
  position: relative;
  isolation: isolate;
  width: var(--logo);
  aspect-ratio: 880 / 871;
}
.mark::before {                      /* faint cool light behind the metal */
  content: "";
  position: absolute;
  inset: -45% -55%;
  z-index: -1;
  background: radial-gradient(closest-side,
    rgb(124 195 205 / 0.080) 0%,
    rgb(124 195 205 / 0.050) 30%,
    rgb(124 195 205 / 0.022) 55%,
    rgb(124 195 205 / 0.007) 78%,
    rgb(124 195 205 / 0) 100%);
  pointer-events: none;
}
.mark picture,
.mark img {
  display: block;
  width: 100%;
  height: auto;
}
.mark__sheen {                       /* light sweep, clipped to the metal */
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask: url("logo-mask.webp") center / 100% 100% no-repeat;
  mask: url("logo-mask.webp") center / 100% 100% no-repeat;
}
.mark__sheen::before {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -50%;
  width: 34%;
  background: linear-gradient(90deg,
    rgb(255 255 255 / 0) 0%,
    rgb(236 246 249 / 0.08) 28%,
    rgb(246 251 253 / 0.50) 50%,
    rgb(236 246 249 / 0.08) 72%,
    rgb(255 255 255 / 0) 100%);
  transform: translateX(0) skewX(-16deg);
  opacity: 0;
}

/* ---- text ------------------------------------------------------------- */

.intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 40rem;
}

.wordmark {                          /* rhymes with the logo's wide letterforms */
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.625rem);
  font-weight: 600;
  font-stretch: 125%;
  letter-spacing: 0.05em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--steel);
}

.lede {
  margin-top: 0.5rem;
  font-size: clamp(1.125rem, 1rem + 0.55vw, 1.375rem);
  font-weight: 400;
  line-height: 1.35;
  color: var(--steel);
  text-wrap: balance;
}

.about {
  margin-top: 0.875rem;
  max-width: 34rem;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--pewter);
  text-wrap: balance;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: clamp(1.25rem, 3.5vh, 1.75rem);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--steel);
}
.status__led {                       /* a network appliance's status light: amber = not in service yet */
  width: 0.5rem;
  height: 0.5rem;
  flex: none;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 1px rgb(227 163 59 / 0.35), 0 0 10px 1px rgb(227 163 59 / 0.45);
}

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

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  margin: 0 clamp(1.25rem, 4vw, 3rem);
  padding: 1.125rem 0 1.375rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.875rem;
  color: var(--pewter);
}

@media (max-width: 34rem) {
  .foot {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* ---- 404 -------------------------------------------------------------- */

.stage--404 { --logo: min(220px, 52vw, 30vh); }
.mark--link { display: block; border-radius: 4px; }
.back { margin-top: 1.5rem; font-size: 0.9375rem; font-weight: 500; }

/* ---- one orchestrated moment: the metal is lit, light runs across it --- */

@media (prefers-reduced-motion: no-preference) {
  .mark picture { animation: light-up 1.6s cubic-bezier(0.2, 0.6, 0.2, 1) both; }
  .mark__sheen::before { animation: sweep 1.5s cubic-bezier(0.45, 0.05, 0.25, 1) 1.15s both; }
  .intro { animation: resolve 0.9s ease-out 0.8s both; }
  .status__led { animation: blink 2.6s ease-in-out 2.4s infinite; }
}

@keyframes light-up {
  from { opacity: 0; filter: brightness(0.3); }
  to   { opacity: 1; filter: none; }
}
@keyframes sweep {
  0%   { transform: translateX(0) skewX(-16deg); opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateX(470%) skewX(-16deg); opacity: 0; }
}
@keyframes resolve {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
