/* =====================================================================
   BetaDoctor website.
   One blue frame (left bar, header, footer) around a rounded panel that
   shows the page. Tiles, big type, shades of blue only. Light and dark.
   ===================================================================== */

/* ---------- Colours: light ---------- */
:root {
  --frame-1: #cfe3ff; --frame-2: #b6cdfb;          /* the frame's blue, top left to bottom right */
  --panel: rgb(246 250 255 / .78);                 /* the middle panel */
  --edge: rgb(255 255 255 / .55);                  /* the panel's outline */
  --glass: rgb(255 255 255 / .3);                  /* small see-through things on the frame */
  --card: #ffffff; --soft: #dde9ff;                /* a tile, and a tinted tile */
  --ink: #04123a; --muted: #445a8f; --line: rgb(4 18 58 / .11);
  --accent: oklch(0.58 0.21 258); --accent-2: oklch(0.74 0.15 222); --on-accent: #fff;
  --shadow: 0 1px 2px rgb(4 18 58 / .05), 0 1.1rem 3rem -1.1rem rgb(10 50 150 / .32);
  --wash-1: oklch(0.86 0.12 215 / .95); --wash-2: oklch(0.7 0.17 265 / .6); --wash-3: oklch(0.8 0.13 240 / .8);
  --side: clamp(13rem, 17vw, 18rem);               /* width of the left bar */
  --font: "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", "Consolas", monospace;
}
/* ---------- Colours: dark ----------
   Used when the visitor's system is set to dark, or when they picked it with the
   round button (site.js then sets data-theme on <html>). The two lists are the same. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --frame-1: #041036; --frame-2: #061a55; --panel: rgb(8 24 72 / .62); --edge: rgb(150 190 255 / .17);
    --glass: rgb(120 170 255 / .1); --card: #0b2160; --soft: #102a74;
    --ink: #eaf2ff; --muted: #a3baea; --line: rgb(150 190 255 / .17);
    --accent: oklch(0.68 0.19 252); --accent-2: oklch(0.84 0.13 212); --on-accent: #03102e;
    --shadow: 0 1px 0 rgb(180 210 255 / .08) inset, 0 1.5rem 3.6rem -1.5rem rgb(0 0 0 / .7);
    --wash-1: oklch(0.5 0.17 235 / .6); --wash-2: oklch(0.4 0.2 272 / .7); --wash-3: oklch(0.45 0.18 255 / .6);
  }
}
:root[data-theme="dark"] {
  --frame-1: #041036; --frame-2: #061a55; --panel: rgb(8 24 72 / .62); --edge: rgb(150 190 255 / .17);
  --glass: rgb(120 170 255 / .1); --card: #0b2160; --soft: #102a74;
  --ink: #eaf2ff; --muted: #a3baea; --line: rgb(150 190 255 / .17);
  --accent: oklch(0.68 0.19 252); --accent-2: oklch(0.84 0.13 212); --on-accent: #03102e;
  --shadow: 0 1px 0 rgb(180 210 255 / .08) inset, 0 1.5rem 3.6rem -1.5rem rgb(0 0 0 / .7);
  --wash-1: oklch(0.5 0.17 235 / .6); --wash-2: oklch(0.4 0.2 272 / .7); --wash-3: oklch(0.45 0.18 255 / .6);
}

/* ---------- Size ----------
   Everything is sized in "rem". One rem follows the window: it grows with the width
   and shrinks when the window is low, so a page keeps fitting on one screen. */
html { font-size: clamp(12px, min(0.42vw + 9.6px, 1.55vh), 20px); }

* { box-sizing: border-box; }
body { margin: 0; height: 100dvh; overflow: hidden; color: var(--ink); font: 1rem/1.6 var(--font); -webkit-font-smoothing: antialiased;
  background: linear-gradient(135deg, var(--frame-1), var(--frame-2)); }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* soft blue lights behind everything */
