/* ==========================================================================
   7.MATTER — sidebar v2 (11 Nov 2026)
   Loaded after the build CSS and sections.css. Overrides the sidebar only.
   1. Follows the light/dark switch (Paper in light, Ink in dark).
   2. Desktop: a 98px rail showing the start of each menu label, faded into the rail.
      The menu button (or a tap on a faded label) opens it to 272px; /sidebar.js runs it.
   3. The full logo sits in a pinned translucent bar across the top of the content.
   The light/dark toggle itself is untouched: same size, same place, always usable.
   ========================================================================== */

/* ---------- 1. theme: the sidebar uses the page tokens, not fixed Ink ---------- */
html .sidebar {
  --text: inherit;
  --muted: inherit;
  --muted-2: inherit;
  --line: inherit;
  --surface: inherit;

  --sb-dur: .46s;
  --sb-ease: cubic-bezier(.35, .1, .1, 1);
  --sb-link: #141414b8;
  --sb-hover: var(--concrete);
  --sb-active: var(--concrete);
  --sb-label: #1414148f;
  --sb-shadow: 12px 0 40px #14141424;

  background: var(--bg);
  color: var(--text);
  border-right: 1px solid var(--line);
  transition: background-color .26s ease, color .26s ease, border-color .26s ease;
}
html[data-theme=dark] .sidebar {
  --sb-link: #ffffffb8;
  --sb-hover: #ffffff0f;
  --sb-active: #ffffff1a;
  --sb-label: var(--muted-2);
  --sb-shadow: 12px 0 40px #00000047;
}
html .sidebar .logo-svg,
html .sidebar .sb-mark,
html .sidebar .sb-menu { color: var(--text); }
html .sidebar .sb-label { color: var(--sb-label); }
html .sidebar .sb-link { color: var(--sb-link); }
html .sidebar .sb-link:hover,
html .sidebar .sb-link:focus-visible { color: var(--text); background: var(--sb-hover); }
html .sidebar .sb-link.active { color: var(--text); background: var(--sb-active); }
html .sidebar :focus-visible { outline-color: var(--text); }

/* phone and tablet: the bar sits on the page, so it needs a hairline instead of Ink */
@media (max-width: 860px) {
  html .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  html .sb-toggle, html .sb-hints { display: none; }
}

