/* Noon on a sun-warmed deck, and the same pool after dark with its lights on. Two rules hold the
   look: words to read stay dry on the deck, and anything wet belongs to the water. */
:root {
  color-scheme: light;
  --deck: #f2dfd0;
  --deck-2: #ead0bd;
  --deck-3: #fbf0e6;
  --coping: #fff8f0;
  --ink: #0b2a4a;
  --ink-2: #3f5566;
  --line: rgba(11, 42, 74, 0.2);
  --line-2: rgba(11, 42, 74, 0.1);
  --water: #3cbccb;
  --water-2: #1f9fb4;
  --on-water: #06264a;
  --buoy: #e0301e;
  --on-buoy: #fff7ee;
  --duck: #ffd21f;
  --sign: #fffdf8;
  --shadow: rgba(35, 35, 60, 0.18);

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --paint: "Big Shoulders", "Arial Narrow", "Helvetica Neue", sans-serif;
  --stencil: "Big Shoulders Stencil", "Big Shoulders", "Arial Narrow", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 44px);
  --pool-r: clamp(22px, 3.4vw, 40px);
  --head: 60px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* The Manual reads these names. */
  --d-bg: var(--deck);
  --d-bg-2: var(--deck-2);
  --d-surface: var(--deck-3);
  --d-ink: var(--ink);
  --d-muted: var(--ink-2);
  --d-line-strong: var(--line);
  --d-accent: var(--buoy);
  --d-font-text: var(--serif);
  --d-font-display: var(--paint);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --deck: #081216;
    --deck-2: #0f1e24;
    --deck-3: #13262c;
    --coping: #1c333a;
    --ink: #e8f4f1;
    --ink-2: #9fbcbe;
    --line: rgba(232, 244, 241, 0.2);
    --line-2: rgba(232, 244, 241, 0.1);
    --water: #0a4752;
    --water-2: #06313b;
    --on-water: #f2fbf8;
    --buoy: #ff6a4d;
    --on-buoy: #1c0a05;
    --sign: #10222a;
    --shadow: rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --deck: #081216;
  --deck-2: #0f1e24;
  --deck-3: #13262c;
  --coping: #1c333a;
  --ink: #e8f4f1;
  --ink-2: #9fbcbe;
  --line: rgba(232, 244, 241, 0.2);
  --line-2: rgba(232, 244, 241, 0.1);
  --water: #0a4752;
  --water-2: #06313b;
  --on-water: #f2fbf8;
  --buoy: #ff6a4d;
  --on-buoy: #1c0a05;
  --sign: #10222a;
  --shadow: rgba(0, 0, 0, 0.5);
}


/* Newsreader to read by. Big Shoulders for what's painted on a deck or laid in tile. Both under the
   SIL Open Font License. */
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-roman.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Big Shoulders"; src: url("/fonts/big-shoulders.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Big Shoulders Stencil"; src: url("/fonts/big-shoulders-stencil.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

/* The deck and what's on it: page, header, footer. */
*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--deck);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 20px;
}
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.22s; }
::view-transition-group(held) { animation-duration: 0.42s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font: 400 1.125rem/1.55 var(--serif);
  font-optical-sizing: auto;
  overflow-x: hidden;
  overflow-x: clip;
}
#water {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  z-index: -1;
}
main { flex: 1 0 auto; width: 100%; min-width: 0; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
h1, h2, h3 { margin: 0; font-weight: 800; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
ul[role="list"], ol[role="list"] { list-style: none; }
:focus-visible { outline: 3px solid var(--buoy); outline-offset: 3px; border-radius: 3px; }
.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--deck);
}
.skip:focus { top: 12px; }

.site-head {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--head);
  padding: 8px var(--gutter);
  background: var(--deck);
  font-family: var(--paint);
  font-weight: 700;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.logo { width: 26px; height: 26px; }