.wash { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.wash i { position: absolute; border-radius: 50%; filter: blur(6rem); }
.wash i:nth-child(1) { width: 46vmax; height: 46vmax; left: -14vmax; top: -18vmax; background: var(--wash-1); }
.wash i:nth-child(2) { width: 50vmax; height: 50vmax; right: -16vmax; top: -12vmax; background: var(--wash-2); }
.wash i:nth-child(3) { width: 48vmax; height: 48vmax; left: 20vmax; bottom: -30vmax; background: var(--wash-3); }

/* ---------- The frame ----------
   Left bar, header and footer have no background of their own, so they are one piece. */
.shell { display: grid; height: 100dvh; grid-template: "side head" auto "side stage" 1fr "side foot" auto / var(--side) 1fr; }

.side { grid-area: side; display: flex; flex-direction: column; gap: .15rem; padding: 1.1rem .9rem 1rem 1.1rem; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.4rem; font-size: 1.15rem; font-weight: 750; letter-spacing: -.02em; text-decoration: none; }
.brand img { width: 2.3rem; height: 2.3rem; border-radius: 50%; box-shadow: 0 0 0 .2rem rgb(255 255 255 / .35); }
.side h2 { margin: 1.2rem .7rem .35rem; color: var(--muted); font: 500 .68rem/1 var(--mono); letter-spacing: .13em; text-transform: uppercase; }
.go { display: flex; align-items: center; gap: .65rem; padding: .5rem .7rem; border-radius: .8rem; color: var(--muted); font-size: .92rem; font-weight: 550; line-height: 1.25; text-decoration: none; transition: background .2s, color .2s; }
.go:hover { background: var(--glass); color: var(--ink); }
.go.here { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
/* the dot in front of a project: filled when it is released, a ring when it is not */
.dot { flex: none; width: .5rem; height: .5rem; border-radius: 50%; border: 1.5px solid currentColor; opacity: .6; }
.dot.live { border: 0; opacity: 1; background: var(--accent); box-shadow: 0 0 0 .22rem color-mix(in srgb, var(--accent) 22%, transparent); }

.head { grid-area: head; display: flex; align-items: center; gap: .8rem; height: 3.6rem; padding: 0 1.4rem 0 .5rem; font-size: .9rem; }
.crumb { margin-right: auto; color: var(--muted); font-weight: 500; }
.crumb b { color: var(--ink); font-weight: 650; }
.chip { display: inline-flex; align-items: center; gap: .5rem; padding: .25rem .8rem .25rem .7rem; border: 1px solid var(--line); border-radius: 99rem; background: var(--glass); color: var(--muted); font-size: .78rem; font-weight: 500; }
.chip i { width: .42rem; height: .42rem; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 .22rem color-mix(in srgb, var(--accent-2) 28%, transparent); }
.round { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--glass); cursor: pointer; }

.foot { grid-area: foot; display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 1.6rem .8rem .7rem; color: var(--muted); font-size: .8rem; }
.foot a { margin-left: 1.2rem; text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* ---------- The middle: one rounded panel, the only part that scrolls ---------- */
.stage { grid-area: stage; margin-right: 1rem; overflow-y: auto; border: 1px solid var(--edge); border-radius: 1.8rem; background: var(--panel);
  -webkit-backdrop-filter: blur(1.6rem) saturate(1.5); backdrop-filter: blur(1.6rem) saturate(1.5);
  box-shadow: 0 1.6rem 4rem -1.6rem rgb(10 40 130 / .4); scrollbar-width: thin; }

/* A page. Only the one with "on" is shown. When another is picked, site.js gives the
   old one "out" so it fades away, and the new one then fades in. It is a plain fade,
   so it also plays for visitors who have animations switched off in their system. */
.view { display: none; max-width: 100rem; margin: 0 auto; padding: clamp(1.2rem, min(3.2vw, 3.6vh), 3.6rem) clamp(1.4rem, 3.2vw, 3.6rem); animation: in .8s ease both; }
.view.on { display: block; }
.view.out { animation: out .4s ease both; }
@keyframes in { from { opacity: 0; } }
@keyframes out { to { opacity: 0; } }

/* ---------- Text ---------- */
h1 { margin: 0 0 1.2rem; font-size: clamp(2.6rem, 5.4vw, 6rem); line-height: .96; font-weight: 750; letter-spacing: -.045em; }
h1.sub { font-size: clamp(2rem, 3.4vw, 3.6rem); line-height: 1.02; }
/* a heading of two lines: the claim in the fade, and a smaller line under it */
h1.two { margin-bottom: .9rem; font-size: clamp(2.4rem, 4.8vw, 5.2rem); }
h1.two em, h1.two span { display: block; }
/* room for the tail of the "y": the fade only colours inside the line's own box, and at this
   tight line height the tail hangs below it. The margin takes the added room away again. */
h1.two em { padding-bottom: .2em; margin-bottom: -.12em; }
h1.two span { margin-top: .25em; font-size: .44em; line-height: 1.15; letter-spacing: -.03em; }
/* the part of a heading in the blue-to-cyan fade */
h1 em { font-style: normal; background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 58ch; margin: 0 0 1.8rem; color: var(--muted); font-size: 1.15rem; line-height: 1.55; }
.label { margin: 0 0 .9rem; color: var(--muted); font: 500 .7rem/1 var(--mono); letter-spacing: .13em; text-transform: uppercase; }
.text p { max-width: 62ch; margin: 0 0 .9rem; color: var(--muted); font-size: 1.05rem; }
/* small print; named twice so its space above also holds inside a .text block */
/* a text file in a floating window (site.js opens it for links with data-peek) */
.peek { width: min(52rem, calc(100vw - 2rem)); max-height: min(46rem, calc(100vh - 2rem)); padding: 0; border: 1px solid var(--line); border-radius: 1.7rem;
  background: var(--card); color: var(--ink); box-shadow: var(--shadow); overflow: hidden; animation: in .3s ease both; }
.peek[open] { display: flex; flex-direction: column; }
.peek::backdrop { background: rgb(2 8 30 / .6); backdrop-filter: blur(6px); }
.peek header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .4rem .5rem .4rem 1.2rem; border-bottom: 1px solid var(--line); }
.peek header b { font-size: .9rem; font-weight: 650; letter-spacing: -.01em; }
.peek .round { width: 1.6rem; height: 1.6rem; color: inherit; font-size: .65rem; }
.peek pre { flex: 1; min-height: 0; margin: 0; padding: 1.4rem 1.7rem 1.7rem; overflow: auto; color: var(--muted); font: .8rem/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.peek [hidden] { display: none; }
.peek.picture { width: fit-content; max-height: calc(100vh - 2rem); }          /* a screenshot, large */
.peek img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 5rem); margin: 0 auto; }
img[data-peek] { cursor: zoom-in; }

