/* ==========================================================================
   SWA — Short Wavelength Applications
   Black ink, white paper, and one colour that drifts down the spectrum.
   ========================================================================== */

:root {
  --ink: #0a0a0a;
  --ink-2: #141414;
  --paper: #f3f1ec;
  --white: #ffffff;
  --muted: rgba(255, 255, 255, 0.62);
  --faint: rgba(255, 255, 255, 0.14);
  --muted-ink: rgba(10, 10, 10, 0.64);

  /* Overwritten by js/main.js as the wavelength changes */
  --accent: #ff3b2f;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1320px;
  --frame: clamp(8px, 1.1vw, 14px); /* thickness of the logo's square frame */
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--white);
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

img, svg, canvas { display: block; }

a { color: inherit; }

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

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 16px; }


/* ── Nav ───────────────────────────────────────────────────────────────── */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter);
  mix-blend-mode: difference; /* stays legible over black and white sections */
  pointer-events: none;
}
.nav > * { pointer-events: auto; }

.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  font-variation-settings: "wdth" 112;
}
.nav__brand img {
  width: 36px;
  height: 36px;
  transition: transform 0.6s var(--ease);
}
.nav__brand:hover img { transform: rotate(-90deg); }

.nav__cta {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 10px 16px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  transition: background 0.25s, color 0.25s;
}
.nav__cta:hover { background: var(--white); color: var(--ink); }

/* ── Hero ──────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 104px var(--gutter) 40px;
  overflow: hidden;
}

.waves {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__title {
  position: relative;
  align-self: center;
  margin: 0;
  font-weight: 900;
  font-size: clamp(120px, 31vw, 520px);
  line-height: 0.8;
  letter-spacing: -0.035em;
  color: var(--white);
  font-variation-settings: "wdth" 112;
  mix-blend-mode: difference; /* letters invert where the waves pass through them */
  user-select: none;
}

.hero__foot { position: relative; }

.hero__copy {
  max-width: 560px;
  padding: 18px 22px 20px;
  margin: 0 0 0 -22px;
  background: var(--ink);
}
.hero__tag {
  margin: 0 0 8px;
  font-weight: 800;
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variation-settings: "wdth" 110;
}
.hero__lede { margin: 0 0 24px; color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 18px 26px;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
  letter-spacing: -0.01em;
  box-shadow: 0 0 0 0 var(--accent);
  transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
}
.btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.35s var(--ease);
}
.btn:hover { box-shadow: 0 0 0 6px var(--accent); transform: translateY(-2px); }
.btn:hover svg { transform: translateX(4px); }

.hero__hint {
  position: absolute;
  right: var(--gutter);
  top: 50%;
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white);
  mix-blend-mode: difference;
  writing-mode: vertical-rl;
  transform: translateY(-50%);
}
.hint-arrow { display: inline-block; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(6px); } }

/* ── Sections ──────────────────────────────────────────────────────────── */

.section {
  position: relative;
  padding: clamp(96px, 14vw, 180px) var(--gutter);
}
.section > * { max-width: var(--max); margin-left: auto; margin-right: auto; }

.section__title {
  margin: 0 auto clamp(40px, 6vw, 80px);
  font-weight: 900;
  font-size: clamp(44px, 7.4vw, 112px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  font-variation-settings: "wdth" 112;
}

/* Signal */

.signal { background: var(--paper); color: var(--ink); }
.signal .statement em { color: var(--muted-ink); }

.statement {
  margin: 0 auto;
  font-weight: 800;
  font-size: clamp(30px, 4.6vw, 66px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-variation-settings: "wdth" 104;
}
.statement em {
  font-style: normal;
  color: var(--muted);
}

.signal__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(32px, 6vw, 96px);
  margin-top: clamp(48px, 7vw, 96px);
  align-items: start;
}
.signal__body {
  margin: 0;
  max-width: 520px;
  font-size: 20px;
  color: var(--muted-ink);
}

/* "Currently on the bench", as a social post */
.post {
  background: var(--white);
  color: var(--ink);
  border: 1px solid rgba(10, 10, 10, 0.1);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(10, 10, 10, 0.04), 0 12px 32px -16px rgba(10, 10, 10, 0.18);
  font-size: 15px;
  line-height: 1.45;
  overflow: hidden;
}

.post__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px 0;
}
.post__avatar { width: 48px; height: 48px; flex: none; }
.post__who { flex: 1; min-width: 0; }
.post__name { margin: 0; font-weight: 700; font-size: 15px; line-height: 1.3; }
.post__meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted-ink);
}
.post__globe {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
}
.post__more { color: var(--muted-ink); letter-spacing: 1px; font-size: 12px; }

