/* Open Desk. Light mode only, warm palette, HiOS design language (static variant): quiet canvas,
   light display type, pill controls, faint uniform tint with no blur, no rims, soft exterior shadow,
   solid fallbacks for reduced transparency, more contrast and forced colours. */
:root {
  --canvas: #fbf6ee;        /* warm paper */
  --canvas-2: #f6eee2;
  --surface: #fffdf9;
  --ink: #2b2119;
  --ink-2: #4a3d33;
  --muted: #7a6a5d;
  --line: rgba(74, 52, 33, .11);
  --accent: #c2552d;        /* terracotta */
  --accent-ink: #fff;
  --accent-soft: rgba(194, 85, 45, .10);
  --amber: #d99a2b;
  --amber-soft: rgba(217, 154, 43, .14);
  --sage: #5c8a4f;
  --sage-soft: rgba(92, 138, 79, .13);
  --tint: rgba(232, 176, 108, .08);
  --shadow: 0 1px 2px rgba(84, 56, 30, .05), 0 8px 28px rgba(84, 56, 30, .07);
  --radius: 20px;
  --font: "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--canvas); color: var(--ink); font: 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { margin: 0; background: radial-gradient(1200px 500px at 85% -120px, rgba(232, 160, 92, .13), transparent 70%), radial-gradient(900px 420px at -10% 0, rgba(217, 154, 43, .07), transparent 70%); background-repeat: no-repeat; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: rgba(194, 85, 45, .4); }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
code, pre { font-family: var(--mono); font-size: .86em; }
p code, li code { background: var(--canvas-2); padding: 1px 6px; border-radius: 6px; }
.math .katex { font-size: 1.02em; }

/* Floating navigation pill */
.bar { position: sticky; top: 12px; z-index: 10; display: flex; align-items: center; gap: 6px; width: min(1080px, calc(100% - 24px));
  margin: 12px auto 0; padding: 7px 8px 7px 18px; border-radius: 999px; background: rgba(255, 253, 249, .9);
  background-image: linear-gradient(var(--tint), var(--tint)); box-shadow: var(--shadow); }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: -.02em; text-decoration: none; margin-right: auto; }
.mark { width: 22px; height: 22px; border-radius: 7px; background: var(--accent) url(/favicon.svg) center/cover; }
.bar nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.bar nav a { text-decoration: none; white-space: nowrap; padding: 8px 14px; border-radius: 999px; font-size: .92rem; color: var(--ink-2); }
.bar nav a:hover { background: var(--accent-soft); color: var(--accent); }
.bar nav a[aria-current] { background: var(--ink); color: var(--canvas); }

