@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Spline Sans Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/spline-sans-mono-regular.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --page-bg: #05070d;
  --page-ink: #eee7dc;
  --page-soft: #bdb8ae;
  --page-muted: #77808a;
  --page-faint: rgba(238, 231, 220, 0.14);
  --panel: rgba(12, 18, 28, 0.74);
  --panel-strong: rgba(11, 16, 25, 0.94);
  --panel-border: rgba(238, 231, 220, 0.08);
  --teal: #82d2d2;
  --amber: #eda75a;
  --ember: rgba(218, 109, 77, 0.2);
  --shadow: rgba(0, 0, 0, 0.56);
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "Spline Sans Mono", "SFMono-Regular", Consolas, monospace;
  --edge: clamp(20px, 5vw, 78px);
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page-bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--page-ink);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.46), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.42)),
    linear-gradient(180deg, #060b13 0%, #071019 48%, #07070c 100%);
  font-family: var(--serif);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.62;
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(1px 1px at 90px 70px, rgba(190, 230, 240, 0.38), transparent 60%),
    radial-gradient(1px 1px at 150px 24px, rgba(255, 224, 184, 0.42), transparent 60%),
    radial-gradient(1px 1px at 60px 130px, rgba(255, 255, 255, 0.26), transparent 60%),
    radial-gradient(1px 1px at 175px 160px, rgba(205, 228, 255, 0.34), transparent 60%);
  background-repeat: repeat;
  background-size: 230px 230px;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.17;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 34%),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 3px,
      rgba(255, 255, 255, 0.06) 4px
    );
  mix-blend-mode: screen;
}

button,
a {
  color: inherit;
}

button {
  font: inherit;
}

a {
  text-decoration: none;
}

:focus-visible {
  outline: 1px solid var(--amber);
  outline-offset: 5px;
}

.skip-link {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 30;
  padding: 10px 13px;
  color: #071019;
  background: var(--page-ink);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.78rem;
  transform: translateY(-150%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(140deg, transparent 0%, rgba(27, 46, 49, 0.32) 38%, transparent 66%),
    linear-gradient(28deg, rgba(70, 52, 50, 0.26), transparent 36%);
  opacity: 0.9;
}

.site-header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px var(--edge) 12px;
  pointer-events: none;
}

.identity,
.motion-controls {
  pointer-events: auto;
}

.identity {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  color: rgba(238, 231, 220, 0.78);
}

.identity__name {
  font-size: 1.15rem;
  line-height: 1;
}

.identity__descriptor,
.specimen,
.control-button,
.contact-links,
.fallback-notes {
  font-family: var(--mono);
}

.identity__descriptor {
  color: var(--page-muted);
  font-size: 0.72rem;
}

.motion-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.no-js .motion-controls {
  display: none;
}

.capture-og .motion-controls {
  display: none;
}

.capture-og .site-header {
  padding-top: 34px;
}

.control-button {
  min-height: 34px;
  padding: 8px 11px;
  border: 1px solid rgba(238, 231, 220, 0.14);
  border-radius: 3px;
  color: rgba(238, 231, 220, 0.68);
  background: rgba(5, 7, 13, 0.48);
  cursor: pointer;
  font-size: 0.72rem;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.control-button:hover,
.control-button:focus-visible,
.control-button[aria-pressed="true"] {
  color: var(--page-ink);
  border-color: rgba(237, 167, 90, 0.54);
  background: rgba(237, 167, 90, 0.08);
}

main {
  position: relative;
  z-index: 1;
}

.thought {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 112px var(--edge) 72px;
}

.thought__inner {
  width: min(100%, 1280px);
  margin: 0 auto;
}

.specimen {
  margin: 0 0 26px;
  color: var(--page-muted);
  font-size: 0.78rem;
}

.thought__stage {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thought__sentence,
.typed-sentence {
  width: min(100%, 600px);
  margin: 0;
  color: var(--page-ink);
  font-family: var(--serif);
  font-size: 3.75rem;
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: 0;
}

.thought__sentence {
  position: relative;
  z-index: 3;
  transition: opacity 260ms ease;
}

.typed-sentence {
  position: absolute;
  z-index: 4;
  display: none;
  pointer-events: none;
  white-space: pre-wrap;
}

.typed-sentence::after {
  content: "";
  display: inline-block;
  width: 0.36em;
  height: 0.78em;
  margin-left: 0.1em;
  border-radius: 2px;
  background: var(--amber);
  box-shadow: 0 0 16px rgba(237, 167, 90, 0.66);
  transform: translateY(0.08em);
  animation: cursor-blink 1.1s steps(1) infinite;
}

.thought.is-typing .thought__sentence {
  opacity: 0;
  pointer-events: none;
}

.thought.is-typing .typed-sentence {
  display: block;
}

.thought.is-complete .typed-sentence {
  display: none;
}

.mark {
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--mark-color, var(--teal)) 50%, transparent);
  color: inherit;
  background: transparent;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, text-shadow 180ms ease;
}

.mark[data-tone="amber"] {
  --mark-color: var(--amber);
}

.mark[data-tone="teal"] {
  --mark-color: var(--teal);
}

.mark:hover,
.mark:focus-visible,
.mark[aria-expanded="true"] {
  color: #fffaf1;
  border-color: var(--mark-color, var(--teal));
  text-shadow: 0 0 18px color-mix(in srgb, var(--mark-color, var(--teal)) 28%, transparent);
}

.mark sup {
  margin-left: 0.05em;
  color: var(--mark-color, var(--teal));
  font-family: var(--mono);
  font-size: 0.35em;
  font-weight: 500;
  line-height: 0;
  text-shadow: 0 0 8px color-mix(in srgb, var(--mark-color, var(--teal)) 55%, transparent);
  vertical-align: 0.68em;
}

