/* Cup and Handle: the Focus List theme.
   Two colour themes on one page. Dark: black page, the charts' own green, pink and yellow.
   Light: white page, black charts, bold blocks. The reader's choice is kept in the browser. */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
}

:root, :root[data-theme="dark"] {
    --bg: #000000; --fg: #ffffff; --mute: #b8b8b8; --line: #2a2a2a;
    --k1: #3dff3d; --k2: #ff85ff; --k3: #e6ff00; --num: #e6ff00;
    --kick-bg: transparent; --kick-fg-1: var(--k1); --kick-fg-2: var(--k2); --kick-fg-3: var(--k3); --kick-pad: 0;
    --btn-bg: #3dff3d; --btn-fg: #000000;
    --in-bg: #0f0f0f; --in-fg: #ffffff; --in-bd: #5a5a5a;
    --chip-bd: #4a4a4a; --card-bd: #2a2a2a; --gate-bd: #3dff3d; --rule: 1px;
    --mark-bg: transparent; --mark-fg: #3dff3d; --link-hover: #3dff3d;
    --dot: #d9a84e; --ok: #3dff3d; --err: #ff8f8f;
    color-scheme: dark;
}
:root[data-theme="light"] {
    --bg: #ffffff; --fg: #0b0b0b; --mute: #4a4a4a; --line: #0b0b0b;
    --num: #1a3fd6;
    --kick-bg: #3dff3d; --kick-fg-1: #0b0b0b; --kick-fg-2: #0b0b0b; --kick-fg-3: #0b0b0b; --kick-pad: 6px 10px;
    --btn-bg: #0b0b0b; --btn-fg: #3dff3d;
    --in-bg: #ffffff; --in-fg: #0b0b0b; --in-bd: #0b0b0b;
    --chip-bd: #0b0b0b; --card-bd: #0b0b0b; --gate-bd: #0b0b0b; --rule: 2px;
    --mark-bg: #3dff3d; --mark-fg: #0b0b0b; --link-hover: #1a3fd6;
    --dot: #b07a16; --ok: #0a6b0a; --err: #b00020;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--fg);
    font-family: var(--gh-font-body, "Inter", system-ui, -apple-system, "Segoe UI", sans-serif);
    font-size: 18px; line-height: 1.5;
}
h1, h2, h3 { font-family: var(--gh-font-heading, "Inter", system-ui, -apple-system, "Segoe UI", sans-serif); }
a { color: var(--fg); }
a:hover { color: var(--link-hover); }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--k1); outline-offset: 3px; }
:root[data-theme="light"] :focus-visible { outline-color: #1a3fd6; }

.site { max-width: 1180px; margin: 0 auto; padding: 0 32px 96px; display: flex; flex-direction: column; gap: 72px; }
.site-main { display: flex; flex-direction: column; gap: 72px; }
.muted { color: var(--mute); font-size: 15px; }
.fine { margin: 0; font-size: 14px; color: var(--mute); }

/* Header */
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 24px 0; border-bottom: var(--rule) solid var(--line); }
.site-name { display: inline-flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; text-decoration: none; }
.site-mark { width: 37px; height: 20px; flex: none; }
.site-mark-dot { fill: var(--dot); stroke: var(--bg); stroke-width: 3; }
.site-nav { display: flex; gap: 28px; flex-wrap: wrap; align-items: center; font-size: 15px; font-weight: 500; }
.site-nav ul { display: flex; gap: 28px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; }
.site-nav .nav-current a { text-decoration: underline; text-underline-offset: 6px; }
.theme-switch { display: inline-flex; border: 2px solid var(--fg); }
.theme-switch button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; cursor: pointer; background: transparent; color: var(--fg); }
.theme-switch button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

/* Kickers */
.kicker { align-self: flex-start; display: inline-block; font-size: 14px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; background: var(--kick-bg); padding: var(--kick-pad); }
.k1 { color: var(--kick-fg-1); } .k2 { color: var(--kick-fg-2); } .k3 { color: var(--kick-fg-3); }

/* Hero */
.hero { display: flex; flex-direction: column; gap: 24px; }
.hero-title { margin: 0; font-size: clamp(48px, 8vw, 104px); line-height: 0.95; font-weight: 800; letter-spacing: -0.04em; }
.hero-mark { background: var(--mark-bg); color: var(--mark-fg); padding: 0 0.12em; }
.hero-note { margin: 0; max-width: 720px; font-size: 22px; line-height: 1.45; color: var(--mute); }
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.button, .signup button { display: inline-flex; align-items: center; justify-content: center; gap: 0.3em; white-space: nowrap; height: 52px; padding: 0 28px; font: inherit; font-size: 17px; font-weight: 800; text-decoration: none; color: var(--btn-fg); background: var(--btn-bg); border: 0; border-radius: 0; cursor: pointer; }
.button:hover, .signup button:hover { color: var(--btn-fg); filter: brightness(1.12); }