.fine, .text .fine { margin: 1.2rem 0 0; color: var(--muted); font-size: .82rem; }
.hero { margin-bottom: clamp(1.2rem, 2vw, 1.9rem); }
.hero .lead { max-width: 88ch; margin-bottom: 0; text-wrap: pretty; }   /* the home page's opening text: wider, so it stays three lines */
.gap { margin-top: 1.6rem; }

.row { display: flex; flex-wrap: wrap; gap: .6rem; }
.btn { display: inline-flex; align-items: center; gap: .5rem; height: 2.7rem; padding: 0 1.3rem; border: 1px solid var(--line); border-radius: 99rem; background: var(--card);
  color: var(--ink); font-size: .92rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn.main { border-color: transparent; background: var(--accent); color: var(--on-accent); box-shadow: 0 .6rem 1.8rem -.6rem var(--accent); }
.btn.small { height: 2.2rem; padding: 0 1rem; font-size: .85rem; }

/* ---------- Tiles ----------
   A grid of twelve columns; w3, w4 and w6 say how many columns a tile takes. */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; }
.tile { position: relative; overflow: hidden; padding: 1.7rem; border: 1px solid var(--line); border-radius: 1.7rem; background: var(--card); box-shadow: var(--shadow); transition: transform .25s, border-color .25s; }
.tile h2 { margin: 0 0 .5rem; font-size: clamp(1.8rem, 2.6vw, 2.7rem); line-height: 1.05; font-weight: 720; letter-spacing: -.035em; }
.tile h3 { margin: 0 0 .35rem; font-size: 1.2rem; font-weight: 650; letter-spacing: -.02em; }
.tile p { margin: 0; color: var(--muted); font-size: .94rem; }
.w3 { grid-column: span 3; } .w4 { grid-column: span 4; } .w6 { grid-column: span 6; }
.tall { grid-row: span 2; }            /* as high as two tiles beside it */
.tint { background: var(--soft); box-shadow: none; }
/* smaller tiles, for a list of features */
.compact .tile { padding: 1.1rem 1.4rem; border-radius: 1.3rem; }
.compact .tile h3 { font-size: 1.08rem; }