.site-nav { display: flex; align-items: center; gap: 6px; font-size: 1.15rem; letter-spacing: 0.015em; }
.site-nav > a.wide { display: none; padding: 8px 10px; text-decoration: none; }
.site-nav > a.wide:hover { text-decoration: underline; }
.icon-link svg { width: 21px; height: 21px; }
.mode {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  cursor: pointer;
}
.mode svg { width: 24px; height: 24px; }
.mode .full { opacity: 0; }
.mode[data-mode="dark"] .full { opacity: 1; }
.mode[data-mode="light"] .half { opacity: 0; }
.lights {
  position: absolute;
  right: var(--gutter);
  top: calc(100% - 4px);
  z-index: 12;
  display: grid;
  gap: 12px;
  width: min(300px, calc(100vw - 32px));
  padding: 14px;
  background: var(--sign);
  color: var(--ink);
  border-radius: 14px;
  box-shadow: 0 16px 40px var(--shadow), 0 0 0 1px var(--line-2);
}
.lights[hidden] { display: none; }
.lights-title { font: 800 1.35rem/1 var(--stencil); letter-spacing: 0.03em; color: var(--buoy); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; background: var(--deck-2); border-radius: 10px; }
.seg button { min-height: 44px; border: 0; border-radius: 8px; background: none; color: inherit; font: 700 1.2rem/1 var(--paint); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--deck); }
.sun-row { display: grid; grid-template-columns: auto 1fr 4.6em; align-items: center; gap: 10px; font: 700 1.15rem/1 var(--paint); }
.sun-row[hidden] { display: none; }
.sun-row output { text-align: right; font-size: 1.05rem; color: var(--ink-2); white-space: nowrap; }
#sun {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 26px;
  margin: 0;
  background: linear-gradient(90deg, #ef8a4e, #f7d9a0 22%, #bfe6f2 50%, #f7d9a0 78%, #ef8a4e);
  background-size: 100% 8px;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 4px;
}
#sun::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--duck); border: 2px solid var(--ink); }
#sun::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--duck); border: 2px solid var(--ink); }
.switches { display: flex; gap: 8px; flex-wrap: wrap; }
.switches:not(:has(> :not([hidden]))) { display: none; }
.switch { flex: 1; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--deck-2); color: inherit; font: 700 1.15rem/1 var(--paint); cursor: pointer; }
.switch[hidden] { display: none; }
.switch[aria-pressed="true"] { background: var(--buoy); color: var(--on-buoy); }
.site-nav-go {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 15px;
  background: var(--buoy);
  color: var(--on-buoy);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
}
@media (max-width: 379px) {
  .site-head { gap: 4px; padding-left: 12px; padding-right: 8px; }
  .brand { font-size: 1.3rem; gap: 5px; }
  .logo { width: 22px; height: 22px; }
  .site-nav { gap: 0; font-size: 1.05rem; }
  .site-nav-go { padding: 0 11px; min-height: 38px; }
  .mode { width: 40px; }
}
.site-menu { position: relative; }
.site-menu summary {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  list-style: none;
  cursor: pointer;
}
.site-menu summary::-webkit-details-marker { display: none; }
.site-menu summary svg { width: 26px; height: 26px; }
.site-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  display: grid;
  min-width: 210px;
  padding: 8px;
  background: var(--sign);
  border-radius: 12px;
  box-shadow: 0 16px 40px var(--shadow), 0 0 0 1px var(--line-2);
}
.site-menu-panel a { padding: 11px 12px; font-size: 1.35rem; text-decoration: none; border-radius: 6px; }
.site-menu-panel a:hover { background: var(--deck-2); }
@media (min-width: 900px) {
  .site-nav > a.wide { display: inline-flex; }
  .site-menu { display: none; }
  .site-nav { gap: 10px; }
}

.site-foot {
  background: var(--deck);
  padding: 44px var(--gutter) 34px;
  border-top: 1px solid var(--line-2);
  font-family: var(--paint);
  font-weight: 600;
  font-size: 1.15rem;
}
.foot-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px 18px;
  max-width: 1200px;
  margin: 0 auto;
}
.foot-brand { grid-column: 1 / -1; font-family: var(--stencil); font-size: 2.6rem; font-weight: 800; line-height: 1; }
.foot-inner nav { display: grid; gap: 7px; align-content: start; }
.foot-inner a { text-decoration: none; }
.foot-inner a:hover { text-decoration: underline; }
.frame-manual .site-foot { margin-top: 48px; }
@media print { .site-head, .site-foot, .skip, #water { display: none; } }
.fine { grid-column: 1 / -1; font: 400 0.92rem/1.45 var(--serif); color: var(--ink-2); }
@media (min-width: 760px) {
  .foot-inner { grid-template-columns: 2fr 1fr 1fr; }
  .foot-brand { grid-column: auto; grid-row: span 2; font-size: 4rem; }
  .fine { grid-column: 2 / -1; }
}
