/* Buoy. One stylesheet for the homepage, the comparison pages and the About page.

   THE SHARED SYSTEM
   Colours      --paper (page and sky), --ink (text), --ink-2 (quiet text), --cream (text on water), --orange (logo, selection)
   Type         Baskerville italic for headlines, Whitney for everything else. Sizes: --t-h1, --t-h2, --t-body, --t-small
   Margins      --pad is the edge of the page (logo and navigation). --margin is the edge of the content: one tenth of the
                page on each side on desktop, so content is eight tenths wide, as in the layouts.
   Rules        a dotted line (.dots) separates sections; dots are the site's only ornament
   Homepage     --u is one row of the riverbed painting (1122 wide) at the size it is shown, so everything placed on the
                painting keeps its place at any width */

/* The fonts come from their own address (a private repository; see .gitignore). The second url is the copy on this computer, used when that address cannot be reached. */
@font-face{font-family:'Baskerville Buoy';font-style:italic;font-weight:400;font-display:swap;src:url("https://buoy-fonts.pages.dev/Baskerville-Italic.woff") format("woff"),url("../fonts/Baskerville-Italic.woff") format("woff")}
@font-face{font-family:'Whitney';font-style:normal;font-weight:400;font-display:swap;src:url("https://buoy-fonts.pages.dev/WhitneyHTF-Book.woff") format("woff"),url("../fonts/WhitneyHTF-Book.woff") format("woff")}
@font-face{font-family:'Whitney';font-style:normal;font-weight:500 700;font-display:swap;src:url("https://buoy-fonts.pages.dev/WhitneyHTF-SemiBold.woff") format("woff"),url("../fonts/WhitneyHTF-SemiBold.woff") format("woff")}

:root{
  --paper:#F7EFE6; --ink:#16202C; --ink-2:#4C5E72; --cream:#F7EFE6; --deep:#547279; --orange:#EC6A48;
  --yes:#5FA873; --no:#E0646A;
  --serif:'Baskerville Buoy',Baskerville,'Baskerville Old Face',Georgia,serif;
  --sans:'Whitney',system-ui,-apple-system,'Segoe UI',sans-serif;
  --pad:clamp(20px,3.1vw,64px);
  --margin:10vw;
  --t-h1:clamp(34px,4.35vw,84px);
  --t-h2:clamp(22px,1.75vw,30px);
  --t-body:clamp(18px,1.25vw,23px);
  --t-small:clamp(16px,1.05vw,19px);
  --u:calc(100vw / 1122);
  /* On a low, wide screen the painting moves up a little (at most 80 of its rows), so the water comes into the first screen. */
  --lift:clamp(calc(-80 * var(--u)), calc(100vh - 740 * var(--u)), 0px);
}
*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--paper);color:var(--ink);font-family:var(--sans);font-size:var(--t-body);line-height:1.4;-webkit-font-smoothing:antialiased;overflow-x:hidden}
a{color:inherit}
button{font:inherit;color:inherit}
a:focus-visible,button:focus-visible{outline:2.5px solid currentColor;outline-offset:4px;border-radius:4px}
h1,h2,p{margin:0}
::selection{background:var(--orange);color:var(--ink)}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.dots{height:3px;border:0;margin:0;background:radial-gradient(circle,currentColor 1.1px,transparent 1.6px) 0 0/14px 3px repeat-x}

/* ---------------------------------------------------------------- header, on every page */
.nav{position:absolute;inset:0 0 auto 0;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:clamp(16px,1.9vw,34px) var(--pad) 0}
.logo{display:block}
.logo img{height:clamp(30px,2.2vw,42px);width:auto;display:block}
.nav nav{display:flex;gap:clamp(28px,4.3vw,80px);font-size:var(--t-body)}
.nav nav a{text-decoration:none}
.nav nav a:hover,.nav nav a[aria-current]{text-decoration:underline;text-underline-offset:5px}

h1{font-family:var(--serif);font-style:italic;font-weight:400;font-size:var(--t-h1);line-height:1.22;letter-spacing:-.005em;text-align:center}
.art{display:block}
.art img{display:block;width:100%;height:auto}

/* each logo file is used as a stencil, so a logo takes one colour whatever its own colours are */
.mark{display:block;-webkit-mask:center/84% no-repeat;mask:center/84% no-repeat}

/* ---------------------------------------------------------------- homepage */
.hero{position:relative;display:block}
.hero h1{position:absolute;z-index:4;left:0;right:0;top:calc(106 * var(--u) + .6 * var(--lift));font-size:4.35vw}

/* The painting and the page content share one grid cell. When the content needs more room than the painting has,
   the strip of deep water under the painting grows; it is a repeating tile, so nothing is stretched. */
.sea{display:grid;overflow:hidden}
.sea>*{grid-area:1/1;min-width:0}
.stack{display:flex;flex-direction:column}
.stack .top{margin-top:var(--lift)}
.stack .more{flex:1 0 calc(230 * var(--u));margin-top:-1px;background:var(--deep) url("../images/river-water.webp") center top/calc(1122 * var(--u)) auto}