/* a tile with a longer piece of small text (the privacy statement on the home page) */
.terms { padding: 1.4rem 1.6rem; }
.terms .state { margin-bottom: .7rem; }
.terms p { margin-bottom: .5rem; font-size: .8rem; line-height: 1.5; text-wrap: pretty; }   /* pretty: no last line of one word */
.terms p:last-child { margin-bottom: 0; }

/* the small label on a tile or above a heading: "Released", "In the works" */
.state { display: inline-block; margin-bottom: 1rem; padding: .15rem .65rem; border-radius: 99rem; background: var(--soft); color: var(--muted); font-size: .75rem; font-weight: 600; }
.state.live { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }

/* the big tile on the home page: the slideshow of the projects.
   The slides lie on top of each other and fill the tile, so the tile keeps one height
   whatever a slide holds; that height comes from the tile beside it (min-height is for
   narrow screens, where it stands alone). Only the slide with "on" is shown. site.js
   gives the old one "out" so it fades away before the next fades in, as with pages. */
.feature { position: relative; grid-column: span 8; grid-row: span 2; min-height: 24rem; padding: 0;
  background: linear-gradient(140deg, var(--card) 45%, color-mix(in srgb, var(--accent-2) 26%, var(--card))); }
.slide { position: absolute; inset: 0; display: none; grid-template: minmax(0, 1fr) / 1fr minmax(11rem, 32%); gap: 1.8rem; align-items: center;
  padding: 1.5rem 4.4rem 2.3rem; animation: in .8s ease both; }
.slide.on { display: grid; }
.slide.out { animation: out .4s ease both; }
.slide.plain { grid-template-columns: 1fr; }          /* a project without a picture yet */
.slide p { margin: 0; font-size: 1rem; }
.slide .row { margin-top: 1.3rem; }
/* the key points of a project: a short ticked list */
.points { margin: .8rem 0 0; padding: 0; list-style: none; color: var(--muted); font-size: .95rem; line-height: 1.7; }
.points li { position: relative; padding-left: 1.5rem; }   /* room for the tick; a second line starts under the text */
.points li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.slide .tilt { width: auto; max-width: 100%; max-height: 100%; justify-self: center; }
/* the arrows left and right, and the dots that say which slide is on */
.turn { position: absolute; top: 50%; z-index: 1; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; margin-top: -1.25rem; padding: 0 0 .15rem;
  border: 1px solid var(--line); border-radius: 50%; background: var(--glass); color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer;
  transition: background .2s, color .2s, transform .2s; }
