/* plugin.phillm.dev: Declutter's homepage, in Declutter's own colours (src/content/system.css, the Reddit and X palettes) */

@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-normal.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/instrument-sans-normal.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

/* ---------- tokens: dark (soft charcoal) ---------- */
:root {
  --bg: #16181b; --bar: #0e1113; --band: #121518; --surface: #1d2024; --surface2: #24272b;
  --text: #d3d5d8; --muted: #878c92; --line: #2a2e32; --link: #93b2e6;
  --soft: color-mix(in srgb, var(--text) 2.5%, transparent);
  --soft-hover: color-mix(in srgb, var(--text) 6%, transparent);
  --chosen: color-mix(in srgb, var(--bar) 76%, color-mix(in srgb, var(--text) 80%, var(--link)));
  --chosen-text: color-mix(in srgb, var(--text) 82%, var(--muted));
  --cta: var(--chosen); --cta-text: var(--text);
  --mark: #3a3e43; --mark-lines: #d3d5d8;
  --shadow: 0 24px 64px rgba(0, 0, 0, .38), 0 2px 8px rgba(0, 0, 0, .2);
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-pill: 999px; --r-card: 16px; --r-small: 10px;
  --wrap: 1180px;
  color-scheme: dark;
}
/* light (warm paper) */
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --bg: #ebe9e4; --bar: #f3f1ed; --band: #e4e1db; --surface: #e2dfd8; --surface2: #dad6ce;
    --text: #2a2d31; --muted: #62676d; --line: #d9d6ce; --link: #2f58a3;
    --mark: #d6d2ca; --mark-lines: #3b3f44; --shadow: 0 24px 64px rgba(60, 50, 30, .16), 0 2px 8px rgba(60, 50, 30, .08);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #ebe9e4; --bar: #f3f1ed; --band: #e4e1db; --surface: #e2dfd8; --surface2: #dad6ce;
  --text: #2a2d31; --muted: #62676d; --line: #d9d6ce; --link: #2f58a3;
  --mark: #d6d2ca; --mark-lines: #3b3f44; --shadow: 0 24px 64px rgba(60, 50, 30, .16), 0 2px 8px rgba(60, 50, 30, .08);
  color-scheme: light;
}
/* medium (the muted middle tone) */
:root[data-theme="medium"] {
  --bg: #b8ad9a; --bar: #c2b8a6; --band: #b1a691; --surface: #ada28e; --surface2: #a39783;
  --text: #2f2c27; --muted: #4a443b; --line: #9d927e; --link: #2c4a80;
  --mark: #a39783; --mark-lines: #2f2c27; --shadow: 0 24px 64px rgba(50, 40, 20, .22), 0 2px 8px rgba(50, 40, 20, .1);
  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.6 var(--sans); font-kerning: normal;
  transition: background-color .3s ease, color .3s ease;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -.01em; }