.water{position:relative;z-index:3;color:var(--cream);padding:calc(568 * var(--u) + var(--lift)) var(--pad) calc(120 * var(--u))}
.pick{display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:wrap;min-height:56px;text-align:center;
  text-shadow:0 0 10px rgba(62,92,100,.7),0 0 22px rgba(62,92,100,.5)}
.go{display:inline-flex;align-items:center;gap:8px;background:var(--cream);color:var(--ink);text-decoration:none;font-weight:600;border-radius:999px;padding:9px 22px 10px;text-shadow:none}
.go:hover{background:#fff}
.go.ink{background:var(--ink);color:var(--paper)}
.go.ink:hover{background:#000}
.clear{background:none;border:0;padding:4px;cursor:pointer;text-decoration:underline;text-underline-offset:4px;font-size:.85em}

.tiles{--d:clamp(96px,8.6vw,164px);display:flex;flex-wrap:wrap;justify-content:center;gap:clamp(14px,2vw,40px) clamp(18px,2.4vw,48px);
  width:min(100%,calc(6 * var(--d) + 5 * clamp(18px,2.4vw,48px)));margin:clamp(26px,2.7vw,52px) auto 0}
.tile{position:relative;display:block;padding:0;border:0;background:none;cursor:pointer;border-radius:50%;transition:opacity .2s,transform .2s}
.tile .mark{width:var(--d);height:var(--d);background:var(--cream)}
.tile:hover{transform:translateY(-3px)}
.tile:focus-visible{border-radius:50%;outline-offset:12px}
.tile::after{content:"";position:absolute;inset:-7%;border-radius:50%;border:2.5px dotted var(--cream);opacity:0;transition:opacity .2s}
.tile[aria-pressed="true"]::after{opacity:1}
.tiles.full .tile[aria-pressed="false"]{opacity:.45}
@media (prefers-reduced-motion:reduce){.tile,.tile::after{transition:none}.tile:hover{transform:none}}

.five{max-width:1180px;margin:clamp(90px,11vw,200px) auto 0}
.five h2{margin:0 0 10px;font-family:var(--serif);font-style:italic;font-weight:400;font-size:clamp(30px,2.9vw,50px);line-height:1.15;text-align:center}
.five .lead{text-align:center;margin:0 auto clamp(30px,3.4vw,56px);max-width:60ch}
.five ol{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(5,1fr);gap:clamp(18px,2.2vw,40px)}
.five li{padding-top:16px;position:relative}
.five li::before{content:"";position:absolute;inset:0 0 auto 0;height:3px;background:radial-gradient(circle,currentColor 1.1px,transparent 1.6px) 0 0/8px 3px repeat-x;opacity:.8}
.five b{display:block;font-weight:600;font-size:clamp(20px,1.45vw,25px);line-height:1.15;margin-bottom:8px}
.five span{display:block;font-size:clamp(18px,1.2vw,21px);line-height:1.35}

.bed{position:relative;margin-top:-1px}
.bed .foot{position:absolute;inset:auto 0 0 0;padding:0 var(--pad) clamp(14px,1.6vw,28px)}

/* ---------------------------------------------------------------- footer, on every page */
.foot{display:flex;justify-content:space-between;align-items:baseline;gap:10px 40px;flex-wrap:wrap;font-size:var(--t-small);color:var(--ink)}
.foot ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:6px 24px;align-items:baseline}
.foot .lbl{color:var(--ink-2)}
.foot a{text-underline-offset:4px}

/* ---------------------------------------------------------------- inner pages (comparison, About) */
.page{padding:clamp(96px,9vw,170px) var(--margin) 0}
.page h1{margin-bottom:clamp(40px,5.5vw,100px)}
.shores{margin-top:clamp(60px,8vw,150px)}
.page-foot{padding:0 var(--pad) clamp(18px,1.8vw,30px);margin-top:calc(-34 * var(--u))}

/* comparison: a label column and one column per service. The service columns are centred on one third and two thirds
   of the content width, as in the layout. */
/* (The two service columns are placed evenly around the middle of the page, so they sit centred under the headline.) */
.cmp{--cols:23.5% 25% 3% 25%;--icon:clamp(26px,2.5vw,40px)}
.row{display:grid;grid-template-columns:var(--cols);align-items:center}
.row>:nth-child(2){grid-column:2;justify-self:center}
.row>:nth-child(3){grid-column:4;justify-self:center}
.svc{display:flex;flex-direction:column;align-items:center;text-decoration:none}
.svc .mark{width:clamp(96px,10.5vw,190px);height:clamp(96px,10.5vw,190px);background:var(--ink)}
.score{position:relative;width:clamp(104px,10.5vw,190px);margin-top:clamp(4px,.8vw,14px);text-align:center;line-height:1}
.score svg{display:block;width:100%;height:auto}
.score .on{fill:var(--orange)} .score .off{fill:var(--ink-2)}
.score b{position:absolute;inset:auto 0 2%;font-weight:400;font-size:clamp(28px,3.1vw,56px)}
.score small{font-size:.36em;color:var(--ink-2);margin-left:.15em}
.group{padding:clamp(30px,4vw,74px) 0 clamp(34px,4.6vw,84px)}
.group h2{font-weight:600;font-size:var(--t-h2);line-height:1.2;margin-bottom:clamp(14px,1.6vw,30px)}
.group .row{min-height:clamp(46px,5.4vw,96px);padding:clamp(6px,.7vw,12px) 0}
/* the icon stays centred under its logo; the detail runs to the right of it, on the same line as the marker's name */
.cell{position:relative;display:flex;align-items:center}
.cell svg{display:block;width:var(--icon);height:var(--icon)}
.cell small{position:absolute;left:calc(100% + .7em);top:50%;transform:translateY(-50%);width:11.5em;font-size:var(--t-small);line-height:1.2;color:var(--ink-2)}
.cell.yes{color:var(--yes)} .cell.no{color:var(--no)} .cell.unknown{color:var(--ink-2)}
.key{display:flex;flex-wrap:wrap;gap:8px 28px;align-items:center;font-size:var(--t-small);color:var(--ink-2);padding-top:clamp(20px,2.4vw,40px)}
.key span{display:inline-flex;align-items:center;gap:8px}
.key svg{width:20px;height:20px}
.key .yes{color:var(--yes)} .key .no{color:var(--no)}

/* About: one reading column in the middle of the page */
.prose{max-width:34em;margin:0 auto}
.prose p,.prose ul{margin:0 0 1.4em}
.prose h2{font-weight:600;font-size:var(--t-h2);line-height:1.2;margin:2.6em 0 1.2em}
.prose ul{list-style:none;padding:0}
.prose li{margin-bottom:1.4em;padding-left:.9em;text-indent:-.9em}
.prose .me{display:block;width:clamp(96px,8.8vw,128px);height:auto;aspect-ratio:1;object-fit:cover;border-radius:50%;margin:clamp(40px,4vw,70px) auto 0}
/* the V4V pop-up */
dialog.v4v{border:0;border-radius:18px;background:var(--paper);color:var(--ink);padding:clamp(28px,3vw,44px) clamp(24px,3vw,44px) clamp(26px,2.6vw,38px);width:min(92vw,400px);text-align:center;box-shadow:0 24px 70px -20px rgba(22,32,44,.55)}
dialog.v4v::backdrop{background:rgba(84,114,121,.72)}
dialog.v4v h2{font-family:var(--serif);font-style:italic;font-weight:400;font-size:clamp(30px,2.6vw,40px);line-height:1.15;margin-bottom:10px}
dialog.v4v p{font-size:var(--t-small);margin:0 auto 18px;max-width:22em}
dialog.v4v .qr{display:block;width:200px;height:auto;margin:0 auto 18px}
dialog.v4v .addr b{font-weight:600;overflow-wrap:anywhere}
dialog.v4v .x{position:absolute;top:10px;right:10px;border:0;background:none;padding:8px;cursor:pointer;color:var(--ink-2);display:flex}
dialog.v4v .x:hover{color:var(--ink)}
dialog.v4v .go:focus-visible{outline-offset:3px;border-radius:999px}
dialog.v4v .go{justify-content:center}
.prose li::before{content:"•";display:inline-block;width:.9em;text-indent:0}

@media (max-width:760px){
  :root{--u:calc(100vw / 935);--lift:0px;--margin:20px}
  .nav{padding:16px var(--pad) 0}
  .nav nav{gap:22px}
  .hero h1{position:static;padding:92px 18px 0;font-size:clamp(29px,8.4vw,40px);line-height:1.18}
  .hero h1 br{display:none}
  .stack .top{margin-top:4px}
  .water{padding:calc(410 * var(--u)) 10px 70px}
  .five{margin-top:84px;padding:0 10px}
  .five ol{grid-template-columns:1fr;gap:22px}
  .pick{min-height:64px}
  .tiles{--d:min(28vw,128px);gap:8px 3vw;width:100%}
  .bed .art{background:var(--paper)}
  .bed .foot{position:static;padding:6px var(--pad) 26px}
  .foot{display:block}
  .foot ul+ul{margin-top:10px}
  .cmp{--cols:44% 27% 2% 27%}
  .score{width:84px}
  .group .row{align-items:start}
  .cell{flex-direction:column;text-align:center}
  .cell small{position:static;transform:none;width:auto;margin-top:5px}
  .row .label{padding-top:calc((var(--icon) - 1.4em) / 2)}
  .svc .mark{width:92px;height:92px}
  .page-foot{margin-top:0}
}