.post__body { padding: 12px 16px 4px; }
.post__body p { margin: 0 0 10px; }
.post__tags { color: #0a66c2; font-weight: 600; }

.post__stats {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 16px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(10, 10, 10, 0.1);
  font-size: 12px;
  color: var(--muted-ink);
}
.post__reactions { display: inline-flex; }
.post__reactions i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: -5px;
  border: 1.5px solid var(--white);
  border-radius: 50%;
  background: #e8eefa;
  font-style: normal;
  font-size: 10px;
}
.post__reactions i:nth-child(2) { background: #e6f3e0; }
.post__reactions i:nth-child(3) { background: #fdf0d5; }
.post__likers { margin-left: 8px; }
.post__counts { margin-left: auto; white-space: nowrap; }

.post__actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 4px 8px;
}
.post__act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 4px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted-ink);
  font: 600 14px/1 var(--display);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.post__act:hover { background: rgba(10, 10, 10, 0.06); color: var(--ink); }
.post__act svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.post__act[aria-pressed="true"] { color: #0a66c2; }
.post__act[aria-pressed="true"] svg { fill: currentColor; animation: pop 0.4s var(--ease); }
@keyframes pop { 40% { transform: scale(1.35) rotate(-12deg); } }

/* Redacted words: hover or focus to "declassify" */
.x {
  position: relative;
  display: inline-block;
  padding: 0 1px;
  border-radius: 2px;
  background: var(--ink);
  color: transparent;
  font-family: var(--mono);
  font-size: 0.9em;
  line-height: 1.15;
  letter-spacing: -0.05em;
  cursor: help;
}
.x::after {
  content: attr(data-reveal);
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  min-width: 100%;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  transform: translateX(-50%);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.35s var(--ease);
}
.x:hover::after,
.x:focus-visible::after { clip-path: inset(0 0 0 0); }
.x:focus-visible { outline-offset: 2px; }

/* Principles */

.plist {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  border-top: 1px solid var(--faint);
}

.p {
  display: grid;
  grid-template-columns: 140px minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 16px 32px;
  align-items: center;
  padding: clamp(24px, 3vw, 40px) 0;
  border-bottom: 1px solid var(--faint);
  transition: background 0.4s;
}
.p__wave {
  width: 120px;
  height: 28px;
  overflow: hidden;
}
.p__wave path {
  fill: none;
  stroke: var(--white);
  stroke-width: 3.5;
  stroke-linecap: round;
  animation: slide var(--dur, 3s) linear infinite;
  animation-play-state: paused;
}
.p:hover .p__wave path,
.p.in-view .p__wave path { animation-play-state: running; }
.p:hover .p__wave path { stroke: var(--accent); }

@keyframes slide { to { transform: translateX(calc(-1px * var(--period, 120))); } }

.p__t {
  margin: 0;
  font-weight: 800;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-variation-settings: "wdth" 108;
  transition: font-variation-settings 0.5s var(--ease);
}
.p:hover .p__t { font-variation-settings: "wdth" 124; }
.p__d { margin: 0; color: var(--muted); }

/* Frequencies — framed like the logo */

.bands { background: var(--paper); color: var(--ink); }

.bands__frame {
  border: var(--frame) solid var(--ink);
  padding: clamp(28px, 5vw, 72px);
}

.bands__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.5vw, 32px);
}

.band {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--ink);
  color: var(--white);
  transition: transform 0.45s var(--ease);
}
.band:hover { transform: translateY(-6px) rotate(-0.6deg); }

.band__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.band__id { color: var(--white); }

.band__wave {
  width: 100%;
  height: 80px;
  margin: 28px 0 32px;
  overflow: hidden;
}
.band__wave path {
  fill: none;
  stroke: var(--white);
  stroke-width: 7;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  animation: slide var(--dur, 4s) linear infinite;
}
.band:hover .band__wave path { stroke: var(--accent); }

.band__t {
  margin: 0 0 10px;
  font-weight: 900;
  font-size: clamp(28px, 2.8vw, 40px);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variation-settings: "wdth" 112;
}
.band__d { margin: 0; color: var(--muted); font-size: 16px; }

