/* Linkify toolkit - site identity.
   Concept: a darkroom contact sheet. Paper and ink, one single purple accent (the original brand colours), hard rules instead of
   shadows and glows, square corners, serif headlines with mono "spec" labels, crop marks on the drop zone.
   base.css stays shared with the other sites; everything here overrides it for this site only. */

@property --mark { syntax: "<length>"; inherits: true; initial-value: 26px; }

:root {
  --ink: light-dark(#09090b, #fafafa);
  --bg: light-dark(#fafafa, #09090b);
  --surface: light-dark(#ffffff, #18181b);
  --surface-2: light-dark(#f4f4f5, #27272a);
  --text: var(--ink);
  --muted: light-dark(#52525b, #a1a1aa);
  --line: light-dark(#e4e4e7, #3f3f46);
  --brand: #c266ff;
  --brand-deep: #5a248f;
  --accent-mix: 42%;
  --accent: light-dark(color-mix(in oklab, var(--brand) var(--accent-mix), var(--brand-deep)), var(--brand));
  --accent-2: light-dark(var(--brand-deep), color-mix(in oklab, var(--brand) 55%, #fff));
  --accent-ink: #09090b;
  --accent-soft: color-mix(in oklab, var(--brand) 16%, transparent);
  --on-ink: light-dark(var(--brand), var(--brand-deep));
  --ok: light-dark(oklch(52% .15 155), oklch(78% .16 155));
  --radius: 0;
  --radius-sm: 0;
  --shadow: none;
  --rule: 1.5px solid var(--ink);
  --serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, "Noto Serif", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --wrap: 1120px;
}

/* ---------- foundation ---------- */
body { background: var(--bg); }
h1, h2, h3 { font-family: var(--serif); letter-spacing: -.025em; }
h1 { font-weight: 700; font-size: clamp(2.7rem, 1.3rem + 6vw, 5.6rem); line-height: .96; letter-spacing: -.04em; }
h2 { font-weight: 700; font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.4rem); }
h3 { font-weight: 700; font-size: 1.3rem; }
.grad { background: none; color: var(--accent); font-style: italic; font-weight: 600; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 0; }
a { text-decoration-thickness: .1em; }
kbd { padding: .05rem .4rem; border: 1px solid var(--ink); border-bottom-width: 3px; border-radius: 0; background: var(--surface); font-size: .8em; }

/* mono "spec" labels */
label, .label, th, .stat, .tag, .eyebrow, .crumbs, .brand small, .chip, .nav a, .go {
  font-family: var(--mono);
}
label, .label { font-size: .7rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }

/* ---------- header ---------- */
.site-header { backdrop-filter: none; background: var(--bg); border-bottom: var(--rule); }
.site-header::after { /* ruler ticks */
  content: ""; position: absolute; inset: auto 0 -9px 0; height: 8px; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 40px) bottom / 100% 8px no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 8px) bottom / 100% 4px no-repeat;
  opacity: .55;
}
.brand { font-family: var(--serif); font-size: 1.25rem; letter-spacing: -.02em; gap: .65rem; }
.brand .mark { width: 38px; height: 38px; }
.brand small { border: 1px solid var(--ink); border-radius: 0; padding: .1rem .4rem; text-transform: uppercase; letter-spacing: .1em; font-size: .6rem; color: var(--ink); }
.nav a { border-radius: 0; font-size: .74rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: .5rem .7rem; border-bottom: 2px solid transparent; }
.nav a:hover { background: none; color: var(--accent); }
.nav a[aria-current="page"] { background: none; box-shadow: none; color: var(--ink); border-bottom-color: var(--accent); }
.icon-btn { border-radius: 0; border: var(--rule); background: transparent; }
.icon-btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.nav-ext { display: inline-flex; align-items: center; gap: .4rem; margin-left: .5rem; height: 38px; padding: 0 .8rem; box-sizing: border-box; border-radius: 0; border: var(--rule); background: var(--brand); color: var(--accent-ink); font-family: var(--mono); font-weight: 700; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.nav-ext:hover { background: var(--ink); color: var(--bg); }
.nav-ext svg { width: 15px; height: 15px; }

/* ---------- hero ---------- */
.hero { text-align: left; padding-block: clamp(3rem, 7vw, 6rem) 2rem; }
.hero p.lede { margin: 0 0 1.4rem; max-width: 36rem; font-size: clamp(1.05rem, .95rem + .5vw, 1.3rem); color: var(--muted); }
.hero.compact h1 { font-size: clamp(2.2rem, 1.2rem + 3.8vw, 3.8rem); }
.eyebrow { padding: 0; border-radius: 0; background: none; color: var(--ink); font-size: .72rem; letter-spacing: .12em; margin-bottom: 1.3rem; }
.eyebrow::before { width: .6rem; height: .6rem; border-radius: 0; background: var(--accent); box-shadow: none; }
.crumbs { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- cards & controls ---------- */
:root .card { background: var(--surface); backdrop-filter: none; border: var(--rule); border-radius: 0; box-shadow: none; }

input[type="text"], input[type="url"], input[type="number"], input[type="search"], select, textarea {
  background: var(--bg); border: 1px solid var(--ink); border-radius: 0; padding: .7rem .8rem;
}
input:hover, select:hover, textarea:hover { border-color: var(--accent); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: none; outline: 2px solid var(--accent); outline-offset: 1px; }
input[type="color"] { border-radius: 0; border: 1px solid var(--ink); background: var(--bg); }
input[type="range"] { accent-color: var(--accent); }

:root .btn { background: var(--brand); color: var(--accent-ink); border: var(--rule); border-radius: 0; box-shadow: none; padding: .8rem 1.2rem; font-family: var(--mono); font-weight: 700; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; filter: none; transition: background .12s, color .12s, transform .12s; }
:root .btn:hover { background: var(--ink); color: var(--bg); transform: translate(-2px, -2px); filter: none; }
:root .btn:active { transform: none; }
:root .btn.ghost { background: transparent; color: var(--ink); box-shadow: none; border: var(--rule); }
:root .btn.ghost:hover { background: var(--ink); color: var(--bg); box-shadow: none; }
:root .btn.sm { padding: .55rem .8rem; font-size: .7rem; }

.seg { padding: 0; background: none; border: var(--rule); border-radius: 0; gap: 0; }
.seg label { border-radius: 0; padding: .55rem .9rem; font-size: .72rem; border-right: 1px solid var(--ink); color: var(--ink); }
.seg label:last-of-type { border-right: 0; }
.seg label:hover { background: var(--accent-soft); color: var(--ink); }
.seg input:checked + label { background: var(--ink); color: var(--bg); box-shadow: none; }

.switch { font-family: var(--font); font-size: .92rem; font-weight: 550; letter-spacing: 0; text-transform: none; color: var(--text); }
.switch input { width: 2.4rem; height: 1.3rem; border-radius: 0; background: var(--bg); border: 1.5px solid var(--ink); }
.switch input::after { inset: .12rem auto .12rem .12rem; width: .8rem; border-radius: 0; background: var(--ink); box-shadow: none; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(1.08rem); background: var(--accent-ink); }

.chip, .tag { border-radius: 0; border: 1px solid var(--ink); background: transparent; color: var(--ink); }
.tag { font-size: .68rem; letter-spacing: .04em; }
.chip:hover { background: var(--accent-soft); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.tabs { border-bottom: var(--rule); }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-width: 3px; }

.out pre, .out .preview { background: var(--bg); border: 1px solid var(--ink); border-radius: 0; }

.stat { font-size: .74rem; letter-spacing: .04em; }

/* ---------- table ---------- */
.table-wrap { border: var(--rule); border-radius: 0; background: var(--surface); }
th { background: var(--bg); font-size: .68rem; letter-spacing: .1em; border-bottom: var(--rule); color: var(--ink); }
td { border-bottom-color: var(--line); }
tbody tr:hover td { background: var(--accent-soft); }

/* ---------- tool index: numbered contact-sheet cells ---------- */
.bento { gap: 0; padding: 0 1.5px 1.5px 0; counter-reset: cell; }
.tile { counter-increment: cell; margin: 0 -1.5px -1.5px 0; gap: .5rem; padding: 1.4rem 1.4rem 1.2rem; transition: background .15s, color .15s; }
:root .tile { background: transparent; }
.tile::before { content: counter(cell, decimal-leading-zero); font-family: var(--mono); font-size: .72rem; font-weight: 700; letter-spacing: .1em; color: var(--accent); }
.tile::after { display: none; }
.tile .ico { position: absolute; top: 1.2rem; right: 1.2rem; margin: 0; width: auto; height: auto; background: none; border-radius: 0; color: var(--ink); }
.tile .ico svg { width: 1.5rem; height: 1.5rem; }
.tile h3 { margin: .4rem 0 0; }
.tile:hover { transform: none; background: var(--ink); color: var(--bg); }
.tile:hover p, .tile:hover .ico { color: color-mix(in oklab, var(--bg) 78%, transparent); }
.tile:hover .go, .tile:hover::before { color: var(--on-ink); }
.tile .go { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }

/* ---------- prose / seo copy ---------- */
.prose h2 { padding-top: 1.2rem; border-top: var(--rule); margin-top: 2.6rem; }
.prose .answer + h2 { margin-top: 2rem; }
.answer { border: 0; border-top: var(--rule); border-bottom: 1px solid var(--line); border-radius: 0; background: none; padding: 1.1rem 0; font-family: var(--serif); font-size: 1.2rem; line-height: 1.5; }
.answer strong:first-child { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: .4rem; }
.faq details { border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; background: none; padding: 1rem 0; margin: 0; }
.faq details:first-child { border-top: 1px solid var(--ink); }
.faq summary { list-style: none; display: flex; justify-content: space-between; gap: 1rem; font-family: var(--serif); font-size: 1.1rem; font-weight: 650; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); font-weight: 400; color: var(--accent); }
.faq details[open] summary::after { content: "−"; }
.faq details[open] summary { color: var(--ink); }

.pill-row { justify-content: flex-start; font-family: var(--mono); font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; margin-top: 1.2rem; }
.pill-row svg { color: var(--accent); }

/* ---------- footer & toast ---------- */
.site-footer { border-top: var(--rule); margin-top: 5rem; font-size: .88rem; }
.site-footer nav a { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.toast { border-radius: 0; background: var(--ink); color: var(--bg); box-shadow: none; font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; border: 1.5px solid var(--accent); }
.skip { border-radius: 0; background: var(--brand); color: var(--accent-ink); }

/* ---------- linkifier ---------- */
.io-grid { display: grid; gap: 1.4rem; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 860px) { .io-grid { grid-template-columns: 1fr; } }
.io-grid textarea { min-height: 18rem; }
.opts { display: grid; gap: .75rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--ink); }
.opts .group-title { grid-column: 1 / -1; font-family: var(--mono); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0; }
.preview a { color: var(--accent); }
.mark-link { background: var(--accent-soft); border-radius: 0; padding: 0 .15rem; border-bottom: 2px solid var(--accent); }

/* ---------- utm ---------- */
.final { font-family: var(--mono); font-size: .9rem; overflow-wrap: anywhere; padding: 1rem; border-radius: 0; background: var(--bg); border: var(--rule); min-height: 4rem; }
.final .k { color: var(--accent); font-weight: 700; }
.final.empty { color: var(--muted); font-family: var(--font); }
.field-msg { font-size: .8rem; margin: .3rem 0 0; color: var(--bad); }
.hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.hist li { display: flex; gap: .5rem; align-items: center; justify-content: space-between; padding: .5rem .7rem; border: 1px solid var(--ink); margin-bottom: -1px; border-radius: 0; background: var(--surface); font-family: var(--mono); font-size: .78rem; }
.hist li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- extractor ---------- */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 0; padding: 0 1.5px 1.5px 0; }
.summary div { padding: .8rem 1rem; border: var(--rule); margin: 0 -1.5px -1.5px 0; background: var(--surface); }
.summary b { display: block; font-family: var(--serif); font-size: 1.9rem; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.summary span { font-family: var(--mono); font-size: .66rem; color: var(--muted); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.tags { display: flex; flex-wrap: wrap; gap: .25rem; }
td .cell-text { max-width: 16rem; overflow-wrap: anywhere; }

/* ---------- browser extension page ---------- */
.store-btns { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: center; margin: 1.2rem 0 0; }
.store-btns .muted { font-family: var(--mono); font-size: .74rem; letter-spacing: .03em; }
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin: 2rem 0; }
.shots img { width: 100%; height: auto; border-radius: 0; border: var(--rule); box-shadow: none; }
.ext-cta { margin-top: 3rem; }
:root .ext-cta .card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; background: var(--ink); color: var(--bg); border-color: var(--ink); padding: clamp(1.4rem, 3vw, 2.2rem); }
.ext-cta h2 { margin: 0 0 .3rem; font-size: clamp(1.4rem, 1rem + 1.4vw, 2rem); }
.ext-cta p { margin: 0; color: color-mix(in oklab, var(--bg) 75%, transparent); }
:root .ext-cta .btn { border-color: var(--brand); }
:root .ext-cta .btn:hover { background: var(--bg); color: var(--ink); border-color: var(--bg); }

/* ---------- editorial alignment + install pill ---------- */
.wrap.prose { margin-inline: calc((100% - min(100% - 2rem, var(--wrap))) / 2) auto; }
:root .install-fab { border-radius: 0; border: var(--rule); box-shadow: none; background: var(--brand); }
:root .install-fab button { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
:root .install-tip { border-radius: 0; border: 1.5px solid var(--accent); font-family: var(--mono); font-size: .76rem; font-weight: 600; box-shadow: none; }
.table-wrap + .stat, .table-wrap + p { margin-top: 1rem; }

/* ---------- zen mode: only the tool stays ---------- */
.icon-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
:root[data-zen] main > section:not([aria-label]), :root[data-zen] .ext-cta,
:root[data-zen] .crumbs, :root[data-zen] .site-footer, :root[data-zen] .nav-ext, :root[data-zen] .skip { display: none; }
:root[data-zen] main { padding-block: clamp(1.2rem, 3vw, 2.4rem) 0; }
:root[data-zen] .site-header::after { display: none; }
:root[data-zen] .pill-row, :root[data-zen] .install-fab { display: none; }
:root[data-zen] .nav a[href="/plugin/"] { display: none; }

/* ---------- embed mode (?embed=1) and the /embed/ page ---------- */
:root[data-embed] .site-header, :root[data-embed] .install-fab, :root[data-embed] .toast:empty { display: none; }
:root[data-embed] body { background: var(--bg); }
:root[data-embed] main { padding-block: .9rem 0; }
.embed-credit { display: block; width: fit-content; margin: 1rem auto 1.2rem; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, var(--ink)); opacity: .75; text-decoration: none; border-bottom: 1px solid currentColor; }
.embed-credit:hover { opacity: 1; }
.embed-list { display: grid; gap: 1.6rem; margin-top: 1.6rem; }
.embed-item { border: var(--rule); padding: clamp(1rem, 2.4vw, 1.6rem); background: var(--surface); scroll-margin-top: 5rem; }
.embed-item:target { outline: 3px solid var(--brand); outline-offset: 3px; }
.embed-item h2 { margin: 0 0 .3rem; padding: 0; border: 0; font-size: 1.25rem; }
.embed-item > p { margin: 0 0 1rem; }
.embed-code { display: block; width: 100%; box-sizing: border-box; font-family: var(--mono); font-size: .8rem; line-height: 1.5; padding: .8rem; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: 0; resize: vertical; min-height: 6.2rem; }
.embed-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .7rem; }
.embed-preview { margin-top: 1rem; }
.embed-preview iframe { width: 100%; border: 1px solid var(--line); background: var(--bg); display: block; }
:root[data-zen][data-zen][data-zen] main > section.embed-wrap { display: block; }
