/* blue-wave.net: "sea chart" stylesheet. Hand written, no framework. */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-roman.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/plexmono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/plexmono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f2eee3;
  --paper-2: #ebe5d5;
  --land: #e6d9b4;
  --land-edge: #b9a46d;
  --shoal: #cfe2ea;
  --shoal-2: #e2edf0;
  --ink: #142235;
  --ink-soft: #3b4a5e;
  --sea: #1b4f86;
  --magenta: #a3226f;
  --rule: rgba(20, 34, 53, .22);
  --serif: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --gutter: clamp(1.1rem, 4vw, 3.25rem);
  --measure: 38rem;
}

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

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

body {
  margin: 0;
  background-color: var(--paper-2);
  /* graticule: a faint chart grid behind the sheet */
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 160px 160px;
  background-position: -1px -1px;
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: clamp(1.05rem, .98rem + .3vw, 1.2rem);
  line-height: 1.6;
  font-variant-numeric: oldstyle-nums;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--sea); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--magenta); text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--magenta);
  outline-offset: 3px;
}

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper); padding: .6rem 1rem; z-index: 10;
  font-family: var(--mono); font-size: .85rem;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- the sheet: a chart with a graduated neatline ---------- */
.sheet {
  --tick: 10px;
  position: relative;
  max-width: 1200px;
  margin: clamp(0px, 2.5vw, 2.5rem) auto;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: calc(var(--tick) * -1 - 3px);
  padding: 0 calc(var(--tick) + var(--gutter));
}
.sheet::before, .sheet::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: var(--tick);
  background: repeating-linear-gradient(to bottom, var(--ink) 0 30px, var(--paper) 30px 60px);
  border-right: 1px solid var(--ink);
}
.sheet::before { left: 0; }
.sheet::after { right: 0; border-right: 0; border-left: 1px solid var(--ink); }
@media (max-width: 640px) {
  .sheet { --tick: 6px; margin: 0; border-width: 0 0 1.5px; }
}

/* ---------- masthead ---------- */
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: clamp(1.25rem, 3vw, 2rem) 0 1.1rem;
  border-bottom: 1px solid var(--ink);
}
.cartouche {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  color: var(--ink);
  text-decoration: none;
  border: 1.5px solid var(--ink);
  padding: .45rem 1rem .45rem .55rem;
  box-shadow: 4px 4px 0 var(--shoal);
}
.cartouche:hover { color: var(--sea); }
.cartouche__mark { width: 2.6rem; height: 2.6rem; color: var(--sea); flex: none; }
.cartouche__text { display: flex; flex-direction: column; line-height: 1.05; }
.cartouche__name { font-style: italic; font-weight: 640; font-size: 1.55rem; letter-spacing: -.01em; }
.cartouche__sub { font-family: var(--mono); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); margin-top: .2rem; }

.mainnav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; }
.mainnav a {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding: .3rem 0;
  border-bottom: 2px solid transparent;
}
.mainnav a:hover { color: var(--magenta); border-bottom-color: var(--magenta); }
.mainnav a[aria-current="page"] { border-bottom-color: var(--sea); color: var(--sea); }

/* ---------- type ---------- */
h1, h2, h3 { font-weight: 600; line-height: 1.08; letter-spacing: -.015em; margin: 0 0 .6em; }
h1 { font-size: clamp(2.4rem, 1.4rem + 4.6vw, 5.2rem); font-style: italic; font-weight: 560; color: var(--sea); letter-spacing: -.025em; }
h2 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.7rem); font-style: italic; font-weight: 560; color: var(--sea); }
h3, h2.h3 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.55rem); font-style: normal; color: var(--ink); font-weight: 600; letter-spacing: -.015em; }
p, ul, ol, dl { margin: 0 0 1em; }
.lede { font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem); line-height: 1.5; max-width: 36rem; color: var(--ink); }
.measure { max-width: var(--measure); }

.label {
  display: inline-block;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--magenta);
  margin-bottom: .9rem;
}
.label::before { content: "◆ "; font-size: .6rem; vertical-align: .15em; }

code, kbd { font-family: var(--mono); font-size: .86em; background: var(--shoal-2); padding: .05em .3em; }

/* ---------- sections ---------- */
.section { padding: clamp(2.5rem, 6vw, 5rem) 0; border-bottom: 1px solid var(--rule); }
.section:last-child { border-bottom: 0; }
.section--tint { background: linear-gradient(var(--shoal-2), var(--shoal-2)) center / calc(100% + 2 * var(--gutter)) 100% no-repeat; }
.section__head { display: grid; gap: .25rem 2rem; grid-template-columns: minmax(0, 1fr); margin-bottom: 2rem; }
@media (min-width: 860px) {
  .section__head { grid-template-columns: 15rem minmax(0, 1fr); align-items: baseline; }
  .section__head .label { margin: 0; }
}
.section__head h2 { margin: 0; }