.turn:hover { background: var(--card); color: var(--ink); transform: scale(1.08); }
.turn.prev { left: .9rem; }
.turn.next { right: .9rem; }
.dots { position: absolute; left: 0; right: 0; bottom: 1rem; z-index: 1; display: flex; justify-content: center; gap: .5rem; }
.dots button { width: .5rem; height: .5rem; padding: 0; border: 0; border-radius: 99rem; background: var(--muted); opacity: .4; cursor: pointer; transition: width .3s, opacity .3s, background .3s; }
.dots button.on { width: 1.5rem; background: var(--accent); opacity: 1; }
/* a screenshot, slightly turned; it straightens under the pointer */
.tilt { width: 100%; height: auto; border-radius: .9rem; box-shadow: 0 1.5rem 3.2rem -1.1rem rgb(4 18 58 / .6); transform: rotate(2deg); transition: transform .4s; }
.tilt:hover { transform: rotate(0) scale(1.03); }
/* a tile with one big number */
.num { grid-column: span 4; display: flex; flex-direction: column; justify-content: flex-end; min-height: 10rem; }
.num b { font-size: 3.6rem; line-height: 1; font-weight: 750; letter-spacing: -.05em; }
.num.blue { border-color: transparent; background: linear-gradient(150deg, var(--accent), oklch(0.5 0.2 268)); color: #fff; }
.num.blue p { color: rgb(255 255 255 / .86); }

/* ---------- A project page: text on the left, picture and numbers on the right ---------- */
.project { display: grid; grid-template-columns: 1fr minmax(15rem, 34%); gap: clamp(1.4rem, 3vw, 3.4rem); align-items: start; margin-bottom: 1.4rem; }
.project aside { display: grid; gap: 1rem; }
.project aside .tilt { width: min(74%, 33vh); margin: .6rem auto 1.2rem; }
/* two screenshots: the second one lies over the lower left corner of the first */
.project aside .shots { position: relative; width: min(66%, 33vh); margin: .6rem 6% 1.6rem auto; }
.project aside .shots .tilt { width: 100%; margin: 0; }
.project aside .shots .second { position: absolute; left: -42%; bottom: -5%; width: 74%; transform: rotate(-4deg); }
.project aside .shots .second:hover { transform: rotate(0) scale(1.06); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pair .num { grid-column: auto; min-height: 7rem; padding: 1.2rem 1.3rem; }
.pair .num b { font-size: 2.8rem; }
/* a page that has nothing to show yet */
.soon { display: grid; place-items: center; min-height: 14rem; text-align: center; }

/* ---------- About me: a wide tile, the avatar on the left and the text on the right ---------- */
.me.terms { padding: 1rem 1.6rem; }
.me { grid-column: span 8; display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: center; }
.me > div { align-self: start; }   /* so its label sits as high as the label of the tile beside it */
.me img { width: auto; height: 7.6rem; border-radius: 22%; box-shadow: 0 0 0 .3rem var(--glass); }

/* ---------- The machine: label and value list ---------- */
.specs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 1.8rem; margin: .9rem 0 0; }
.specs div { padding: .7rem 0; border-top: 1px solid var(--line); }
.specs dt { color: var(--muted); font: 500 .66rem/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.specs dd { margin: .1rem 0 0; font-weight: 600; }
/* the short version in a tile on the home page: no lines, less room */
.specs.mini { margin: 0; gap: 0 1.2rem; }
.specs.mini div { padding: .25rem 0; border-top: 0; }
.specs.mini dd { font-size: .9rem; line-height: 1.35; }
/* the "Built on" tile: the label on top like on the other tiles, six parts under it */
.built { padding: 1rem 1.6rem; }
.built .state { margin-bottom: .45rem; }
.built .specs.mini div { padding: .12rem 0; }
.built .specs.mini dt { font-size: .6rem; }
.built .specs.mini dd { margin: 0; font-size: .85rem; line-height: 1.3; }

/* ---------- The home page fills the panel ----------
   On a wide screen the home page is made exactly as high as the panel: what is left over
   after the text and the bottom row of tiles goes to the slideshow and the tile beside it. */
@media (min-width: 1001px) {
  .view[data-view="home"].on { display: flex; flex-direction: column; min-height: 100%; }
  .view[data-view="home"] .bento { flex: 1; grid-template-rows: 1fr 1fr auto; }
}

/* ---------- Smaller screens ---------- */
@media (max-width: 1000px) {
  .feature, .me { grid-column: span 12; }
  .num, .w3, .w4 { grid-column: span 6; }
}
/* narrow: the left bar becomes a strip of buttons and the page scrolls as a whole */
@media (max-width: 820px) {
  body { height: auto; overflow: auto; }
  .shell { display: block; height: auto; }
  .feature { min-height: 28rem; }          /* narrow slides wrap onto more lines */
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .8rem .8rem .2rem; }
  .brand { width: 100%; margin-bottom: .5rem; }
  .side h2 { display: none; }
  .go { padding: .4rem .8rem; background: var(--glass); }
  .head { padding: 0 .8rem; }
  .stage { margin: 0 .6rem; overflow: visible; }
  .foot { flex-wrap: wrap; padding: .9rem 1rem 1.2rem; }
  .project { grid-template-columns: 1fr; }
  .project aside .tilt { width: 60%; }
  .project aside .shots { width: 52%; margin-right: 12%; }
}
@media (max-width: 560px) {
  .me { grid-template-columns: 1fr; }
  /* the slideshow: the text above the picture, and more height for the two */
  .feature { min-height: 39rem; }
  .slide { grid-template: auto minmax(0, 1fr) / 1fr; padding: 1.6rem 3.4rem 2.6rem; }
  .slide.plain { grid-template-rows: 1fr; }
  .num, .w3, .w4, .w6 { grid-column: span 12; }
  .pair .num { grid-column: auto; }
  .chip { display: none; }
  .specs { grid-template-columns: 1fr; }
}
