/* ABOUTME: Layout and type for the landing page: paper, ink, and brand cyan over a tile field */
/* ABOUTME: Elements marked .clear are cut out of the canvas field by main.js so text always sits on paper */

:root {
  --paper: #ecebe6;
  --ink: #0b1b2d;
  --muted: rgba(11, 27, 45, 0.62);
  --hair: rgba(11, 27, 45, 0.18);
  --cyan: #7bcfff;
  --wash: #b6e1f7;
  --sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --gutter: 40px;
}

* {
  box-sizing: border-box;
}
html {
  background: var(--paper);
  scroll-behavior: smooth;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a {
  color: inherit;
}
button {
  font: inherit;
  color: inherit;
}

#field,
#fieldOverlay,
#fieldFleet {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  z-index: 0;
}

#fieldOverlay,
#fieldFleet {
  pointer-events: none;
}

.k {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Fixed chrome: logo, nav, corner brackets, readouts */
.bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px var(--gutter);
  pointer-events: none;
}
.bar > * {
  pointer-events: auto;
}
.logo {
  display: block;
}
.logo svg {
  display: block;
  height: 22px;
  width: auto;
}
.nav {
  display: flex;
  gap: 26px;
}
.nav a {
  text-decoration: none;
}
.nav a::before {
  content: "[";
  opacity: 0.45;
  margin-right: 2px;
}
.nav a::after {
  content: "]";
  opacity: 0.45;
  margin-left: 2px;
}
.nav a:hover,
.nav a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.corner {
  position: fixed;
  z-index: 4;
  width: 14px;
  height: 14px;
  border-color: var(--ink);
  border-style: solid;
  border-width: 0;
  pointer-events: none;
  transition: background-color 0.2s steps(2);
}
.corner.tl {
  top: 10px;
  left: 10px;
  border-top-width: 1px;
  border-left-width: 1px;
}
.corner.tr {
  top: 10px;
  right: 10px;
  border-top-width: 1px;
  border-right-width: 1px;
}
.corner.bl {
  bottom: 10px;
  left: 10px;
  border-bottom-width: 1px;
  border-left-width: 1px;
}
.corner.br {
  bottom: 10px;
  right: 10px;
  border-bottom-width: 1px;
  border-right-width: 1px;
}
.corner.reached {
  background: var(--cyan);
}

.hud {
  position: fixed;
  z-index: 4;
  bottom: 12px;
  left: var(--gutter);
  right: var(--gutter);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 24px;
  margin: 0;
  padding: 4px 0;
  color: var(--muted);
  background: var(--paper);
}
.hud-l {
  display: flex;
  gap: 18px;
  align-items: baseline;
  white-space: nowrap;
}
.hud-r {
  margin: 0;
  text-align: right;
  white-space: nowrap;
}
.hud b {
  color: var(--ink);
  font-weight: 500;
  margin-left: 8px;
  font-variant-numeric: tabular-nums;
}
/* Room for "100%", so the readout and the field's clearing under it keep one width as it counts. */
#useVal {
  display: inline-block;
  width: 4ch;
  white-space: nowrap;
  text-align: right;
}
.pause {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
}
.pause::before {
  content: "[ ";
  opacity: 0.45;
}
.pause::after {
  content: " ]";
  opacity: 0.45;
}

/* Sections */
main {
  position: relative;
  z-index: 1;
}
.sec {
  position: relative;
  min-height: 100vh;
  padding: 0 var(--gutter);
}
.block {
  max-width: 620px;
}
.block > * {
  width: fit-content;
  max-width: 100%;
}