/* Contact */

.contact {
  --horizon: clamp(200px, 36vh, 360px);
  isolation: isolate;
  min-height: 100svh;
  padding-bottom: calc(var(--horizon) + 24px);
  overflow: hidden;
}
/* The waves roll in along the bottom, clear of the address */
.section > .waves { max-width: none; margin: 0; }
.contact .waves { inset: auto 0 0 0; height: var(--horizon); }
.contact__inner { position: relative; width: 100%; }

.contact__title {
  margin: 0 0 0.3em; /* the tight line-height lets descenders (the "y") hang below; clear them */
  font-weight: 900;
  font-size: clamp(88px, 19vw, 300px);
  line-height: 0.82;
  letter-spacing: -0.045em;
  font-variation-settings: "wdth" 120;
}
.contact__lede {
  max-width: 520px;
  margin: 0 0 40px;
  font-size: 20px;
  color: var(--muted);
}

.mail {
  display: inline-block;
  font-weight: 900;
  font-size: clamp(30px, 6.6vw, 100px);
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-variation-settings: "wdth" 100;
  text-decoration: none;
  overflow-wrap: anywhere;
  padding-bottom: 0.18em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='14' viewBox='0 0 40 14'%3E%3Cpath d='M0 7 Q10 0 20 7 T40 7' fill='none' stroke='white' stroke-width='3.5'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: 0 100%;
  background-size: 40px 14px;
  transition: color 0.3s;
}
.mail:hover { color: var(--accent); animation: squiggle 0.6s linear infinite; }
@keyframes squiggle { to { background-position: 40px 100%; } }

.contact__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
}
.copy {
  font: 600 13px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  background: transparent;
  border: 1.5px solid var(--faint);
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, color 0.25s;
}
.copy:hover { border-color: var(--white); }
.copy.is-done { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.copy__status { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* ── Footer ────────────────────────────────────────────────────────────── */

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  padding: 32px var(--gutter) 96px;
  border-top: 1px solid var(--faint);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.footer__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--white);
  text-transform: uppercase;
}
.footer__meta { margin: 0; }
.footer__mail { text-decoration: none; }
.footer__mail:hover { color: var(--accent); }

/* ── λ readout ─────────────────────────────────────────────────────────── */

.lambda {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas:
    "swatch value"
    "swatch band"
    "bar    bar";
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  padding: 10px 12px 10px 10px;
  background: rgba(10, 10, 10, 0.86);
  border: 1px solid var(--faint);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--mono);
  color: var(--white);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s, transform 0.5s var(--ease);
}
.lambda.is-on { opacity: 1; transform: none; }

.lambda__swatch {
  grid-area: swatch;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent);
}
.lambda__value { grid-area: value; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.lambda__band { grid-area: band; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.lambda__bar {
  grid-area: bar;
  position: relative;
  height: 3px;
  margin-top: 8px;
  border-radius: 2px;
  background: linear-gradient(90deg, #ff2a1a, #ff9a1a, #ffe81a, #2bd96b, #1a8cff, #6a3bff, #c9b8ff, #fff);
}
.lambda__bar i {
  position: absolute;
  top: -3px;
  left: var(--p, 0%);
  width: 2px;
  height: 9px;
  background: var(--white);
  transform: translateX(-50%);
}

/* ── Toast (easter egg) ────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 70;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font: 600 13px/1 var(--mono);
  letter-spacing: 0.06em;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ── Reveal on scroll ──────────────────────────────────────────────────── */

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.js .reveal.in-view { opacity: 1; transform: none; }

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 960px) {
  .signal__grid { grid-template-columns: 1fr; }
  .bands__grid { grid-template-columns: 1fr; }
  .p { grid-template-columns: minmax(0, 1fr); }
  .p__wave { justify-self: start; }
}

@media (max-width: 640px) {
  body { font-size: 17px; }
  .nav { padding: 14px 16px; }
  .nav__brand span { display: none; }
  .hero { padding-top: 88px; }
  .hero__title { font-size: 35vw; }
  .hero__hint { display: none; }
  .hero__copy { margin-left: -16px; padding: 14px 16px 16px; }
  .btn { width: 100%; justify-content: space-between; font-size: 16px; padding: 16px 22px; }
  .footer { padding-bottom: 104px; }
  .lambda__band { display: none; }
  .post__act span { display: none; }
  .post__counts { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
