/* swaap.finance — one page, one column.
   Type: Montserrat (self-hosted) for text, system mono for metadata.
   Colors: Swaap brand guidelines. Flat surfaces, no rules, no boxes. */

@font-face {
  font-family: "Montserrat";
  src: url("/fonts/montserrat-regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("/fonts/montserrat-semi-bold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

/* ---------------------------------------------------------------- tokens */

:root {                                 /* default: the flashy purple, white type */
  --bg: #4a1dcb;
  --ink: #ffffff;
  --dim: #c9bdf3;                        /* secondary text, metadata — 5.2:1 on the purple */
  --link: #beafef;
  --lav: #beafef;
  --word: #ffffff;                       /* footer 'swaap' */

  --sans: "Montserrat", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;

  --text: 15px;                          /* body / list text */
  --meta: 13px;                          /* mono metadata */
  --measure: 40rem;
  --section-gap: 2.75rem;
  --row-gap: 0.55rem;
}
:root[data-theme="light"] {             /* white, navy type */
  --bg: #ffffff;
  --ink: #01013d;
  --dim: #7065b6;                        /* 5.0:1 on white (AA for small text) */
  --link: #4a1dcb;
  --lav: #aa9af0;
  --word: #4a1dcb;
}

/* ---------------------------------------------------------------- base */

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.65 var(--sans);
  font-feature-settings: "tnum", "kern";
  text-transform: lowercase;             /* the page reads lowercase; markup keeps real casing */
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 4rem;
}

h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }   /* hover: underline, colour unchanged */
a:focus-visible { outline: 2px solid var(--lav); outline-offset: 3px; border-radius: 2px; }

/* ---------------------------------------------------------------- masthead */

.masthead { margin-bottom: var(--section-gap); }

.mark-btn {
  appearance: none; -webkit-appearance: none;
  display: block; padding: 0; margin: 0; border: 0; background: none;
  color: var(--ink); cursor: pointer; line-height: 0;
}
.mark-btn:focus-visible { outline: 2px solid var(--lav); outline-offset: 6px; border-radius: 4px; }
.mark { display: block; transform-origin: 50% 60%; }
@media (prefers-reduced-motion: no-preference) {
  .mark-btn:hover .mark { animation: swim 1.6s ease-in-out infinite; }
  @keyframes swim {                      /* a whale, bobbing */
    0%   { transform: translateY(0) rotate(0deg); }
    25%  { transform: translateY(-2px) rotate(-5deg); }
    50%  { transform: translateY(0) rotate(0deg); }
    75%  { transform: translateY(2px) rotate(5deg); }
    100% { transform: translateY(0) rotate(0deg); }
  }
}

/* ---------------------------------------------------------------- title */

h1 {
  font-size: clamp(1.8125rem, 4.2vw, 2.6625rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
}

.tagline {
  font-size: clamp(1.1625rem, 2vw, 1.4125rem);
  line-height: 1.35;
  max-width: var(--measure);
}

/* ---------------------------------------------------------------- sections */

section { margin-top: var(--section-gap); }

h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
}

.about {
  max-width: var(--measure);
  font-size: var(--text);
  line-height: 1.7;
}

/* publications — title left, identifier right */

.pubs li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0 1.5rem;
  padding: var(--row-gap) 0;
}
.pubs time { display: none; }           /* kept in markup for machines */
.pubs a { color: var(--ink); font-size: var(--text); }
.pubs a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }   /* hover: underline, colour unchanged */
.pubs .meta { font-family: var(--mono); font-size: var(--meta); color: var(--dim); white-space: nowrap; }
.pubs .meta:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }   /* hover: underline, colour unchanged */

/* docs — heading and link on one line */

.docs-row { display: flex; align-items: baseline; gap: 1.25rem; }
.docs-row h2 { margin: 0; }
.docs-row a { font-size: var(--text); color: var(--ink); }   /* same as the publication titles */

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

footer {
  margin-top: 3.5rem;
  font-family: var(--mono);
  font-size: var(--meta);
  color: var(--dim);
}
footer .tick { color: var(--word); display: inline-block; min-width: 5ch; }
footer a { color: inherit; }
footer a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }   /* hover: underline, colour unchanged */

/* ---------------------------------------------------------------- small screens */

@media (max-width: 40rem) {
  main { padding: 2.25rem 1rem 3rem; }
  .masthead { margin-bottom: 2rem; }
  .pubs li { grid-template-columns: 1fr; gap: 0.15rem; }
  .pubs .meta { white-space: normal; }
  .docs-row { flex-wrap: wrap; gap: 0.25rem 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media print {
  a { color: inherit; }
  .pubs time { display: inline; margin-right: 1ch; }
}