main { width: min(1080px, calc(100% - 40px)); margin: 0 auto; }
section { padding: 40px 0; border-top: 1px solid var(--line); }
.strip + section, .hero, .hero + section, .crumbs + section { border-top: 0; }
h1 { font-weight: 500; font-size: clamp(2.3rem, 5.4vw, 4.1rem); line-height: 1.07; letter-spacing: -.05em; margin: 8px 0 16px; max-width: 18ch; }
.slim h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); max-width: 26ch; }
h2 { font-weight: 550; font-size: 1.45rem; letter-spacing: -.03em; margin: 0 0 14px; }
h3 { font-weight: 600; font-size: 1.05rem; letter-spacing: -.015em; margin: 0 0 6px; }
p, li { max-width: 72ch; }
.hero { padding: 52px 0 36px; }
.hero.slim { padding: 40px 0 20px; }
.eyebrow { font-size: .82rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin: 0; }
.lede { font-size: 1.16rem; color: var(--ink-2); max-width: 60ch; }
.verdict { font-size: 1.1rem; margin: 0 0 10px; }
.verdict b { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.head a { font-size: .92rem; }
.crumbs { margin: 28px 0 0; font-size: .9rem; color: var(--muted); }

/* Status strip */
.strip { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 22px; font-size: .88rem; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: var(--ink-2); }
a.chip:hover { color: var(--accent); }
.dot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.d-working { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.d-checked { background: var(--sage); }
.d-open { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
.d-idle { background: #c9b8a6; }
@media (prefers-reduced-motion: no-preference) { .strip .d-working { animation: pulse 2s ease-in-out infinite; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 22px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  border: 0; text-decoration: none; font: 600 .96rem var(--font); cursor: pointer; box-shadow: 0 6px 18px rgba(194, 85, 45, .22); }
.btn:hover { color: var(--accent-ink); background: #ad4824; }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.btn.ghost:hover { color: var(--accent); }
.btn.small { padding: 8px 16px; font-size: .88rem; box-shadow: none; }
.btn:disabled { opacity: .6; cursor: default; }

.pill { display: inline-block; white-space: nowrap; font-size: .72rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; }
.l-warmup { background: var(--sage-soft); color: #3f6a35; }
.l-formalize { background: var(--amber-soft); color: #8a5a0c; }
.l-open { background: var(--accent-soft); color: #a3431f; }
.k-state { background: #f3e7f7; color: #6d3f80; }
.k-compute { background: #e5eef6; color: #2f5878; }
.pills { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.tags li { font-size: .8rem; color: var(--ink-2); background: var(--canvas-2); padding: 2px 10px; border-radius: 999px; }
.prize { color: #8a5a10; background: var(--amber-soft); }
.job { background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius); padding: 22px 26px; }
.job h3 { margin-top: 0; }
.credit { font-size: .82rem; color: var(--muted); }
.s-planned { background: var(--amber-soft); color: #8a5a0c; }
.s-partner { background: var(--canvas-2); color: var(--ink-2); }
.state { display: inline-flex; align-items: center; gap: 7px; margin-left: 8px; font-size: .9rem; color: var(--ink-2); }

/* Cards and grids */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { display: block; padding: 20px 22px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
  transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { color: var(--ink); transform: translateY(-2px); box-shadow: 0 2px 4px rgba(84, 56, 30, .06), 0 14px 34px rgba(84, 56, 30, .1); }
.card p { font-size: .93rem; margin: 6px 0; color: var(--ink-2); }
.card .pill { margin-bottom: 10px; }
.coll h3 { margin-bottom: 4px; }

.counters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.counter { padding: 18px 22px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.counter b { display: block; font-size: 2.2rem; font-weight: 500; letter-spacing: -.04em; line-height: 1.1; }
.counter span { font-size: .9rem; color: var(--muted); }
progress { appearance: none; display: block; width: 100%; height: 6px; margin: 12px 0 4px; border: 0; border-radius: 99px; background: var(--canvas-2); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--canvas-2); }
progress::-webkit-progress-value { background: var(--sage); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--sage); border-radius: 99px; }

/* Connect box: the one thing to do */
.connect-box { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: start; margin: 8px 0; padding: 30px; border-radius: 26px; border-top: 0;
  background: linear-gradient(135deg, #fff4e6, #fdebdc); box-shadow: var(--shadow); }
.connect-box.single { grid-template-columns: 1fr; }
.connect-box + section { border-top: 0; }
.copy { display: flex; gap: 10px; align-items: center; margin: 14px 0; padding: 12px 12px 12px 18px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.copy code { flex: 1; font-size: .88rem; line-height: 1.5; user-select: all; word-break: break-word; }
.notice { margin: 12px 0 0; padding: 12px 16px; border-radius: 14px; background: rgba(255, 253, 249, .75); font-size: .92rem; color: var(--ink-2); border-left: 3px solid var(--amber); }
ol.how { margin: 0; padding: 0; list-style: none; counter-reset: how; }
ol.how li { counter-increment: how; position: relative; padding: 0 0 14px 40px; }
ol.how li::before { content: counter(how); position: absolute; left: 0; top: 0; width: 27px; height: 27px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: .85rem; font-weight: 650; display: grid; place-items: center; }
ul.plain { padding-left: 1.1em; } ul.plain li { margin: 5px 0; }

.featured { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none; }
.featured li { display: inline-flex; align-items: center; gap: 9px; padding: 9px 16px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); }
.featured a { text-decoration: none; font-weight: 550; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.leaders { list-style: none; padding: 0; margin: 0; }
.leaders li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rank { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 650; background: var(--canvas-2); }
.leaders li:first-child .rank { background: var(--amber); color: #fff; }
.score { margin-left: auto; color: var(--muted); font-size: .9rem; }
.feed { list-style: none; padding: 0; margin: 0; }
.feed li { display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.feed time { margin-left: auto; color: var(--muted); font-size: .82rem; }
.feed .who { font-weight: 600; }
.f-solved .who { color: var(--sage); }

.legend { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px 26px; font-size: .93rem; color: var(--ink-2); }
.legend li { display: flex; gap: 10px; align-items: baseline; }
.legend .dot { position: relative; top: 1px; }

/* Problems list */
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.filters input, .filters select { font: .95rem var(--font); color: var(--ink); padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--canvas); }
.filters input { flex: 1 1 260px; }
.count { margin: 18px 0 8px; font-size: .9rem; }
.rows { list-style: none; padding: 0; margin: 0; }
.rows li { max-width: none; }
.snip { display: block; color: var(--ink-2); font-size: .92rem; margin: 2px 0 3px; }
.rows a { display: grid; grid-template-columns: 14px 1fr auto; grid-template-areas: "dot t pill" "dot sub pill"; gap: 2px 14px; align-items: center;
  padding: 14px 16px; border-radius: 16px; text-decoration: none; color: var(--ink); }
.rows a:hover { background: var(--surface); box-shadow: var(--shadow); color: var(--ink); }
.rows .dot { grid-area: dot; } .rows .t { grid-area: t; font-weight: 550; } .rows .sub { grid-area: sub; font-size: .85rem; color: var(--muted); } .rows .pill { grid-area: pill; }
.rows code { background: none; padding: 0; }
.pager { display: flex; justify-content: space-between; padding: 20px 0 40px; }

/* Problem page */
.informal { padding: 22px 26px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); font-size: 1.04rem; }
.informal code { background: var(--canvas-2); padding: 1px 6px; border-radius: 6px; }
.informal p:first-child { margin-top: 0; } .informal p:last-child { margin-bottom: 0; }
pre.lean { margin: 0; padding: 20px 22px; border-radius: var(--radius); background: #2b2119; color: #f6eadb; overflow-x: auto; line-height: 1.55; font-size: .86rem; white-space: pre-wrap; }
.links { display: flex; gap: 18px; font-size: .92rem; }

/* Sponsors */
.logos { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 12px; }
.logo { padding: 14px 20px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.logo img { display: block; max-width: 100%; object-fit: contain; }
.t-logo img { height: 34px; } .t-top img { height: 72px; }
.t-top { flex-basis: 100%; text-align: center; } .t-top img { margin: 0 auto; }
.panel { max-width: 580px; padding: 28px; border-radius: 26px; background: var(--surface); box-shadow: var(--shadow); margin: 8px 0 48px; }
.panel label { display: block; margin: 0 0 16px; font-weight: 600; font-size: .93rem; }
.panel input:not([type=radio]) { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--canvas); color: var(--ink); font: 1rem var(--font); }
.panel label .muted { display: block; font-weight: 400; font-size: .85rem; margin-top: 5px; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-weight: 600; font-size: .93rem; margin-bottom: 8px; }
.tier { display: flex !important; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; margin: 0 0 8px !important; background: var(--canvas); font-weight: 400 !important; cursor: pointer; }
.tier input { accent-color: var(--accent); margin-top: 5px; }
.tier:has(input:checked) { background: #fff3e8; box-shadow: inset 0 0 0 2px var(--accent); }
.price { color: var(--accent); font-weight: 650; }
.err { color: #a8321a; min-height: 1.2em; margin: 10px 0 0; }

footer { width: min(1080px, calc(100% - 40px)); margin: 30px auto 0; padding: 34px 0 40px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
footer b { display: block; color: var(--ink); margin-bottom: 8px; }
footer a { display: block; color: var(--ink-2); text-decoration: none; padding: 2px 0; }
footer a:hover { color: var(--accent); }
footer p { margin: 0; }
footer .fine { margin-top: 26px; font-size: .8rem; }

@media (max-width: 860px) {
  .counters { grid-template-columns: 1fr 1fr; }
  .connect-box, .two, footer .cols { grid-template-columns: 1fr; }
  .connect-box { padding: 22px; }
}
@media (max-width: 600px) {
  html { font-size: 16px; }
  .bar { flex-wrap: wrap; border-radius: 24px; padding: 8px 10px; }
  .brand { padding: 4px 6px; }
  .bar nav { width: 100%; }
  .bar nav a { padding: 7px 11px; font-size: .86rem; }
  .copy { flex-direction: column; align-items: stretch; }
  .rows a { grid-template-columns: 14px 1fr; grid-template-areas: "dot t" "dot sub" ". pill"; }
  .rows .pill { justify-self: start; margin-top: 6px; }
  .card:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .bar { background: var(--surface); background-image: none; }
  body { background: var(--canvas); }
  .muted, .counter span { color: var(--ink-2); }
}
@media (forced-colors: active) { .card, .counter, .panel, .logo, .chip, .bar, .copy, .connect-box, .informal { border: 1px solid CanvasText; } .dot { forced-color-adjust: none; } }
.tier-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin: 8px 0 20px; }
.tier-card { display: flex; flex-direction: column; gap: 6px; padding: 24px; border-radius: 26px; background: var(--surface); box-shadow: var(--shadow); }
.tier-card h3 { margin: 0; }
.tier-card .price { font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.tier-card p { flex: 1; margin: 0 0 12px; }
.tier-card .btn { align-self: flex-start; }
.prize-box { display: flex; gap: 18px; align-items: flex-start; padding: 18px 22px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); margin: 0 0 18px; }
.prize-box .amount { font-size: 1.7rem; font-weight: 700; color: var(--accent); white-space: nowrap; }
.prize-box p { margin: 6px 0 0; }
.refs { padding-left: 1.3em; margin: 0; }
.refs li { margin: 0 0 8px; overflow-wrap: anywhere; }
.pill.ref-first { font-size: .72rem; padding: 2px 8px; vertical-align: 1px; }
