/* Study Lounge's home page (and the 404 page).
   Soft grey with a little grain, white cards, near-black type. Blue is the one colour (the button); navy holds the app's
   picture at the top and the last invitation at the bottom; the orange is the pen: the circle round "together",
   and the two circles on the Cheers picture that show where to look.
   A few pen drawings (.sk) sit in the margins, in the same near-black with pale blue washes. */

:root {
  --bg: #f5f6f8; --card: #ffffff; --card-line: #e7e9ed; --stage: #f2f2f4;
  --ink: #0e1014; --muted: #5d626b; --hair: #e3e6eb;
  --blue: #2f62d6; --blue-2: #2553bd; --focus: #9db9f2;
  --navy: #0c1630; --orange: #e0674a;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
* { box-sizing: border-box; min-width: 0; }
html {
  -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px;
  background: var(--bg) url(img/grain.svg?v=09a6c2d3); /* on the page itself, so the grain reaches every edge of the window, even when it bounces */
}
body {
  margin: 0; color: var(--ink); font: 17px/1.5 var(--font); -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
.wrap { width: min(1120px, 100% - 48px); margin-inline: auto; }
.ic { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; z-index: 20; background: var(--card); padding: 8px 12px; border-radius: 10px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

/* ── the bar at the top ── */
.top { position: sticky; top: 0; z-index: 10; background: rgba(245, 246, 248, 0.82); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); }
.nav { display: flex; align-items: center; gap: 28px; height: 76px; }
.logo { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; font-weight: 600; font-size: 18px; letter-spacing: -0.015em; text-decoration: none; }
.logo img { width: 29px; height: auto; }
.quiet { font-size: 15px; color: var(--muted); text-decoration: none; transition: color 0.2s; }
.quiet:hover { color: var(--ink); }

/* ── the button ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 28px;
  border-radius: 999px; background: var(--blue); color: #fff; font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap; transition: background 0.2s, transform 0.2s;
  box-shadow: 0 1px 2px rgba(14, 16, 20, 0.14), 0 12px 28px -14px rgba(47, 98, 214, 0.7);
}
.btn:hover { background: var(--blue-2); }
.btn:active { transform: translateY(1px); }
.btn .ic { transition: transform 0.25s var(--ease); }
.btn:hover .ic { transform: translateX(3px); }
.btn.sm { min-height: 38px; padding: 0 18px; font-size: 14.5px; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: none; border: 1.5px solid var(--ink); }

/* the add-on's code: press it to copy */
.code {
  display: inline-flex; align-items: center; gap: 0.35em; margin: 0 0.1em; padding: 0.05em 0.5em; cursor: pointer;
  border: 1px solid var(--hair); border-radius: 8px; background: var(--card); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.01em;
  transition: border-color 0.2s;
}
.code:hover { border-color: #c9ced6; }
.code .ic { width: 0.85em; height: 0.85em; color: var(--muted); }
.paste { font-size: 15px; color: var(--muted); }

/* ── the headline ── */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: end; gap: 40px; padding-top: 52px; }
h1 { font-size: clamp(2.7rem, 6.9vw, 5.5rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.04em; }
/* the pen circle is wider and taller than the word, so it goes round the letters and not through them */
.circled { position: relative; display: inline-block; margin-left: 0.14em; }
.nb { white-space: nowrap; } /* the circled word keeps its comma */
.circled svg { position: absolute; left: -0.27em; top: -0.02em; width: calc(100% + 0.79em); height: 1.31em; overflow: visible; pointer-events: none; }
.circled path { fill: none; stroke: var(--orange); stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.js .circled path { animation: draw 1.3s var(--ease) 0.35s both; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.lead { font-size: 20px; line-height: 1.4; letter-spacing: -0.015em; color: var(--muted); }
.side { padding-bottom: 6px; }
.side .btn { margin-top: 26px; }
.side .paste { margin-top: 16px; }

/* the app, on its navy stage */
.show {
  position: relative; overflow: hidden; margin-top: 56px; padding: 5% max(7%, calc(50% - 403px)) 0; border-radius: 28px;
  background: var(--navy) radial-gradient(80% 70% at 50% 0%, rgba(47, 98, 214, 0.42), rgba(47, 98, 214, 0) 70%);
}
/* The picture is the panel's whole width, scaled to fit the stage (the stage's padding is its room at the top and
   sides), and it stands on the stage's bottom edge: the file itself stops at a gap between the panel's rows, so the
   panel runs off the stage cleanly, never through a row. Nothing is cropped at any width. The picture is at
   most 806px wide (the app at about one and a quarter times life size), with at least 7% of the stage each side. */
.show picture { display: contents; }
.show img { display: block; width: 100%; height: auto; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 40px; border-block: 1px solid #dfe2e7; }
.facts li { padding: 32px 0 30px 32px; border-left: 1px solid #dfe2e7; }
.facts li:first-child { padding-left: 0; border-left: 0; }
.facts b { display: block; font-size: 23px; font-weight: 600; letter-spacing: -0.03em; }
.facts span { display: block; margin-top: 6px; font-size: 15px; color: var(--muted); }

/* ── what's inside ── */
.inside, .questions { padding-top: 112px; }
h2 { font-size: clamp(2.3rem, 4.6vw, 3.5rem); font-weight: 700; line-height: 1; letter-spacing: -0.04em; }
/* a heading with a drawing at the far end of its line, standing on the same ground */
.headrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.sk { display: block; height: auto; pointer-events: none; user-select: none; }
.sk.desk { flex: none; width: 236px; margin: -70px 6px -14px 0; }
.sk.podium { width: 138px; margin: 0 0 22px -4px; }
.sk.mug { width: 66px; margin: 0 0 14px -4px; }
.card { background: var(--card); border: 1px solid var(--card-line); border-radius: 26px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 48px; }
.grid .card { padding: 14px 14px 30px; }
.stage { position: relative; overflow: hidden; border-radius: 14px; background: var(--stage); aspect-ratio: 13 / 9; }
.stage img { width: 100%; height: 100%; object-fit: cover; }
/* pen circles over a picture, in the picture's own units: they point at what the card is about, and draw
   themselves, one after the other, once the card has come into view */
.pen { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pen path { fill: none; stroke: var(--orange); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.js .rise .pen path { stroke-dashoffset: 1; }
.js .rise.in .pen path { animation: draw 0.8s var(--ease) 0.8s both; }
.js .rise.in .pen path + path { animation-delay: 1.5s; }
.grid h3 { margin: 24px 16px 0; font-size: 23px; font-weight: 600; letter-spacing: -0.025em; }
.grid p { margin: 8px 16px 0; font-size: 17px; line-height: 1.45; letter-spacing: -0.01em; color: var(--muted); }
.listen {
  display: inline-flex; align-items: center; gap: 8px; margin: 18px 16px 0; min-height: 38px; padding: 0 16px 0 13px; cursor: pointer;
  border: 1px solid var(--hair); border-radius: 999px; background: var(--card); font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em;
  transition: border-color 0.2s, background 0.2s;
}
.listen:hover { border-color: #c9ced6; }
.listen .ic { width: 14px; height: 14px; fill: var(--blue); stroke: var(--blue); }
.listen.on { border-color: var(--blue); background: #f1f5fe; }

h3.big { font-size: clamp(1.9rem, 3.6vw, 2.75rem); font-weight: 700; line-height: 1.04; letter-spacing: -0.035em; }
.more { font-size: 19px; line-height: 1.45; letter-spacing: -0.01em; color: var(--muted); }

/* the leaderboard: its picture, and what it does */
.feat { display: grid; grid-template-columns: minmax(0, 600px) minmax(0, 1fr); align-items: center; gap: 56px; margin-top: 24px; padding: 36px 56px 36px 36px; }
.frame { overflow: hidden; border-radius: 16px; border: 1px solid #e1e3e8; box-shadow: 0 30px 60px -36px rgba(12, 22, 48, 0.35); }
.frame img { width: 100%; }
.feat .more { margin-top: 18px; }
.rows { margin-top: 28px; border-top: 1px solid var(--hair); }
.rows li { display: flex; gap: 18px; padding: 15px 0; border-bottom: 1px solid var(--hair); font-size: 16px; line-height: 1.4; }
.rows b { flex: none; width: 112px; font-weight: 600; }
.rows span { color: var(--muted); }

/* the games */
/* the focus sounds mixer: each sound with its own volume */
.mixer { display: grid; gap: 9px; margin: 16px 16px 0; }
.mx { display: flex; align-items: center; gap: 16px; }
.mxb {
  display: inline-flex; align-items: center; gap: 8px; flex: none; width: 140px; min-height: 36px; padding: 0 12px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--hair); border-radius: 999px; background: var(--card); font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em;
  transition: border-color 0.2s, background 0.2s;
}
.mxb:hover { border-color: #c9ced6; }
.mxb .ic { width: 13px; height: 13px; fill: var(--blue); stroke: var(--blue); }
.mx.on .mxb { border-color: var(--blue); background: #f1f5fe; }
.mx.loading .mxb .ic { animation: mxwait 0.9s ease-in-out infinite; }
@keyframes mxwait { 50% { opacity: 0.25; } }
.mx input[type=range] {
  flex: 1; height: 22px; margin: 0; cursor: pointer; background: transparent; -webkit-appearance: none; appearance: none;
  transition: filter 0.2s, opacity 0.2s;
}
.mx input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--blue) var(--v, 50%), var(--hair) var(--v, 50%)); }
.mx input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--blue) var(--v, 50%), var(--hair) var(--v, 50%)); }
.mx input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #fff; border: 1px solid #c9ced6; box-shadow: 0 1px 3px rgba(12, 22, 48, 0.18); }
.mx input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 1px solid #c9ced6; box-shadow: 0 1px 3px rgba(12, 22, 48, 0.18); }
.mx:not(.on) input[type=range] { filter: grayscale(1); opacity: 0.6; }

/* the leaderboard: title on top, then the picture, like the break games */
.board { margin-top: 24px; padding: 52px 48px 48px; }
.boardbody { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); align-items: center; gap: 56px; margin-top: 36px; }
.board .rows { margin-top: 0; }

.games { margin-top: 24px; padding: 52px 48px 48px; }
.topline { display: flex; align-items: flex-end; justify-content: space-between; gap: 48px; }
.topline .more { width: min(500px, 100%); margin-bottom: 6px; }
.gg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 24px; margin-top: 52px; }
/* a game's picture; where there's a clip it's a button: point at it (or tap it) and the game plays */
.shot { position: relative; display: block; width: 100%; padding: 0; border: 0; overflow: hidden; border-radius: 14px; background: var(--stage); isolation: isolate; }
button.shot { cursor: pointer; }
.shot img { width: 100%; transition: transform 0.6s var(--ease); }
.shot video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.35s; }
.shot.playing video { opacity: 1; }
.gg li:hover .shot img { transform: scale(1.02); }
.badge {
  position: absolute; left: 10px; bottom: 10px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); box-shadow: 0 2px 8px rgba(12, 22, 48, 0.25); transition: opacity 0.25s, transform 0.25s;
}
.badge .ic { width: 12px; height: 12px; margin-left: 2px; fill: var(--blue); stroke: var(--blue); }
.shot.playing .badge { opacity: 0; transform: scale(0.8); }
.gg h4 { margin-top: 16px; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.gg p { margin-top: 4px; font-size: 15.5px; color: var(--muted); }
/* More games: a heading over a row of small pictures; on a phone, a drop-down (closed to start with) */
.moregames { margin-top: 48px; border-top: 1px solid var(--hair); }
.moregames summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 30px; list-style: none; cursor: default; pointer-events: none; }
.moregames summary::-webkit-details-marker { display: none; }
.moregames summary .ic, .morehint { display: none; }
.moretitle { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.gg.small { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; margin-top: 22px; }
.gg.small .shot { border-radius: 12px; }
.gg.small h4 { margin-top: 13px; font-size: 16.5px; }
.gg.small p { font-size: 14.5px; line-height: 1.4; }
.gg.small .badge { left: 8px; bottom: 8px; width: 26px; height: 26px; }
.gg.small .badge .ic { width: 10px; height: 10px; }

/* ── questions ── */
.faq { margin-top: 48px; padding: 8px 36px; }
.faq details { border-bottom: 1px solid var(--hair); }
.faq details:last-child { border-bottom: 0; }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0; cursor: pointer; list-style: none; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { color: var(--muted); transition: transform 0.3s var(--ease); }
.faq details[open] summary .ic { transform: rotate(180deg); }
.faq p { max-width: 46em; margin: 0 0 14px; font-size: 16.5px; line-height: 1.55; color: var(--muted); }
.faq details p:last-child { margin-bottom: 26px; }
.faq a { color: var(--ink); }

/* ── the ending: a seat for you ── */
.seat { margin-top: 128px; padding: 96px 0 104px; background: var(--navy); color: #fff; text-align: center; }
.seat .table { display: flex; justify-content: center; }
.seat .table svg { width: 190px; height: 190px; }
.seat .you { animation: wait 2.8s ease-in-out infinite; }
@keyframes wait { 50% { opacity: 0.4; } }
.seat h2 { margin-top: 28px; font-size: clamp(2.5rem, 6vw, 4.5rem); }
.seat .lead { margin-top: 22px; font-size: 22px; color: rgba(255, 255, 255, 0.66); }
.seat .btn { margin-top: 40px; box-shadow: 0 14px 32px -14px rgba(47, 98, 214, 0.9); }
.seat .paste { margin-top: 22px; color: rgba(255, 255, 255, 0.6); line-height: 2; }
.seat .code { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.22); color: #fff; }
.seat .code:hover { border-color: rgba(255, 255, 255, 0.5); }
.seat .code .ic { color: rgba(255, 255, 255, 0.6); }

/* ── the foot ── */
.foot { padding: 30px 0 44px; font-size: 14px; color: var(--muted); }
.foot .line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 32px; flex-wrap: wrap; }
.foot .links { display: flex; gap: 28px; }
.foot .links a { text-decoration: none; }
.foot a:hover { color: var(--ink); }
.credits { max-width: 62em; margin-top: 14px; font-size: 12.5px; line-height: 1.5; color: #868b93; }

/* things rise into place, slowly, as they come into view */
.js .rise { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .rise.in { opacity: 1; transform: none; }

/* the 404 page */
.lost { min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 40px 0; text-align: center; }
.lost h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
.lost .sk { width: min(260px, 70%); margin-bottom: 6px; }
.lost .btn { margin-top: 12px; }

/* ── narrower screens ── */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; align-items: start; gap: 26px; }
  .side { padding-bottom: 0; max-width: 30em; }
  .feat { grid-template-columns: 1fr; gap: 36px; padding: 28px; }
  .boardbody { grid-template-columns: 1fr; gap: 32px; }
  .boardbody .frame { max-width: 520px; margin-inline: auto; width: 100%; }
  .frame { max-width: 560px; margin-inline: auto; }
  .gg, .gg.small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topline { flex-direction: column; align-items: flex-start; gap: 16px; }
  .sk.desk { width: 200px; margin-top: -56px; }
}
@media (max-width: 760px) {
  .wrap { width: min(1120px, 100% - 32px); }
  .nav { gap: 18px; height: 64px; }
  .nav .quiet { display: none; }
  .hero { padding-top: 28px; }
  .show { margin-top: 40px; padding: 4.5% 3.5% 0; border-radius: 22px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .facts li { padding: 22px 0 20px 20px; }
  .facts li:nth-child(odd) { padding-left: 0; border-left: 0; }
  .facts li:nth-child(n+3) { border-top: 1px solid #dfe2e7; }
  .facts b { font-size: 19px; }
  .inside, .questions { padding-top: 76px; }
  .grid { grid-template-columns: 1fr; gap: 16px; margin-top: 32px; }
  .grid .card { padding: 10px 10px 24px; border-radius: 22px; }
  .grid h3 { margin-inline: 12px; }
  .grid p, .listen { margin-inline: 12px; }
  .feat { margin-top: 16px; padding: 14px 14px 26px; border-radius: 22px; }
  .feat > div:last-child { padding: 0 10px; }
  .games, .board { margin-top: 16px; padding: 30px 20px 28px; border-radius: 22px; }
  .boardbody { margin-top: 26px; }
  .mixer { margin-inline: 12px; }
  .mx { gap: 12px; }
  .mxb { width: 136px; }
  .gg, .gg.small { gap: 28px 14px; }
  .gg { margin-top: 32px; }
  .gg.small { margin-top: 20px; }
  .moregames { margin-top: 30px; }
  .moregames summary { padding: 20px 0 0; cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent; }
  .moregames:not([open]) summary { padding-bottom: 2px; }
  .moregames summary .ic { display: block; width: 20px; height: 20px; color: var(--muted); transition: transform 0.3s var(--ease); }
  .moregames[open] summary .ic { transform: rotate(180deg); }
  .morehint { display: block; margin-top: 3px; font-size: 14.5px; line-height: 1.4; color: var(--muted); }
  .moregames[open] .morehint { display: none; }
  .headrow { gap: 10px; }
  .sk.desk { width: 112px; margin: -24px 0 -7px; }
  .sk.podium { width: 116px; margin-top: 4px; }
  .faq { margin-top: 32px; padding: 4px 22px; border-radius: 22px; }
  .rows li { flex-direction: column; gap: 2px; }
  .rows b { width: auto; }
  .seat { margin-top: 84px; padding: 72px 0 80px; }
  .seat .table svg { width: 150px; height: 150px; }
  .seat .lead { font-size: 19px; }
}
@media (max-width: 470px) {
  /* too narrow for both columns at a size you can read: the sounds, with the timer's card under them, all of it showing */
  .show { display: grid; justify-items: center; padding: 20px 18px 22px; }
  .show img { width: min(100%, 360px); }
}
@media (max-width: 374px) {
  h1 { font-size: 11.4vw; } /* the smallest phones: "Study together," and its circle still fit on one line */
}
@media (max-width: 480px) {
  .gg { grid-template-columns: 1fr; }
  .gg.small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn { width: 100%; }
  .btn.sm { width: auto; }
  .seat .btn { width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rise { opacity: 1; transform: none; transition: none; }
  .js .circled path, .seat .you { animation: none; }
  .js .rise .pen path, .js .rise.in .pen path { stroke-dashoffset: 0; animation: none; }
  .gg li:hover .shot img { transform: none; }
  .shot video, .badge { transition: none; }
}