/* ---------- home hero ---------- */
.hero { padding: clamp(2rem, 5vw, 3.75rem) 0 0; }
.hero__text { position: relative; z-index: 1; max-width: 50rem; }
.hero h1 { margin-bottom: .35em; }
.hero h1 em { font-style: normal; color: var(--ink); font-weight: 420; }
.chart {
  margin: clamp(1.5rem, 4vw, 2.75rem) calc(-1 * var(--gutter)) 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--shoal-2);
  line-height: 0;
}
.chart svg { display: block; width: 100%; height: auto; }
.chart a:hover text, .chart a:focus text { fill: var(--magenta); }
.chart a:focus-visible { outline: none; }
.chart a:focus-visible circle.mark-ring { stroke: var(--magenta); stroke-width: 3; }
.chart__caption {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft);
  padding: .7rem 0 0;
  line-height: 1.5;
}

/* ---------- project "marks" ---------- */
.marks { list-style: none; margin: 0; padding: 0; counter-reset: mark; }
.mark {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .5rem 2.5rem;
  padding: 2rem 0;
  border-top: 1px solid var(--ink);
}
.section > .mark { border-top: 0; padding: 0; }
@media (min-width: 860px) {
  .mark { grid-template-columns: 15rem minmax(0, 1fr) 13rem; align-items: start; }
}
.mark__id { display: flex; align-items: center; gap: .9rem; }
.mark__no { font-family: var(--mono); font-size: .75rem; letter-spacing: .14em; color: var(--ink-soft); }
.mark__name { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem); font-style: italic; font-weight: 600; color: var(--ink); margin: 0; line-height: 1; }
.mark__name a { color: inherit; text-decoration: none; }
.mark__name a:hover { color: var(--magenta); }
.mark__buoy { width: 2.4rem; height: 2.4rem; flex: none; }
.mark__body p { max-width: var(--measure); }
.mark__char {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--magenta);
  margin: 0 0 .6rem;
}
.mark__links { list-style: none; padding: 0; margin: 0; font-family: var(--mono); font-size: .82rem; }
.mark__links li { border-bottom: 1px dashed var(--rule); }
.mark__links a { display: flex; justify-content: space-between; padding: .45rem 0; text-decoration: none; color: var(--ink); }
.mark__links a::after { content: "→"; color: var(--sea); }
.mark__links a:hover { color: var(--magenta); }
.mark__links a:hover::after { color: var(--magenta); }

/* feature lists on the projects page */
.ticks { list-style: none; padding: 0; max-width: var(--measure); }
.ticks li { position: relative; padding-left: 1.6rem; margin-bottom: .45rem; }
.ticks li::before {
  content: ""; position: absolute; left: .1rem; top: .62em;
  width: .7rem; height: 2px; background: var(--sea);
  box-shadow: 0 4px 0 var(--shoal);
}

/* ---------- notes (chart "caution" panels) ---------- */
.split { display: grid; gap: 2rem 3rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .split { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.note {
  border: 1.5px solid var(--magenta);
  padding: 1.4rem 1.5rem 1.1rem;
  position: relative;
  background: var(--paper);
}
.note__title {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--magenta); margin: 0 0 .8rem; font-weight: 500;
}
.note p:last-child { margin-bottom: 0; }

.button, button {
  display: inline-block;
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  border: 1.5px solid var(--ink);
  padding: .85rem 1.3rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--shoal);
}
.button:hover, button:hover { background: var(--sea); border-color: var(--sea); color: var(--paper); }
.button--ghost { background: transparent; color: var(--ink); }
.button--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- page head (inner pages) ---------- */
.pagehead { padding: clamp(2.25rem, 5vw, 4rem) 0 clamp(1.75rem, 4vw, 3rem); border-bottom: 1px solid var(--ink); position: relative; }
.pagehead h1 { margin-bottom: .3em; }
.pagehead .lede { margin-bottom: 0; }
.pagehead__wave { position: absolute; right: 0; bottom: 1rem; width: min(36%, 380px); color: var(--sea); opacity: .55; pointer-events: none; }
@media (max-width: 700px) { .pagehead__wave { display: none; } }

/* ---------- prose ---------- */
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.8rem; }

/* timeline */
.timeline { list-style: none; padding: 0; margin: 0; max-width: 46rem; border-left: 2px solid var(--sea); }
.timeline li { position: relative; padding: 0 0 1.3rem 1.6rem; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: .5em;
  width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--sea);
}
.timeline time, .timeline .when { display: block; font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--magenta); }

/* ---------- archive ---------- */
.archive .pagehead { background:
  repeating-linear-gradient(-45deg, transparent 0 14px, rgba(163, 34, 111, .045) 14px 15px); }
