/* The joint look (job 36, Part 2): LOOP and Live Launch together, on the home, on /looped-in
   and (R750 (2)) on /loop-hotels and the hotels' own links. It sits on top of loop.css and is
   loaded by those pages alone; every rule here starts at body.joint, so no other page can take it.

   The page's body carries what it wears: day or night, one of six looks, where lime sits,
   how LOOP's orange is used. Every color is here; the page has none of its own. The type
   is in joint-type.css. */

/* ---- the six looks: ground and text from the table; the three quieter tones are a mix of
   the two (text at 78%, 30% and 6 to 9% over the ground), written out so every phone reads them ---- */
.look-cream { --ground: #FFFEEF; --ink: #111111; --soft: #454542; --rule: #B8B7AC; --field: #F1F0E2; }
.look-latte { --ground: #E8D9C4; --ink: #2B1D16; --soft: #55463C; --rule: #AFA190; --field: #DDCEBA; }
.look-matcha { --ground: #E3E8CF; --ink: #1B2418; --soft: #474F40; --rule: #A7AD98; --field: #D7DCC4; }
.look-espresso { --ground: #2B1D16; --ink: #FFFEEF; --soft: #D0CCBF; --rule: #6B6057; --field: #3E312A; }
.look-coldbrew { --ground: #14100D; --ink: #FFFEEF; --soft: #CBCABD; --rule: #5A5751; --field: #292521; }
.look-matchanight { --ground: #1B2418; --ink: #F4F6EA; --soft: #C4C8BC; --rule: #5C6357; --field: #2F372B; }

body.joint {
  --orange: #FF8268; /* LOOP's peach */
  --lime: #B4D800; /* Live Launch's lime */
  --on-fill: #111111; /* words on a peach or lime fill: 7.77 and 11.48 to 1 */
  /* what loop.css paints with: its navy is the ground here, its cream the text */
  --navy: var(--ground);
  --cream: var(--ink);
  --deep: var(--field);
  --dim: var(--soft);
  --line: var(--rule);
  /* loop.css's peach marks errors and thin rules. By day peach cannot be text or a thin rule
     (under 3 to 1 on every day ground), so those take the text color; by night they are peach. */
  --peach: var(--ink);
  /* the buttons: the look's own colors unless peach or lime is given the fills below */
  --btn: var(--ink);
  --btn-ink: var(--ground);
  --btn-edge: var(--ink);
  background: var(--ground);
  color: var(--ink);
}
body.joint.day { color-scheme: light; }
body.joint.night { color-scheme: dark; --peach: var(--orange); }

/* ---- type: the direction's two faces (set in its own sheet) ---- */
body.joint { font-family: var(--j-text); }
body.joint h1, body.joint h2, body.joint .sentence, body.joint .said { font-family: var(--j-display); font-weight: var(--j-display-weight, 400); letter-spacing: var(--j-display-tracking, 0); }
body.joint h1 { font-size: clamp(2.1rem, 10vw, 3.6rem); line-height: 1.04; }
body.joint h2 { font-size: clamp(1.6rem, 7vw, 2.4rem); line-height: 1.1; }
body.joint .sentence { font-size: clamp(1.7rem, 8vw, 2.7rem); line-height: 1.08; }
/* small labels read better in the reading face than in a heavy display face */
body.joint .k { font-family: var(--j-text); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.02em; color: var(--ink); }
body.joint button, body.joint .button { font-family: var(--j-button, var(--j-text)); font-weight: var(--j-button-weight, 600); font-size: 1.05rem; letter-spacing: 0; }

/* A line kept for a screen reader and hidden from sight (the home's own title, where the
   lockup stands in for it). */
body.joint .sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---- the buttons ---- */
body.joint button, body.joint .button { background: var(--btn); border-color: var(--btn-edge); color: var(--btn-ink); }
body.joint button.quiet, body.joint .button.quiet { background: transparent; border-color: var(--ink); color: var(--ink); }
@media (hover: hover) {
  body.joint button:hover, body.joint .button:hover { background: var(--ground); border-color: var(--ink); color: var(--ink); }
  body.joint button.quiet:hover, body.joint .button.quiet:hover { background: var(--field); color: var(--ink); }
}

/* ---- LOOP's orange (R732, R734) ----
   letters: the emblem keeps its letters in peach; the buttons and fills are the look's own.
   fills:   peach fills the buttons and one panel, with #111111 words; the emblem is a peach
            disc with dark letters (its file).
   both:    peach letters in the emblem, and the peach fills.
   By day a peach shape is faint on the ground, so it carries a keyline in the text color. */
body.joint.orange-fills, body.joint.orange-both { --btn: var(--orange); --btn-ink: var(--on-fill); --btn-edge: var(--orange); }
body.joint.day.orange-fills, body.joint.day.orange-both { --btn-edge: var(--ink); }
body.joint.orange-fills .panel, body.joint.orange-both .panel { background: var(--orange); color: var(--on-fill); border: 2px solid var(--orange); border-radius: 1.1rem; padding: 1.1rem 1.15rem; }
body.joint.day.orange-fills .panel, body.joint.day.orange-both .panel { border-color: var(--ink); }
body.joint.orange-fills .panel .k, body.joint.orange-both .panel .k,
body.joint.orange-fills .panel label, body.joint.orange-both .panel label,
body.joint.orange-fills .panel .help, body.joint.orange-both .panel .help,
body.joint.orange-fills .panel .error, body.joint.orange-both .panel .error,
body.joint.orange-fills .panel a, body.joint.orange-both .panel a { color: var(--on-fill); }
body.joint.orange-fills .panel p:last-child, body.joint.orange-both .panel p:last-child { margin-bottom: 0; }
/* inside the peach panel: dark fields with the panel's own dark for their edge, and a dark button */
body.joint.orange-fills .panel input, body.joint.orange-both .panel input,
body.joint.orange-fills .panel textarea, body.joint.orange-both .panel textarea { background: #FFFEEF; color: #111111; border-color: #111111; }
body.joint.orange-fills .panel button, body.joint.orange-both .panel button { background: #111111; border-color: #111111; color: #FFFEEF; }
/* the focus ring inside the peach panel is the panel's dark, 7.77 to 1 on peach in every look (loop.css draws it in the
   look's text color, which by night is 2.2 to 2.4 to 1 on peach) */
body.joint.orange-fills .panel :focus-visible, body.joint.orange-both .panel :focus-visible { outline-color: #111111; }
body.joint.orange-fills section.panel, body.joint.orange-both section.panel { margin: 0.5rem 0 2.25rem; padding: 1.5rem 1.15rem 1.6rem; border-top-width: 2px; }
body.joint.orange-fills section.panel + .screen, body.joint.orange-both section.panel + .screen { border-top: 0; }
/* the peach emblem by day: a keyline round it, in the text color */
body.joint.day.orange-fills .emblem { border-radius: 50%; box-shadow: 0 0 0 2px var(--ink); }

/* ---- lime, in one place (R721) ----
   line:    one short heavy rule under the lockup.
   buttons: the filled buttons are lime, with #111111 words.
   name:    by night Live Launch's logo is lime (its file); by day a lime block sits behind the dark logo.
   By day a lime shape carries a keyline in the text color. Lime wins the buttons from peach. */
body.joint .lime-rule { display: block; width: 5.5rem; height: 0.45rem; margin: 0 0 1.35rem; border: 0; border-radius: 999px; background: var(--lime); }
body.joint.day .lime-rule { box-shadow: 0 0 0 1.5px var(--ink); }
body.joint.lime-buttons { --btn: var(--lime); --btn-ink: var(--on-fill); --btn-edge: var(--lime); }
body.joint.day.lime-buttons { --btn-edge: var(--ink); }
body.joint.day.lime-name .ll-name { background: var(--lime); box-shadow: 0 0 0 1.5px var(--ink); border-radius: 0.4rem; padding: 0.4rem 0.6rem; }

/* ---- the lockup ---- */
body.joint .lockup { display: block; margin: 0 0 1.1rem; color: var(--ink); }
body.joint .marks { display: flex; align-items: center; gap: 1rem; margin: 0 0 0.9rem; }
body.joint .marks .emblem { width: 4.25rem; height: 4.25rem; flex: none; }
body.joint .ll-name { display: inline-block; line-height: 0; }
body.joint .ll { display: block; height: 1.7rem; width: auto; }
body.joint .lockup .words { display: block; width: 100%; height: auto; max-width: 22rem; overflow: visible; }
body.joint .lockup .words path { fill: var(--ink); }
/* the home's first screen: the lockup is its headline */
body.joint .hero { padding-top: max(1.5rem, env(safe-area-inset-top)); }
/* the photograph beside the home's line: a tall frame at the left, the line at its right */
/* (the line starts level with the photograph's top) */
body.joint .hero .beside { display: grid; grid-template-columns: 42% 1fr; gap: 1rem; align-items: start; margin: 0 0 1.1rem; }
body.joint .hero .beside .photo { margin: 0; }
body.joint .hero .lead { font-size: 1.06rem; line-height: 1.42; margin: 0; text-wrap: pretty; }
body.joint .hero .where { margin-bottom: 0.6rem; }
body.joint .hero .hours { margin-bottom: 0; }
body.joint .hero .panel { margin: 0 0 1.25rem; }
body.joint .hero .doors { margin-top: 0; gap: 0.6rem; grid-template-columns: 1fr 1fr; }
body.joint .hero .doors .quiet { grid-column: 1 / -1; }
/* a door is 4rem tall and grows with its words, so a line that wraps a third time (a narrow phone, wider text spacing)
   stays inside it; two doors in a row still stretch to one height. The page preloads the reading face's two weights,
   so no word wraps a second time when the face arrives. */
body.joint .hero .doors .button { height: auto; min-height: 4rem; padding: 0.5rem 0.75rem; font-size: 0.98rem; line-height: 1.25; display: grid; place-items: center; }
/* /looped-in's top: the lockup, small, as the way home */
body.joint .joint-top { display: block; padding-top: max(1.25rem, env(safe-area-inset-top)); }
body.joint .joint-top .home-link { display: inline-block; text-decoration: none; color: inherit; }
body.joint .joint-top .lockup { margin: 0; }
body.joint .joint-top .marks { gap: 0.75rem; margin-bottom: 0.6rem; }
body.joint .joint-top .marks .emblem { width: 3.25rem; height: 3.25rem; }
body.joint .joint-top .ll { height: 1.35rem; }
body.joint .joint-top .lockup .words { max-width: 12.5rem; }

/* ---- a photograph: framed, so the look's ground stays the first thing seen ---- */
body.joint .photo { position: relative; margin: 0 0 1.25rem; border-radius: 1rem; overflow: hidden; background: var(--field); }
body.joint .photo img { display: block; width: 100%; height: auto; }
/* /looped-in: the photograph under the lead */
body.joint.loop-looped .screen.first .photo { margin-top: 1.5rem; margin-bottom: 0; }

/* ---- forms on the look ---- */
body.joint .error { font-size: 1.05rem; }
body.joint.day input[aria-invalid='true'], body.joint.day textarea[aria-invalid='true'] { box-shadow: 0 0 0 2px var(--ink); }
body.joint .host textarea { border-color: var(--ink); }
body.joint.night .host textarea { border-color: var(--orange); }
/* inside the peach panel a peach underline would be peach on peach: there the note field keeps the panel's dark */
body.joint.night.orange-fills .panel textarea, body.joint.night.orange-both .panel textarea { border-color: #111111; }
body.joint .said { border-left-color: var(--ink); }
body.joint.night .said { border-left-color: var(--orange); }
/* the stewards address inside a thanks line: whole on one row, in the reading face */
body.joint .said .addr { font-family: var(--j-text); font-weight: 600; font-size: 0.8em; letter-spacing: 0; white-space: nowrap; }
body.joint .banner { background: var(--ink); color: var(--ground); }

/* ---- the foot: the photographer's credit (R744) ----
   one plain line after the footer's other lines, at the footer's own size and in the look's soft color, on the
   ground: 6.51 to 11.46 to 1 in the six looks. Never peach, never lime. */
body.joint .foot .credit { color: var(--soft); font-size: 1rem; }

@media (min-width: 60rem) {
  body.joint .hero .beside { grid-template-columns: 18.5rem 1fr; gap: 2rem; }
  body.joint .hero .lead { font-size: 1.45rem; line-height: 1.35; }
  body.joint .lockup .words { max-width: 27rem; }
  body.joint .marks .emblem { width: 5.5rem; height: 5.5rem; }
  body.joint .ll { height: 2.1rem; }
  body.joint .hero .doors { grid-template-columns: 1fr 1fr 1fr; }
  body.joint .hero .doors .quiet { grid-column: auto; }
  body.joint .joint-top .marks .emblem { width: 3.5rem; height: 3.5rem; }
  body.joint .joint-top .ll { height: 1.45rem; }
  body.joint .joint-top .lockup .words { max-width: 12.5rem; }
}

/* ---- Part 3a, the preview round (R741, R747): the choices Casey picked from. Each sits behind a preview
   switch (lib/joint.js). His pick is presence=framed (R749 (1)): with no switch a page wears it. The drawn ampersand
   and the corner marks round "Live" went out with their outlines in Part 3b. ---- */

/* presence=matched: Live Launch's logo comes first, at about twice its size, so it weighs what LOOP's emblem weighs */
/* (the logo is 4.36 times as wide as it is tall: on a narrow phone it gives way so the row still fits the column,
   and it never falls under the size it has as built; with the lime block behind it by day, the block's padding counts) */
body.joint.presence-matched .marks .ll { height: clamp(1.7rem, calc((100vw - 8.75rem) / 4.36), 3.1rem); }
body.joint.presence-matched .joint-top .marks .ll { height: clamp(1.35rem, calc((100vw - 7.5rem) / 4.36), 2.45rem); }
body.joint.presence-matched.day.lime-name .ll-name { padding: 0.55rem 0.8rem; }
body.joint.presence-matched.day.lime-name .marks .ll { height: clamp(1.7rem, calc((100vw - 10.35rem) / 4.36), 3.1rem); }
body.joint.presence-matched.day.lime-name .joint-top .marks .ll { height: clamp(1.35rem, calc((100vw - 9.1rem) / 4.36), 2.45rem); }
/* and the footer names Live Launch beside LOOP */
body.joint .foot .links + .links { margin-top: -0.35rem; }

/* presence=framed: Live Launch's two corner marks hold the whole lockup, top left and bottom right, as they hold
   its own name in its logo. They take the lime where lime is the line (the rule under the lockup gives way to them,
   so the lime still shows only on Live Launch's own device), and the text color otherwise. By day a lime shape
   carries a keyline. */
body.joint.presence-framed .lockup { position: relative; width: fit-content; max-width: 100%; padding: 1.15rem 1.35rem 1.2rem 1.15rem; margin-bottom: 1.25rem; }
body.joint.presence-framed .lockup .words { width: 22rem; max-width: 100%; }
body.joint .lockup .corner { position: absolute; display: block; width: 1.75rem; height: auto; overflow: visible; }
body.joint .lockup .corner-tl { top: 0; left: 0; }
body.joint .lockup .corner-br { bottom: 0; right: 0; }
body.joint .lockup .corner path { fill: var(--ink); }
body.joint.lime-line .lockup .corner path { fill: var(--lime); }
body.joint.day.lime-line .lockup .corner path { stroke: var(--ink); stroke-width: 3px; stroke-linejoin: round; paint-order: stroke; vector-effect: non-scaling-stroke; }
body.joint.presence-framed .joint-top .lockup { padding: 0.8rem 0.95rem 0.85rem 0.8rem; margin-bottom: 0; }
body.joint.presence-framed .joint-top .lockup .words { width: 12.5rem; }
body.joint.presence-framed .joint-top .lockup .corner { width: 1.2rem; }

@media (min-width: 60rem) {
  body.joint.presence-matched .marks .ll { height: 4rem; }
  body.joint.presence-matched .joint-top .marks .ll { height: 2.6rem; }
  body.joint.presence-framed .lockup { padding: 1.5rem 1.75rem 1.55rem 1.5rem; }
  body.joint.presence-framed .lockup .words { width: 27rem; }
  body.joint.presence-framed .lockup .corner { width: 2.25rem; }
  body.joint.presence-framed .joint-top .lockup { padding: 0.8rem 0.95rem 0.85rem 0.8rem; }
  body.joint.presence-framed .joint-top .lockup .words { width: 12.5rem; }
  body.joint.presence-framed .joint-top .lockup .corner { width: 1.2rem; }
}

/* ---- Part 3b, Casey's pick (R749, R750): what a page wears with no switch ----
   No lime and no orange (lime-none, orange-none): nothing on the page is lime and nothing is peach. The corner marks
   and the lockup take the look's text color (the rules above, with no lime-line), the emblem is its no-peach file,
   and what the night painted peach (an error's words, an invalid field's edge, the note field's underline, the rule
   beside a thanks, the plus of an ask) takes the text color too, as it does by day. */
body.joint.orange-none { --peach: var(--ink); }
body.joint.night.orange-none .host textarea { border-color: var(--ink); }
body.joint.night.orange-none .said { border-left-color: var(--ink); }
body.joint.night.orange-none input[aria-invalid='true'], body.joint.night.orange-none textarea[aria-invalid='true'] { box-shadow: 0 0 0 2px var(--ink); }

/* /loop-hotels and the hotels' own links in the joint look (R750 (2)): the look's type on the parts only that page
   has. An ask's title is a control, so it reads in the reading face; the hotel's name under the title is display. */
body.joint .ask summary { font-family: var(--j-text); font-weight: 600; font-size: 1.1rem; letter-spacing: 0; }
body.joint .for { font-family: var(--j-display); font-weight: var(--j-display-weight, 400); letter-spacing: var(--j-display-tracking, 0); color: var(--ink); }

/* Forced colors (a high-contrast theme of the visitor's own): the browser repaints the page's ground and text but
   leaves a drawing's own fills and the two mark files as they are, so dark words could land on a dark ground. The
   lockup therefore keeps its own small ground there: one tile in the look's colors, words and marks together. */
@media (forced-colors: active) {
  body.joint .lockup { forced-color-adjust: none; background: var(--ground); padding: 0.6rem 0.75rem; border-radius: 0.75rem; }
  body.joint.presence-framed .lockup { border-radius: 0; }
}
