/* ============================================================
   Quant etc. — shared design system
   Black canvas, Satoshi, white text. Text and underlines only.
   ============================================================ */

/* ---- Fonts ---- */
@font-face {
  font-family: "Satoshi";
  src: url("../Satoshi_Complete/Fonts/WEB/fonts/Satoshi-Light.woff2") format("woff2");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../Satoshi_Complete/Fonts/WEB/fonts/Satoshi-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../Satoshi_Complete/Fonts/WEB/fonts/Satoshi-Italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../Satoshi_Complete/Fonts/WEB/fonts/Satoshi-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../Satoshi_Complete/Fonts/WEB/fonts/Satoshi-MediumItalic.woff2") format("woff2");
  font-weight: 500; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../Satoshi_Complete/Fonts/WEB/fonts/Satoshi-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../Satoshi_Complete/Fonts/WEB/fonts/Satoshi-BoldItalic.woff2") format("woff2");
  font-weight: 700; font-style: italic; font-display: swap;
}

/* ---- Tokens ---- */
:root {
  --ink: #ffffff;
  --ink-2: rgba(255, 255, 255, 0.72);
  --ink-3: rgba(255, 255, 255, 0.5);
  --paper: #000000;
  --measure: 760px;
  --font: "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.3, 1);
}

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

/* Form controls opt out of the page font unless told otherwise. */
input, textarea, select, button { font: inherit; color: inherit; }

::selection { background: #ffffff; color: #000000; }
::-moz-selection { background: #ffffff; color: #000000; }

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

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:where(a):focus-visible,
:where(button):focus-visible,
:where(input):focus-visible,
:where(textarea):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.visually-hidden {
  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;
}

/* ============================================================
   Text actions
   There are no buttons. An action is a bold word with a line
   under it. .btn is kept so form markup keeps working.
   ============================================================ */

.btn,
.text-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: inherit;
  font-weight: 700;
  font-size: inherit;
  letter-spacing: -0.02em;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 140ms linear;
}
.btn:hover, .text-link:hover { opacity: 0.6; }

.btn[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; opacity: 0.35; }
.btn[disabled]:hover, .btn[aria-disabled="true"]:hover { opacity: 0.35; }

/* ============================================================
   Fields
   A field is the line you write on.
   ============================================================ */

.field {
  display: block;
  width: 100%;
  padding: 0.6em 0;
  border: 0;
  border-bottom: 2px solid rgba(255, 255, 255, 0.25);
  background: none;
  color: var(--ink);
  font-weight: 500;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.4;
  transition: border-color 140ms linear;
}
.field::placeholder { color: var(--ink-3); }
.field:hover { border-bottom-color: rgba(255, 255, 255, 0.5); }
.field:focus { outline: none; border-bottom-color: var(--ink); }
.field:focus-visible { outline: none; }

.form-note {
  margin-top: 1.2em;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink-3);
  min-height: 1.4em;
}
.form-note[data-state="ok"],
.form-note[data-state="error"] { color: var(--ink); }

/* ============================================================
   Comments
   ============================================================ */

.comments {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 12vh 4vw 0;
}

.comments-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.comments-title {
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
}

.comments-count {
  color: var(--ink-3);
  font-weight: 500;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.comment-form { display: block; }

.comment-textarea {
  display: block;
  width: 100%;
  margin-top: 2.5rem;
  min-height: 120px;
  max-height: 60vh;
  padding: 0.6em 0;
  border: 0;
  border-bottom: 2px solid rgba(255, 255, 255, 0.25);
  background: none;
  color: var(--ink);
  font-family: inherit;
  font-weight: 500;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.5;
  resize: vertical;
  transition: border-color 140ms linear;
}
.comment-textarea::placeholder { color: var(--ink-3); }
.comment-textarea:hover { border-bottom-color: rgba(255, 255, 255, 0.5); }
.comment-textarea:focus { outline: none; border-bottom-color: var(--ink); }
.comment-textarea:focus-visible { outline: none; }

.comment-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px 24px;
  flex-wrap: wrap;
  margin-top: 1.6rem;
  font-size: 1.05rem;
}

.char-count {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}
.char-count[data-state="near"],
.char-count[data-state="full"] { color: var(--ink); }

.comment-list {
  list-style: none;
  margin-top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 0.6em;
}
.comment-author {
  font-weight: 700;
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  letter-spacing: -0.02em;
}
.comment-time { color: var(--ink-3); font-weight: 500; font-size: 0.95rem; }

.comment-body {
  font-weight: 400;
  font-size: clamp(1.08rem, 1.3vw, 1.2rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment-empty,
.comment-status {
  color: var(--ink-3);
  font-weight: 500;
  font-size: 1.1rem;
  line-height: 1.55;
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  padding: 14vh 4vw 6vw;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
  flex-wrap: wrap;
}
.footer-left {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  font-size: clamp(1.6rem, 4.2vw, 3.6rem);
}
.footer-right { display: flex; gap: 32px; }
.footer-right a {
  color: var(--ink-2);
  font-weight: 500;
  font-size: clamp(1.15rem, 1.6vw, 1.55rem);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: color 140ms linear;
}
.footer-right a:hover { color: var(--ink); }

/* ============================================================
   Mobile
   ============================================================ */

@media (max-width: 720px) {
  .comments { padding: 9vh 6vw 0; }
  .site-footer { padding: 12vh 6vw 10vw; flex-direction: column; align-items: flex-start; gap: 20px; }
  .footer-right { gap: 24px; }
}

/* ============================================================
   Newsletter card
   A small card that settles into the bottom-right corner. No
   backdrop, nothing blocked — the page stays readable behind it.
   It arrives once and remembers it was dealt with.
   ============================================================ */

.newsletter {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 100;
  width: min(320px, calc(100vw - 32px));
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 240ms var(--ease), transform 240ms var(--ease);
  /* Only the open card takes clicks. While it is faded out it must never
     swallow a click meant for the page underneath it. */
  pointer-events: none;
}
.newsletter[hidden] { display: none; }
.newsletter.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.newsletter-card {
  position: relative;
  background: #000000;
  border: 2px solid rgba(255, 255, 255, 0.18);
  padding: 24px;
}

.newsletter-title {
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-size: 1.35rem;
  padding-right: 24px; /* clears the dismiss × */
}

.newsletter-form { margin-top: 1.4rem; }
.newsletter-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.newsletter-row .field {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
}
.newsletter-form .form-note {
  margin-top: 0.9em;
  font-size: 0.92rem;
}

/* Bots fill hidden fields; humans never see this one. */
.newsletter-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.newsletter-close {
  position: absolute;
  top: 6px;
  right: 10px;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-weight: 500;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: color 140ms linear;
}
.newsletter-close:hover { color: var(--ink); }

/* The typewriter in the header is the only motion on this site. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