h1, h2 { font-family: var(--serif); font-optical-sizing: auto; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--muted); }
p { margin: 0; }
kbd { display: inline-block; min-width: 1.7em; padding: .05em .45em; border-radius: 6px; background: var(--soft-hover); font: 500 .85em/1.5 var(--sans); text-align: center; }
.wrap { width: min(var(--wrap), calc(100% - 48px)); margin: 0 auto; }
.narrow { width: min(760px, calc(100% - 48px)); }
.skip { position: absolute; left: 16px; top: -60px; z-index: 10; padding: 10px 16px; border-radius: var(--r-pill); background: var(--chosen); color: var(--text); }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 6px; }
.eyebrow { margin-bottom: 14px; font: 600 12.5px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* the shared pill buttons */
.pill {
  display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 20px;
  border: 0; border-radius: var(--r-pill); font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s, transform .15s;
}
.pill:active { transform: scale(.98); }
.pill--cta { background: var(--cta); color: var(--cta-text); }
.pill--cta:hover { background: color-mix(in srgb, var(--cta) 85%, var(--text)); }
.pill--quiet { background: var(--soft-hover); color: var(--text); }
.pill--quiet:hover { background: color-mix(in srgb, var(--text) 10%, transparent); }
.pill--big { height: 48px; padding: 0 26px; font-size: 16px; }
.pill--small { height: 30px; padding: 0 14px; font-size: 13px; }

/* the segmented switch */
.seg { display: inline-flex; padding: 4px; border-radius: var(--r-pill); background: var(--soft); }
.seg > * { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--muted); font: 500 14px/1 var(--sans); }
.seg > b, .seg > [aria-checked="true"] { background: var(--chosen); color: var(--chosen-text); font-weight: 650; }
.seg--real > button { cursor: pointer; transition: background-color .15s, color .15s; }
.seg--real > button:not([aria-checked="true"]):hover { background: var(--soft-hover); color: var(--text); }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bar) 88%, transparent); backdrop-filter: blur(14px) saturate(1.2); transition: background-color .3s; }
.top__row { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 600 18px/1 var(--sans); letter-spacing: -.01em; }
.brand__mark { width: 30px; height: 30px; }
.brand__mark rect:first-child { fill: var(--mark); transition: fill .3s; }
.brand__mark .l1, .brand__mark .l2, .brand__mark .l3 { fill: var(--mark-lines); }
.brand__mark .l2 { opacity: .8; } .brand__mark .l3 { opacity: .6; }
.top__nav { display: flex; align-items: center; gap: 6px; }
.top__nav a:not(.pill) { padding: 8px 12px; border-radius: var(--r-pill); color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; transition: color .15s, background-color .15s; }
.top__nav a:not(.pill):hover { color: var(--text); background: var(--soft-hover); }
.top__nav .pill { margin-left: 8px; height: 36px; padding: 0 18px; font-size: 14px; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 96px; overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; align-items: center; }
.hero h1 { font-size: clamp(44px, 6vw, 78px); line-height: 1.02; letter-spacing: -.025em; }
.hero h1 em { display: block; }
.lede { margin-top: 26px; max-width: 34em; font-size: 19px; line-height: 1.6; color: color-mix(in srgb, var(--text) 82%, var(--muted)); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.fine { margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.hero__copy > * { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.hero__copy > :nth-child(2) { animation-delay: .06s; } .hero__copy > :nth-child(3) { animation-delay: .12s; }
.hero__copy > :nth-child(4) { animation-delay: .18s; } .hero__copy > :nth-child(5) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* the demo window */
.demo { margin: 0; }
.win { border-radius: 18px; background: var(--bg); box-shadow: var(--shadow); overflow: hidden; outline: 1px solid color-mix(in srgb, var(--text) 7%, transparent); }
.win__bar { display: flex; align-items: center; justify-content: center; height: 40px; background: color-mix(in srgb, var(--bar) 60%, var(--bg)); }
.win__addr { min-width: 46%; padding: 5px 14px; border-radius: var(--r-pill); background: var(--soft-hover); color: var(--muted); font-size: 12.5px; text-align: center; transition: opacity .25s; }
.page { position: relative; height: 440px; overflow: hidden; font-size: 12px; }
.p-head { display: flex; align-items: center; gap: 14px; height: 50px; padding: 0 22px; background: var(--bar); }
.burger { display: inline-grid; gap: 3.5px; width: 16px; } .burger i { height: 1.5px; border-radius: 1px; background: var(--muted); }
.p-logo { font: 700 16px/1 var(--sans); letter-spacing: -.02em; min-width: 64px; transition: opacity .25s; }
.p-search { flex: 1; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--bar) 97.5%, var(--text)); color: var(--muted); }
.p-search svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.p-band { display: flex; align-items: center; height: 46px; padding: 0 22px; background: var(--band); }
.p-band .seg > * { height: 26px; padding: 0 12px; font-size: 12px; }
.p-band .seg { padding: 3px; }
.p-body { display: flex; gap: 18px; padding: 18px 22px; }
.p-feed { flex: 1; min-width: 0; display: grid; gap: 22px; align-content: start; }
.post { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; }
.who { display: flex; gap: 8px; align-items: flex-start; }
.av { flex: none; width: 26px; height: 26px; border-radius: 50%; background: hsl(var(--h, 210) 22% 52%); }
.lines { display: grid; gap: 5px; padding-top: 3px; } .lines b { width: 58px; height: 7px; border-radius: 4px; background: color-mix(in srgb, var(--text) 55%, transparent); } .lines s { width: 34px; height: 6px; border-radius: 4px; background: color-mix(in srgb, var(--text) 22%, transparent); }
.what { display: grid; gap: 7px; }
.what .h { height: 10px; width: 82%; border-radius: 5px; background: color-mix(in srgb, var(--text) 62%, transparent); } .what .h--short { width: 58%; }
.what .t { height: 7px; width: 96%; border-radius: 4px; background: color-mix(in srgb, var(--text) 22%, transparent); } .what .t--short { width: 70%; }
.what .img { height: 112px; margin-top: 6px; border-radius: 12px; background: linear-gradient(160deg, hsl(var(--h) 38% 62%), hsl(calc(var(--h) + 190) 22% 34%)); opacity: .85; }

/* the noise: loud on purpose */
.noise { transition: opacity .45s ease, transform .55s cubic-bezier(.5, 0, .2, 1), max-height .6s cubic-bezier(.5, 0, .2, 1), margin .6s, padding .6s, filter .45s; }
.n-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-height: 40px; padding: 10px 22px; background: #ffd43b; color: #2b2100; font-weight: 600; overflow: hidden; }
.n-banner b, .n-cookie b { padding: 5px 12px; border-radius: 6px; background: #1a1a1a; color: #fff; font-weight: 700; }
.n-cookie { position: absolute; left: 50%; bottom: 18px; z-index: 3; display: grid; gap: 6px; width: 300px; padding: 16px 18px; border-radius: 10px; background: #fff; color: #222; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); transform: translateX(-50%); }
.n-cookie strong { font-size: 13px; } .n-cookie b { justify-self: start; margin-top: 4px; background: #0a66ff; }
.n-badge { position: absolute; left: 30px; top: 46px; z-index: 2; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #ff3b30; color: #fff; font: 700 10px/1 var(--sans); }
.n-toast { position: absolute; right: 18px; top: 104px; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; background: #2d6bff; color: #fff; font-weight: 600; box-shadow: 0 10px 28px rgba(0, 0, 0, .35); }
.n-toast .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.n-premium { flex: none; padding: 7px 12px; border-radius: 8px; background: linear-gradient(90deg, #ff6a00, #ee0979); color: #fff; font-weight: 700; max-width: 100px; overflow: hidden; white-space: nowrap; }
.n-sponsored { max-height: 200px; overflow: hidden; }
.n-sponsored .tag { justify-self: start; padding: 2px 8px; border-radius: 4px; background: #ffd43b; color: #2b2100; font-weight: 700; font-size: 10.5px; }
.n-sponsored .ad-img { height: 74px; border-radius: 8px; background: repeating-linear-gradient(45deg, #ff2d55 0 14px, #ffcc00 14px 28px); opacity: .9; }
.av--ad { background: #ff9500; }
.n-side { flex: none; display: grid; gap: 10px; align-content: start; width: 150px; max-width: 150px; overflow: hidden; }
.n-side .ad-box { display: grid; place-items: center; height: 120px; border-radius: 8px; background: repeating-linear-gradient(-45deg, #3a86ff 0 12px, #8338ec 12px 24px); color: #fff; font-weight: 700; font-size: 11px; }
.n-side .trend { height: 26px; border-radius: 6px; background: color-mix(in srgb, #ff006e 30%, var(--surface)); }
.n-side .follow { padding: 8px 10px; border-radius: 6px; background: #ff006e; color: #fff; font-weight: 700; text-align: center; }

/* clearing: each bit of noise goes in turn (--i), then the calm layout settles */
.demo[data-state="calm"] .noise { opacity: 0; filter: blur(3px); pointer-events: none; transition-delay: calc(var(--i) * 130ms); }
.demo[data-state="calm"] .n-banner { max-height: 0; padding-top: 0; padding-bottom: 0; }
.demo[data-state="calm"] .n-cookie { transform: translate(-50%, 24px); }
.demo[data-state="calm"] .n-toast { transform: translateX(30px); }
.demo[data-state="calm"] .n-badge { transform: scale(.4); }
.demo[data-state="calm"] .n-premium { max-width: 0; padding-left: 0; padding-right: 0; margin-left: -14px; }
.demo[data-state="calm"] .n-sponsored { max-height: 0; margin-bottom: -22px; }
.demo[data-state="calm"] .n-side { max-width: 0; width: 0; margin-left: -18px; }
.demo__cap { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding: 0 6px; }
.demo__label { font: 600 12.5px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); transition: opacity .25s; }
@media (prefers-reduced-motion: reduce) { .noise, .win__addr, .p-logo { transition: none !important; } }

/* ---------- sections ---------- */
.section { padding: 112px 0; }
.section--band { background: var(--band); transition: background-color .3s; }
.section__head { max-width: 780px; margin-bottom: 56px; }
.section__head h2 { font-size: clamp(34px, 4.2vw, 54px); line-height: 1.08; letter-spacing: -.02em; }
.section__head h2 em { display: block; }
.section__lede { margin-top: 20px; max-width: 40em; font-size: 18px; color: color-mix(in srgb, var(--text) 82%, var(--muted)); }

/* sites: a quiet index, like a newspaper's contents */
.sites { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: site; }
.sites li { position: relative; padding: 24px 26px 26px; border-radius: var(--r-card); background: var(--soft); transition: background-color .2s; counter-increment: site; }
.sites li:hover { background: var(--soft-hover); }
.sites li::before { content: counter(site, decimal-leading-zero); position: absolute; right: 24px; top: 26px; font: 400 13px/1 var(--serif); font-style: italic; color: var(--muted); }
.sites h3 { font: 600 18px/1.2 var(--sans); }
.sites p { margin-top: 8px; font-size: 15px; line-height: 1.55; color: var(--muted); }

/* features */
.feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feat { padding: 30px; border-radius: var(--r-card); background: var(--surface); transition: background-color .3s; }
.feat h3 { font: 600 19px/1.25 var(--sans); }
.feat p { margin-top: 10px; font-size: 15.5px; color: var(--muted); }
.feat p b { color: var(--text); font-weight: 600; }
.feat--wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 40px; }
.feat--wide h3 { font: 500 30px/1.15 var(--serif); letter-spacing: -.015em; }
.feat--wide p { font-size: 17px; max-width: 30em; }
.feat--wide .seg { margin-top: 26px; }
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.sw { display: grid; gap: 8px; align-content: start; height: 170px; padding: 16px; border-radius: 14px; outline: 1px solid color-mix(in srgb, var(--text) 8%, transparent); }
.sw i { height: 9px; border-radius: 5px; } .sw i:nth-child(1) { width: 70%; height: 12px; } .sw i:nth-child(3) { width: 55%; }
.sw--light { background: #ebe9e4; } .sw--light i { background: #2a2d31; opacity: .7; } .sw--light i + i { opacity: .25; }
.sw--medium { background: #b8ad9a; } .sw--medium i { background: #2f2c27; opacity: .7; } .sw--medium i + i { opacity: .3; }
.sw--dark { background: #16181b; } .sw--dark i { background: #d3d5d8; opacity: .7; } .sw--dark i + i { opacity: .22; }

.toggles { display: grid; gap: 6px; margin: 22px 0 0; padding: 0; list-style: none; }
.toggles li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 0 6px 0 14px; border-radius: var(--r-small); background: var(--soft); font-size: 14.5px; }
[role="switch"] { position: relative; flex: none; width: 38px; height: 22px; border: 0; border-radius: var(--r-pill); background: var(--soft-hover); cursor: pointer; transition: background-color .2s; }
[role="switch"]::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .2s cubic-bezier(.3, .7, .2, 1), background-color .2s; }
[role="switch"][aria-checked="true"] { background: var(--chosen); }
[role="switch"][aria-checked="true"]::after { transform: translateX(16px); background: var(--text); }

.picker { position: relative; margin-top: 24px; height: 74px; }
.picker__box { position: absolute; inset: 10px 30px 10px 0; display: grid; place-items: center; border-radius: var(--r-small); background: var(--soft-hover); color: var(--muted); font-size: 13.5px; outline: 2px dashed color-mix(in srgb, var(--link) 70%, transparent); outline-offset: 3px; }
.picker__tip { position: absolute; right: 0; top: -6px; padding: 5px 10px; border-radius: var(--r-pill); background: var(--chosen); color: var(--chosen-text); font: 600 12px/1 var(--sans); }

.chart { display: block; width: 100%; height: auto; margin-top: 22px; }
.chart__fill { fill: color-mix(in srgb, var(--link) 14%, transparent); }
.chart__line { fill: none; stroke: var(--link); stroke-width: 2; stroke-linejoin: round; }
.chart__low { fill: var(--bg); stroke: var(--link); stroke-width: 2; }

/* privacy */
.prose { font-size: 18px; color: color-mix(in srgb, var(--text) 85%, var(--muted)); }
.prose p + p, .prose ul + p, .prose p + ul { margin-top: 18px; }
.prose ul { display: grid; gap: 12px; margin: 18px 0 0; padding: 0; list-style: none; }
.prose li { padding: 16px 20px; border-radius: var(--r-small); background: var(--soft); font-size: 16.5px; }
.prose b { color: var(--text); font-weight: 600; }

/* install */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.step { display: flex; flex-direction: column; padding: 30px; border-radius: var(--r-card); background: var(--surface); }
.step h3 { font: 500 28px/1.1 var(--serif); }
.step__sub { margin-top: 6px; font-size: 14px; color: var(--muted); }
.step ol { flex: 1; display: grid; gap: 12px; align-content: start; margin: 22px 0 26px; padding: 0; list-style: none; counter-reset: st; font-size: 15.5px; }
.step li { position: relative; padding-left: 34px; counter-increment: st; }
.step li::before { content: counter(st); position: absolute; left: 0; top: 1px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--soft-hover); font: 600 12px/1 var(--sans); color: var(--muted); }
.step .pill { align-self: flex-start; }
.step b { font-weight: 600; }

/* footer */
.foot { padding: 40px 0 56px; color: var(--muted); font-size: 14px; }
.foot__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
.foot a { color: var(--muted); }

/* ---------- smaller screens ---------- */
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; gap: 48px; }
  .sites, .feats, .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feat--wide { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap, .narrow { width: calc(100% - 32px); }
  .top__nav a:not(.pill) { display: none; }
  .hero { padding: 40px 0 72px; }
  .section { padding: 80px 0; }
  .sites, .feats, .steps { grid-template-columns: 1fr; }
  .feat--wide { padding: 28px; }
  .swatches .sw { height: 120px; }
  .page { height: 380px; }
  .post { grid-template-columns: 76px minmax(0, 1fr); gap: 10px; }
  .lines b { width: 40px; }
  .n-cookie { width: calc(100% - 36px); }
  .n-side { display: none; }
  .p-head { padding: 0 14px; gap: 10px; } .p-band, .p-body { padding-left: 14px; padding-right: 14px; }
  .seg--real > button { padding: 0 11px; }
}
/* (thirteen sites: a lone last one spans the row) */
@media (min-width: 981px) { .sites li:last-child:nth-child(3n + 1) { grid-column: 1 / -1; } }
@media (min-width: 641px) and (max-width: 980px) { .sites li:last-child:nth-child(2n + 1) { grid-column: 1 / -1; } }