#s1 .block {
  padding-top: 21vh;
  max-width: 940px;
}
.lede {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 500;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
h1 {
  font-weight: 500;
  font-size: clamp(40px, 5.9vw, 88px);
  line-height: 0.96;
  letter-spacing: -0.045em;
  margin: 0 0 30px;
  max-width: 11.5em;
}
.body {
  font-size: 18px;
  line-height: 1.45;
  margin: 0 0 26px;
  max-width: 30em;
  color: rgba(11, 27, 45, 0.86);
}
#s2 {
  min-height: 112vh;
  padding-top: 16vh;
  padding-bottom: 12vh;
}
h2 {
  font-weight: 500;
  font-size: clamp(34px, 4.4vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  margin: 14px 0 22px;
  max-width: 13em;
}
.lead {
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: -0.012em;
  margin: 0 0 24px;
  max-width: 25em;
}
.three {
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
  font-size: 18px;
  line-height: 1.35;
  max-width: 30em;
}
.three li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  padding: 11px 0;
  border-top: 1px solid var(--hair);
}
.three li:last-child {
  border-bottom: 1px solid var(--hair);
}
.three li .k {
  color: var(--muted);
  padding-top: 2px;
}
.three h3 {
  display: block;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: -0.01em;
  margin: 0;
}
.three p {
  font-size: 16px;
  line-height: 1.4;
  color: rgba(11, 27, 45, 0.86);
  margin: 6px 0 0;
}

#s3 {
  min-height: 112vh;
  padding-top: 16vh;
  padding-bottom: 12vh;
  display: flex;
  gap: 72px;
  align-items: flex-start;
}
.products {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 560px;
}
.products > * {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}
.product {
  padding: 18px 0 20px;
  border-top: 1px solid var(--hair);
}
.product:last-child {
  border-bottom: 1px solid var(--hair);
}
h3 {
  font-weight: 500;
  font-size: 36px;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: baseline;
}
.tag {
  font-size: 10.5px;
  border: 1px solid var(--ink);
  padding: 1px 6px 0;
  letter-spacing: 0.06em;
  position: relative;
  top: -4px;
  white-space: nowrap;
}
a.tag {
  text-decoration: none;
}
a.tag:hover,
a.tag:focus-visible {
  color: var(--paper);
  background: var(--ink);
}
a.tag:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.product p {
  font-size: 19px;
  line-height: 1.4;
  margin: 0;
  max-width: none;
}
.link {
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}

#s4 {
  padding-top: 11vh;
  padding-bottom: 9vh;
}
#s4 h2 {
  font-size: clamp(32px, 3.5vw, 50px);
  max-width: 12.5em;
}
#s4 .lead {
  font-size: 20px;
  max-width: 28em;
}
#s4 .body {
  font-size: 16px;
  margin-bottom: 18px;
}
.legend {
  display: flex;
  justify-self: center;
  gap: 8px 24px;
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  text-transform: none;
  letter-spacing: 0.01em;
}
.legend > span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
.legend svg {
  width: 18px;
  height: 18px;
  display: block;
  border: 1px solid var(--hair);
}