.stamp {
  display: inline-block;
  font-family: var(--mono);
  font-size: .72rem; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--magenta);
  border: 2px solid var(--magenta);
  outline: 1px solid var(--magenta); outline-offset: 2px;
  padding: .45rem .8rem;
  transform: rotate(-3deg);
  transform-origin: left center;
  margin: 0 0 1.6rem;
  width: max-content;
  display: block;
  background: var(--paper);
}
.catalogue { width: 100%; border-collapse: collapse; margin: 0 0 1rem; font-size: .98rem; }
.catalogue caption { text-align: left; }
.catalogue th, .catalogue td { text-align: left; vertical-align: top; padding: .9rem 1rem .9rem 0; border-bottom: 1px solid var(--rule); }
.catalogue thead th {
  font-family: var(--mono); font-weight: 500; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-soft); border-bottom: 1.5px solid var(--ink); padding-top: 0;
}
.catalogue td:first-child { font-family: var(--mono); font-size: .82rem; white-space: nowrap; color: var(--sea); width: 11rem; }
.catalogue td strong { display: block; font-weight: 600; margin-bottom: .2rem; }
.catalogue .status { width: 8rem; }
.tag {
  display: inline-block; font-family: var(--mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--magenta); border: 1px solid currentColor; padding: .1rem .4rem; white-space: nowrap;
}
@media (max-width: 720px) {
  .catalogue thead { position: absolute; left: -9999px; }
  .catalogue, .catalogue tbody, .catalogue tr, .catalogue td { display: block; width: auto; }
  .catalogue tr { border-bottom: 1px solid var(--rule); padding: .9rem 0; }
  .catalogue td { border: 0; padding: .1rem 0; }
  .catalogue td:first-child { width: auto; }
  .catalogue .status { width: auto; margin-top: .35rem; }
}
.catalogue-group { margin-bottom: 3rem; }
.catalogue-group .h3 { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; margin-bottom: .4rem; }
.catalogue-group .h3 small { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); font-weight: 400; }
.catalogue-group > p { max-width: var(--measure); color: var(--ink-soft); }

.toc { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.toc a {
  display: inline-block; font-family: var(--mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; color: var(--ink); border: 1px solid var(--ink); padding: .4rem .7rem;
}
.toc a:hover { background: var(--ink); color: var(--paper); }

/* ---------- forms ---------- */
.form { max-width: 40rem; }
.field { margin: 0 0 1.4rem; }
.field label, .field legend {
  display: block; font-family: var(--mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink); margin-bottom: .4rem; font-weight: 500;
}
.field .hint { display: block; font-family: var(--serif); text-transform: none; letter-spacing: 0; font-weight: 400; font-size: .92rem; color: var(--ink-soft); margin-top: .15rem; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: #fbf9f3;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  padding: .7rem .8rem;
}
textarea { min-height: 11rem; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 1.2rem) 55%, calc(100% - .85rem) 55%; background-size: .35rem .35rem; background-repeat: no-repeat; padding-right: 2.4rem; }
input:focus, textarea:focus, select:focus { border-color: var(--sea); background: #fff; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.form__foot p { margin: 0; font-size: .92rem; color: var(--ink-soft); max-width: 24rem; }

.result { padding: clamp(2.5rem, 6vw, 5rem) 0; }
.result ul { color: var(--magenta); }

/* ---------- footer ---------- */
.imprint { border-top: 1px solid var(--ink); padding: 1.75rem 0 2rem; font-size: .92rem; }
.scalebar { width: 200px; color: var(--ink); margin-bottom: 1.2rem; display: block; }
.imprint__cols { display: grid; gap: 1rem 2rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.imprint__cols p { margin: 0; }
.imprint a { color: var(--ink); }
.imprint__small { font-family: var(--mono); font-size: .72rem; line-height: 1.7; color: var(--ink-soft); }

/* ---------- 404 ---------- */
.lost { padding: clamp(3rem, 8vw, 6rem) 0; }
.lost .big { font-family: var(--mono); font-size: clamp(3rem, 12vw, 8rem); line-height: 1; color: var(--shoal); -webkit-text-stroke: 1.5px var(--sea); margin: 0 0 1rem; }

@media (prefers-reduced-motion: no-preference) {
  .swell { animation: swell 9s ease-in-out infinite alternate; }
  @keyframes swell { from { transform: translateX(0); } to { transform: translateX(-24px); } }
}

@media print {
  body { background: #fff; }
  .sheet { border: 0; outline: 0; margin: 0; padding: 0; }
  .sheet::before, .sheet::after, .mainnav, .chart, .skip { display: none; }
}

/* small screens: crop the chart to the coast and the three marks rather than shrinking it */
@media (max-width: 640px) {
  .chart { overflow: hidden; }
  .chart svg { width: 175%; max-width: none; margin-left: -45%; }
}
@media (max-width: 480px) {
  .mainnav ul { gap: .2rem 1rem; }
  .mainnav a { font-size: .72rem; letter-spacing: .08em; }
  .stamp { margin-left: .3rem; }
}