/* Market */
.market { display: flex; flex-direction: column; gap: 24px; }
.market-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 24px; }
.market-fig { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.market-fig figcaption { font-size: 16px; font-weight: 700; }
.market-fig figcaption a { text-decoration: none; }
.market-fig figcaption .muted { font-weight: 400; font-size: 16px; }
.market-text { margin: 0; max-width: 820px; font-size: 19px; line-height: 1.5; }
.market-text > :first-child { margin-top: 0; } .market-text > :last-child { margin-bottom: 0; }

/* The list */
.list { display: flex; flex-direction: column; gap: 56px; }
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.charts { display: flex; flex-direction: column; gap: 56px; counter-reset: chart; }
.chart { display: flex; flex-direction: column; gap: 16px; counter-increment: chart; }
.chart-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.chart-num { font-size: 15px; font-weight: 700; color: var(--num); }
.chart-num::before { content: counter(chart, decimal-leading-zero); }
.chart-ticker { margin: 0; font-size: 44px; line-height: 1; font-weight: 800; letter-spacing: -0.02em; }
.chart-ticker a { text-decoration: none; }
.chart-name { font-size: 18px; color: var(--mute); }
.chart-date { margin-left: auto; font-size: 15px; color: var(--mute); }
.chart-img { display: block; width: 100%; height: auto; aspect-ratio: 2358 / 1568; object-fit: contain; background: #000; border: var(--rule) solid var(--card-bd); }

/* A chart opened to the full screen. The picture keeps its own shape: it is fitted, never stretched. */
img[data-zoom] { cursor: zoom-in; }
html.zoomed, html.zoomed body { overflow: hidden; }
html.zoomed body { position: fixed; left: 0; right: 0; width: 100%; }   /* iPhone: the only way to hold the page still underneath */
.zoom { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; height: 100dvh; z-index: 1000; overflow: hidden; background: #000; cursor: zoom-out; overscroll-behavior: contain; touch-action: none; }
.zoom img { position: absolute; top: 50%; left: 50%; max-width: none; max-height: none; width: 100vw; height: 100vh; height: 100dvh; object-fit: contain; transform: translate(-50%, -50%); }
@media (orientation: portrait) and (max-width: 760px) {
    .zoom img { width: 100vh; width: 100dvh; height: 100vw; transform: translate(-50%, -50%) rotate(90deg); }
}
.demo-note { margin: 0; font-size: 15px; color: var(--mute); border: 1px dashed var(--chip-bd); padding: 12px 16px; }

/* The gate */
.gate { display: flex; flex-direction: column; gap: 28px; border: 2px solid var(--gate-bd); padding: clamp(24px, 4vw, 48px); scroll-margin-top: 24px; }
.gate-text { display: flex; flex-direction: column; gap: 12px; }
.gate h2 { margin: 0; font-size: clamp(32px, 4.5vw, 52px); line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; }
.gate .muted { margin: 0; max-width: 680px; font-size: 19px; line-height: 1.5; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; font-weight: 700; color: var(--fg); border: 1px solid var(--chip-bd); padding: 10px 12px; text-decoration: none; }
.chip::after { content: ""; width: 14px; height: 14px; flex: none; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / contain no-repeat; }
.signup { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.signup-field { display: flex; flex-direction: column; gap: 8px; flex: 1 1 320px; max-width: 420px; }
.signup label { font-size: 14px; font-weight: 700; }
.signup input { height: 52px; padding: 0 16px; font: inherit; font-size: 17px; color: var(--in-fg); background: var(--in-bg); border: 2px solid var(--in-bd); border-radius: 0; }
.signup-ok, .signup-err { display: none; flex-basis: 100%; margin: 0; font-size: 16px; font-weight: 700; }
.signup-ok { color: var(--ok); } .signup-err { color: var(--err); }
.signup.success .signup-ok { display: block; }
.signup.error .signup-err { display: block; }
.signup.loading button { opacity: .6; pointer-events: none; }

/* One chart or one page on its own */
.single { display: flex; flex-direction: column; gap: 24px; }
.single-title, .page-title { margin: 0; font-size: clamp(40px, 6vw, 80px); line-height: 1; font-weight: 800; letter-spacing: -0.03em; }
.back { align-self: flex-start; font-size: 15px; font-weight: 700; text-decoration: none; }
.prose { max-width: 760px; font-size: 19px; line-height: 1.6; }
.prose h2 { font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; margin: 1.6em 0 0.5em; }
.prose h3 { font-size: 23px; margin: 1.4em 0 0.4em; }
.prose img, .prose figure { max-width: 100%; margin-left: 0; margin-right: 0; }
.prose blockquote { margin: 1.2em 0; padding-left: 20px; border-left: 4px solid var(--k1); color: var(--mute); }
.prose hr { border: 0; border-top: var(--rule) solid var(--line); margin: 2em 0; }
/* Ghost's editor lets a picture run wider than the text. */
.prose .kg-width-wide { width: min(1116px, 94vw); max-width: none; }
.prose .kg-width-full { width: min(1116px, 94vw); max-width: none; }
.prose .kg-width-wide img, .prose .kg-width-full img { width: 100%; }
.pagination { display: flex; gap: 24px; align-items: center; font-size: 15px; font-weight: 700; }
.pagination a { text-decoration: none; }

/* Footer */
.site-foot { border-top: var(--rule) solid var(--line); padding-top: 28px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.55; color: var(--mute); }
.site-foot p { margin: 0; max-width: 820px; }

/* Phones */
@media (max-width: 640px) {
    body { font-size: 17px; }
    .site { padding: 0 18px 64px; gap: 52px; }
    .site-main { gap: 52px; }
    .site-head { padding: 16px 0; gap: 14px; }
    .site-nav, .site-nav ul { gap: 18px; }
    .hero-note { font-size: 19px; }
    .charts, .list { gap: 40px; }
    .chart-ticker { font-size: 34px; }
    .chart-date { margin-left: 0; flex-basis: 100%; }
    .button, .signup button { width: 100%; }
    .signup-field { max-width: none; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.chart-note { margin: 6px 0 0; font-size: 13px; color: var(--mute); font-style: italic; }
.foot-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.foot-nav a { color: var(--mute); font-size: 14px; }