.persp {
  margin: 0 0 26px;
  width: 100%;
  max-width: 520px;
}
.persp > .k {
  color: var(--muted);
  margin: 0 0 6px;
}
.persp ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.persp li {
  border-top: 1px solid var(--hair);
}
.persp li:last-child {
  border-bottom: 1px solid var(--hair);
}
.pitem {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: baseline;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 9px 0;
  cursor: pointer;
  font-size: 16px;
  line-height: 1.3;
}
.pitem .k {
  color: var(--muted);
}
.pitem .state {
  color: var(--muted);
  font-size: 10.5px;
}
.pitem[aria-current="true"] .state {
  color: var(--ink);
}
.pitem[aria-current="true"] .k:first-child::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  background: var(--wash);
  border-top-left-radius: 8px;
  border: 1px solid var(--ink);
  border-width: 1px 0 0 1px;
}
.pitem:hover .label,
.pitem:focus-visible .label {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ppanel {
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 14px 16px 16px;
}
.ppanel[hidden] {
  display: none;
}
.ppanel .phead {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  margin: 0 0 10px;
  font-size: 11.5px;
}
.ppanel .close {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
}
.ppanel h4 {
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.ppanel p {
  font-size: 15px;
  line-height: 1.4;
  margin: 0 0 12px;
}
.ppanel a {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 0;
}
.links a {
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}

/* Perspective markers placed in the field on wide screens */
.marks {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s steps(4);
}
.marks.on {
  opacity: 1;
}
.marks.on .pmark {
  pointer-events: auto;
}
.pmark {
  position: absolute;
  transform: translate(-7px, -7px);
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.pmark i {
  width: 14px;
  height: 14px;
  flex: none;
  background: var(--paper);
  position: relative;
}
.pmark i::before,
.pmark i::after {
  content: "";
  position: absolute;
  background: var(--ink);
}
.pmark i::before {
  left: 6.5px;
  top: 0;
  width: 1px;
  height: 14px;
}
.pmark i::after {
  top: 6.5px;
  left: 0;
  height: 1px;
  width: 14px;
}
.pmark span {
  background: var(--paper);
  padding: 1px 5px;
  color: var(--muted);
  white-space: nowrap;
}
.pmark.active span {
  color: var(--ink);
  background: var(--wash);
}

/* An opened perspective takes the list's place inside section 4's content box. */
.persp.opened ul {
  display: none;
}

/* Section 4 centres its content box in the viewport, with A, B, C, D placed around it. */
@media (min-width: 900px) {
  #s4 {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 64px;
    padding-bottom: 64px;
  }
  #s4 .block {
    width: 560px;
  }
}

@media (max-width: 899px) {
  :root {
    --gutter: 18px;
  }
  .bar {
    padding: 16px var(--gutter);
  }
  .logo svg {
    height: 18px;
  }
  .nav {
    gap: 12px;
    font-size: 10.5px;
  }
  .nav a:nth-child(2),
  .nav a:nth-child(3) {
    display: none;
  }
  .hud {
    bottom: 0;
    left: 0;
    right: 0;
    column-gap: 16px;
    padding: 9px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px));
    font-size: 10.5px;
  }
  .hud > .k {
    font-size: 10.5px;
  }
  .hud-l > span {
    display: none;
  }
  #s1 .block {
    padding-top: 40vh;
  }
  .lede {
    font-size: 18px;
  }
  h1 {
    font-size: clamp(36px, 10.4vw, 56px);
  }
  .body {
    font-size: 16.5px;
  }
  #s2 {
    padding-top: 34vh;
  }
  .lead {
    font-size: 19px;
  }
  .three {
    font-size: 16px;
  }
  #s3 {
    display: block;
    padding-top: 34vh;
  }
  h3 {
    font-size: 28px;
  }
  .product p {
    font-size: 17px;
  }
  #s4 {
    padding-top: 34vh;
    padding-bottom: max(9vh, calc(96px + env(safe-area-inset-bottom, 0px)));
  }
  .marks {
    display: none;
  }
  .ppanel {
    margin-top: 12px;
  }
}

/* Keep one horizontal row on phones, with an accessible pause icon and compact readout. */
@media (max-width: 639px) {
  .hud {
    column-gap: 8px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .hud > .legend {
    gap: 8px;
    font-size: 9.5px;
  }
  .legend > span {
    gap: 4px;
  }
  .legend svg {
    width: 12px;
    height: 12px;
  }
  .activation-label {
    display: none;
  }
  .hud #useVal {
    margin-left: 0;
  }
  .pause {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    font-size: 0;
  }
  .pause::before {
    content: "";
    width: 8px;
    height: 12px;
    border-left: 2px solid currentColor;
    border-right: 2px solid currentColor;
    opacity: 1;
  }
  .pause::after {
    content: none;
  }
  .pause[aria-pressed="true"]::before {
    width: 0;
    height: 0;
    border: 6px solid transparent;
    border-right: 0;
    border-left: 9px solid currentColor;
  }
  .pause:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
  }
}