/* ---------- 2. desktop: faded rail that opens on click ---------- */
@media (min-width: 861px) {
  html:root { --nav-w: 98px; }

  html .sidebar,
  html .sidebar:hover,
  html .sidebar:focus-within {
    width: 98px;
    max-width: 90vw;
    padding: 94px 9px 18px;
    overflow: hidden;
    box-shadow: none;
    transition: width .38s ease, background-color .26s ease, border-color .26s ease;
  }
  html[data-sb=open] .sidebar,
  html[data-sb=open] .sidebar:hover,
  html[data-sb=open] .sidebar:focus-within {
    width: 272px;
    overflow-y: auto;
  }

  /* the panel keeps its open width, so labels sit in place and are simply cut by the rail */
  html .sidebar .sb-panel,
  html .sidebar:hover .sb-panel,
  html .sidebar:focus-within .sb-panel {
    width: 254px;
    margin-top: 0;
    opacity: 1;
    visibility: visible;
    transition: none;
  }

  /* collapsed: the start of each label shows at 17%, fading out across the rail */
  html .sidebar .sb-nav {
    opacity: .17;
    -webkit-mask-image: linear-gradient(90deg, #000 18px, transparent 96px);
    mask-image: linear-gradient(90deg, #000 18px, transparent 96px);
    transition: opacity .35s ease;
  }
  html[data-sb=open] .sidebar .sb-nav {
    opacity: 1;
    -webkit-mask-image: none;
    mask-image: none;
  }

  /* menu metrics from the faded-menu spec, in the site's type and colours */
  html .sidebar .sb-label {
    margin: 22px 0 9px 13px;
    padding: 0;
    font-size: 10px;
    letter-spacing: .17em;
  }
  html .sidebar .sb-nav > div:first-child .sb-label,
  html .sidebar .sb-nav > :first-child .sb-label { margin-top: 0; }
  html .sidebar .sb-nav ul { margin: 0; gap: 0; }
  html .sidebar .sb-link {
    padding: 11px 13px;
    border-radius: 9px;
    font-size: 17px;
    white-space: nowrap;
  }

  /* light/dark switch stays crisp and usable in both states */
  html .sidebar .sb-foot { padding: 14px 10px 0; }
}

/* the menu button: three bars that turn into a close icon (added by /sidebar.js).
   Its centre (18px + 24px = 42px) lines up with the logo's centre in the top bar,
   which is the middle of the 84px bar: equal space above and below (12 Nov). */
.sb-toggle {
  position: fixed;
  top: 18px;
  left: 23px;
  z-index: 61;
  width: 52px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-content: center;
  gap: 5px;
}
.sb-toggle i {
  display: block;
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .3s ease, opacity .3s ease;
}
html[data-sb=open] .sb-toggle i:first-child { transform: translateY(7px) rotate(45deg); }
html[data-sb=open] .sb-toggle i:nth-child(2) { opacity: 0; }
html[data-sb=open] .sb-toggle i:last-child { transform: translateY(-7px) rotate(-45deg); }
.sb-toggle:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }

/* invisible layer over the faded labels: the first tap only opens the menu */
.sb-hints {
  position: fixed;
  top: 94px;
  left: 0;
  width: 98px;
  bottom: var(--sb-foot-h, 72px);
  z-index: 61;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
html[data-sb=open] .sb-hints { display: none; }

@media (prefers-reduced-motion: reduce) {
  html .sidebar,
  html .sidebar *,
  .sb-toggle i { transition: none !important; }
}

/* ---------- full logo: pinned in a translucent bar across the top of the content ----------
   The bar spans the area right of the sidebar and stays put while the page scrolls.
   The logo keeps the design-system size (150-196px wide) and sits centred in the bar. */
/* 27 Nov: the bar is solid in the page colour (was translucent), so the bar, the side menu and
   the rounded page corner are always one colour, even over dark or photo sections. */
html { --bar-h: 84px; --bar-bg: var(--bg); }
html .main-header {
  position: fixed;
  top: 0;
  left: var(--nav-w);
  right: 0;
  z-index: 50;
  height: var(--bar-h);
  padding: 0;
  box-sizing: border-box;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  background: var(--bar-bg);
  transition: background-color .26s ease;
}
html .main-header a { display: block; padding: 6px; color: var(--text); }
@media (min-width: 861px) {
  html .sidebar .sb-top { display: none; }
  /* content starts below the bar, and in-page links stop below it too */
  html .page-shell { padding-top: var(--bar-h); }
  html { scroll-padding-top: var(--bar-h); }
}
@media (max-width: 860px) {
  html .main-header { display: none; }
}

/* ==========================================================================
   Footer (11 Nov 2026), built to the user's light and dark footer mockups.
   Restyles the existing footer markup only (it is rendered by React, so the
   HTML must stay as it is). Follows the light/dark switch.
   ========================================================================== */
/* the footer uses the page background, so it matches the white (or Ink) above it */
html { --footer-bg: var(--bg); }

html .site-footer {
  --text: inherit;
  --muted: inherit;
  --muted-2: inherit;
  --line: inherit;
  min-height: 0;
  padding: 0 60px;
  background: var(--footer-bg);
  color: var(--text);
  display: block;
  transition: background-color .26s ease, color .26s ease;
}
html .site-footer .footer-grid-bg { display: none; }

/* newsletter band (switchable in the dashboard): keeps its own Ink design,
   as a full-width block above the footer, in both themes */
html .site-footer .nl-band {
  margin: 0 -60px;
  padding: 88px 60px 0;
  background: var(--ink);
  color: #fff;
}
html .site-footer .nl-band-inner { margin-bottom: 0; border-bottom: 0; }

/* newsletter band, simplified (12 Nov): just "Join the newsletter" (heading text set by
   /sidebar.js), the email field and the button. The small NEWSLETTER label and the paragraph
   are hidden, and on wide screens the form sits 100px after the heading instead of at the
   far right. */
html .site-footer .nl-band .nl-label,
html .site-footer .nl-band .nl-band-line { display: none; }
@media (min-width: 1181px) {
  html .site-footer .nl-band-inner {
    grid-template-columns: auto minmax(0, 460px);
    justify-content: start;
    column-gap: 100px;
  }
}

/* main block: brand and HQ on the left, Explore and Company on the right */
html .site-footer .footer-inner {
  position: relative;
  z-index: 2;
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 567fr) minmax(0, 218fr) minmax(0, 181fr);
  grid-template-areas:
    "logo    explore company"
    "tagline explore company"
    "meta    .       social";
  grid-template-rows: auto 1fr auto;
  column-gap: 0;
  row-gap: 0;
  padding-top: 69px;
}
html .site-footer .footer-brand,
html .site-footer .footer-links { display: contents; }

html .site-footer .footer-mark { grid-area: logo; justify-self: start; margin: 0; padding: 6px 6px 6px 0; line-height: 0; }
html .site-footer .footer-mark .logo-svg { width: 217px; color: var(--text); }

html .site-footer .footer-brand p {
  grid-area: tagline;
  max-width: 460px;
  margin: 17.5px 0 0;
  font-size: 19.5px;
  line-height: 1.3;
  color: var(--text);
}

html .site-footer .footer-meta {
  grid-area: meta;
  margin: 17px 0 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
}
html .site-footer .footer-meta small,
html .site-footer .footer-links h4 {
  display: block;
  margin: 0 0 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .2em;
  text-transform: uppercase;
}
html .site-footer .footer-meta small::before { content: none; display: none; }
html .site-footer .footer-meta small { margin-bottom: 8px; }
html .site-footer .footer-meta small::after,
html .site-footer .footer-links h4::after { content: ":"; }

html .site-footer .footer-links > div { padding-top: 19px; }
html .site-footer .footer-links > div:first-child { grid-area: explore; }
html .site-footer .footer-links > div:last-child { grid-area: company; }
html .site-footer .footer-links h4 { margin-bottom: 10px; }
html .site-footer .footer-links a {
  display: table;
  margin: 0;
  padding: 0;
  font-size: 17px;
  line-height: 30px;
  color: var(--text);
}

/* social: two outlined circles, ending at the right edge, level with the HQ line */
html .site-footer .footer-social { grid-area: social; justify-self: end; align-self: end; gap: 12px; margin: 0 0 -4px; }
html .site-footer .footer-social a {
  width: 36px;
  height: 36px;
  border: 1px solid var(--text);
  color: var(--text);
}
html .site-footer .footer-social a svg { width: 16px; height: 16px; }
html .site-footer .footer-social a:hover,
html .site-footer .footer-social a:focus-visible { background: var(--accent); border-color: var(--accent); color: var(--ink); }

/* full-width rule, then copyright and line */
html .site-footer .footer-bottom {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 31px 0 0;
  padding: 14px 0 28px;
  border-top: 1px solid var(--text);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.5;
}
html .site-footer .footer-bottom-mark { gap: 0; }
html .site-footer .footer-bottom-mark .mark-svg { display: none; }

/* dot field in the top-right corner, thinning towards the bottom left */
html .site-footer .footer-inner::before {
  content: "";
  position: absolute;
  top: 6px;
  right: -60px;
  width: 330px;
  height: 80px;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--text) 0 1px, transparent 1.4px);
  background-size: 24px 20px;
  background-position: right 7px top 0;
  opacity: .42;
  -webkit-mask-image: linear-gradient(200deg, #000 38%, transparent 62%);
  mask-image: linear-gradient(200deg, #000 38%, transparent 62%);
}

/* tablet: narrower side padding */
@media (max-width: 980px) {
  html .site-footer { padding: 0 32px; }
  html .site-footer .nl-band { margin: 0 -32px; padding-left: 32px; padding-right: 32px; }
  html .site-footer .footer-inner::before { right: -32px; }
}
/* phone: stack everything */
@media (max-width: 680px) {
  html .site-footer { padding: 0 16px; }
  html .site-footer .nl-band { margin: 0 -16px; padding: 56px 16px 0; }
  html .site-footer .footer-inner {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "logo    logo"
      "tagline tagline"
      "explore company"
      "meta    meta"
      "social  social";
    grid-template-rows: auto;
    padding-top: 56px;
  }
  html .site-footer .footer-inner::before { right: -16px; width: 200px; }
  html .site-footer .footer-links > div { padding-top: 36px; }
  html .site-footer .footer-meta { margin-top: 36px; }
  html .site-footer .footer-social { justify-self: start; margin: 24px 0 0; }
  html .site-footer .footer-bottom { flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 28px; padding-bottom: 28px; }
}

/* ==========================================================================
   Success ticks (newsletter, contact form): brand colours instead of green.
   Banana circle with an Ink tick; where the circle is Ink, the tick is Banana.
   ========================================================================== */
html .nl-success-icon svg,
html .nl-success-icon svg *,
html .ct-success-icon svg,
html .ct-success-icon svg *,
html .form-success-icon svg,
html .form-success-icon svg * { stroke: currentColor; }
html .ct-success-icon,
html .form-success-icon { background: var(--banana); color: var(--ink); }

/* ---------- rounded corner where the page meets the menu rail and the top bar (12 Nov) ----------
   A small square of the page background sits just below the top bar, at the rail's edge,
   with a quarter circle cut out, so the page's top-left corner looks rounded. (Solid, not
   the bar's translucent colour, which tinted the corner over coloured sections like the
   Store banner.) It follows the rail's
   edge when the menu opens (98px -> 272px) at the same speed as the menu. */
@media (min-width: 861px) {
  html { --corner-r: 24px; }
  html .main-header::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: var(--corner-r);
    height: var(--corner-r);
    pointer-events: none;
    background: var(--bg);
    -webkit-mask: radial-gradient(circle at 100% 100%, transparent calc(var(--corner-r) - .5px), #000 var(--corner-r));
    mask: radial-gradient(circle at 100% 100%, transparent calc(var(--corner-r) - .5px), #000 var(--corner-r));
    transform: translateX(0);
    transition: transform .38s ease, background-color .26s ease;
  }
  html[data-sb=open] .main-header::after { transform: translateX(min(174px, calc(90vw - 98px))); }
}
@media (min-width: 861px) and (prefers-reduced-motion: reduce) {
  html .main-header::after { transition: none; }
}

/* ---------- Updates page: one combined block (18 Nov) ----------
   The big "What we're printing" heading and the email signup are one block: the UPDATES
   label, the intro paragraph, the divider and the "Get new updates by email" heading and
   its line are hidden. On wide screens the form sits beside the heading; when there is not
   room it drops underneath. CSS only, so React's markup is untouched. */
html .upd-head .upd-head-copy > .nl-label,
html .upd-head .upd-head-intro,
html .upd-head .upd-signup > div:first-child { display: none; }
html .upd-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 32px 48px;
}
html .upd-head .upd-head-copy { max-width: none; flex: 0 1 auto; }
html .upd-head .upd-signup {
  display: block;
  flex: 1 1 380px;
  max-width: 460px;
  margin: 0;
  padding: 0;
  border-top: 0;
}
@media (max-width: 760px) {
  html .upd-head { gap: 28px; }
  html .upd-head .upd-signup { flex-basis: 100%; max-width: none; }
}

/* ---------- 1 Dec 2026: design-system alignment ----------
   Form fields are underline-only (1px muted underline, 2px orange underline on focus); the accent
   is signal orange with ink text (see app/globals.css tokens). */
html .nl-input,
html .upd-signup .nl-input {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid var(--muted-2) !important;
  border-radius: 0 !important;
  padding: 0 2px !important;
  color: var(--text) !important;
  box-shadow: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
html .nl-band .nl-input { border-bottom-color: rgba(255,255,255,.42) !important; color: #fff !important; }
html .nl-input:focus,
html .nl-input:focus-visible { outline: none !important; border-bottom-color: var(--text) !important; box-shadow: 0 2px 0 0 var(--orange) !important; }
html .nl-band .nl-input:focus,
html .nl-band .nl-input:focus-visible { border-bottom-color: #fff !important; }
html .nl-input[aria-invalid="true"] { border-bottom-color: #C62828 !important; }
html .nl-band .nl-input[aria-invalid="true"] { border-bottom-color: #FF8A80 !important; }