.connectors {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.connector-path {
  fill: none;
  stroke-width: 1;
  stroke-linejoin: round;
  opacity: 0.76;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw-line 520ms var(--ease) forwards;
}

.connector-dot {
  opacity: 0.85;
}

.note-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.note-card {
  position: absolute;
  width: min(252px, 20vw);
  padding: 14px 16px 15px;
  color: var(--page-ink);
  background: var(--panel-strong);
  border: 1px solid color-mix(in srgb, var(--note-color, var(--teal)) 48%, transparent);
  box-shadow: 0 18px 42px var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  pointer-events: auto;
  animation: note-in 360ms ease both;
}

.note-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.note-card__label {
  color: var(--note-color, var(--teal));
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  text-shadow: 0 0 10px color-mix(in srgb, var(--note-color, var(--teal)) 44%, transparent);
}

.note-card__close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 3px;
  color: rgba(238, 231, 220, 0.62);
  background: transparent;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 1.15rem;
  line-height: 1;
}

.note-card__close:hover,
.note-card__close:focus-visible {
  color: var(--page-ink);
  background: rgba(255, 255, 255, 0.06);
}

.note-card__body {
  margin: 0;
  color: rgba(238, 231, 220, 0.88);
  font-size: 1.18rem;
  line-height: 1.42;
}

.mobile-note-layer {
  display: none;
}

.fallback-notes {
  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;
}

.conversation {
  min-height: 88svh;
  display: flex;
  align-items: center;
  padding: 112px var(--edge);
}

.conversation__inner {
  width: min(100%, 720px);
}

.conversation h2 {
  margin: 0;
  color: var(--page-ink);
  font-family: var(--serif);
  font-size: 3.25rem;
  font-weight: 400;
  line-height: 1.1;
}

.conversation p {
  max-width: 55ch;
  margin: 24px 0 0;
  color: rgba(238, 231, 220, 0.72);
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.75;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin-top: 30px;
  font-size: 0.82rem;
}

.contact-links a {
  color: rgba(238, 231, 220, 0.78);
  border-bottom: 1px solid rgba(130, 210, 210, 0.34);
  padding-bottom: 4px;
  transition: color 180ms ease, border-color 180ms ease;
}

.contact-links a:hover,
.contact-links a:focus-visible {
  color: var(--page-ink);
  border-color: var(--amber);
}

.conversation .signature {
  margin-top: 54px;
  color: rgba(238, 231, 220, 0.42);
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.2;
}

.error-page {
  min-height: 100svh;
}

.error-shell {
  position: relative;
  z-index: 1;
  width: min(100% - 40px, 720px);
  min-height: 100svh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 0;
}

.error-shell h1 {
  max-width: 620px;
  margin: 0;
  color: var(--page-ink);
  font-family: var(--serif);
  font-size: clamp(3rem, 8vw, 6.4rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
}

.error-shell p:not(.specimen) {
  max-width: 460px;
  margin: 28px 0 0;
  color: var(--page-soft);
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.7;
}

.error-shell .contact-links {
  margin-top: 36px;
}

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

@keyframes note-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes draw-line {
  to {
    stroke-dashoffset: 0;
  }
}

@media (min-width: 1120px) {
  .thought--first .note-card:nth-child(1) {
    right: 0;
    top: 15%;
  }

  .thought--first .note-card:nth-child(2) {
    left: 0;
    top: 28%;
  }

  .thought--first .note-card:nth-child(3) {
    right: 0;
    top: 58%;
  }

  .thought--first .note-card:nth-child(4) {
    left: 0;
    top: 68%;
  }

  .thought--second .note-card:nth-child(1) {
    right: 0;
    top: 22%;
  }

  .thought--second .note-card:nth-child(2) {
    left: 0;
    top: 31%;
  }

  .thought--second .note-card:nth-child(3) {
    right: 0;
    top: 60%;
  }

  .thought--second .note-card:nth-child(4) {
    left: 0;
    top: 66%;
  }
}

@media (max-width: 1119px) {
  .thought__stage {
    min-height: auto;
    justify-content: flex-start;
  }

  .thought__sentence,
  .typed-sentence {
    width: min(100%, 620px);
    font-size: 3rem;
  }

  .note-layer,
  .connectors {
    display: none;
  }

  .mobile-note-layer {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: min(100%, 620px);
    margin-top: 30px;
  }

  .mobile-note-layer .note-card {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .site-header {
    position: absolute;
    flex-direction: column;
    align-items: stretch;
    padding-top: 22px;
  }

  .identity {
    width: fit-content;
  }

  .motion-controls {
    justify-content: flex-start;
  }

  .thought {
    min-height: 100svh;
    padding-top: 172px;
    padding-bottom: 64px;
  }

  .thought__inner {
    margin-top: -72px;
  }

  .thought__sentence,
  .typed-sentence {
    width: 100%;
    font-size: 2.25rem;
    line-height: 1.24;
  }

  .specimen {
    margin-bottom: 22px;
  }

  .conversation {
    min-height: 78svh;
    padding-top: 90px;
    padding-bottom: 90px;
  }

  .conversation h2 {
    font-size: 2.6rem;
  }

  .conversation p {
    font-size: 0.88rem;
  }
}

@media (max-width: 430px) {
  .thought__sentence,
  .typed-sentence {
    font-size: 2rem;
  }

  .contact-links {
    gap: 18px;
  }
}

@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;
  }

  .typed-sentence {
    display: none !important;
  }

  .thought__sentence {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}
