/*
 * Crop Wall: components
 * Needs tokens.css first. Every class starts with "cw-" so it can sit next to any other CSS.
 */

/* Base: the gray wall, tiny mono text */
.cw { margin: 0; background: var(--cw-ground); color: var(--cw-ink); font-family: var(--cw-mono); font-size: var(--cw-text-body); line-height: var(--cw-leading); -webkit-font-smoothing: antialiased; }
.cw *, .cw *::before, .cw *::after { box-sizing: border-box; }
.cw svg { display: block; }
.cw-wrap { width: min(100% - 2 * var(--cw-gutter), var(--cw-wrap)); margin-inline: auto; }
.cw-section { padding-block: var(--cw-section); }
.cw-section--tight { padding-block: 32px; }
.cw-soft { color: var(--cw-soft); }

/* Links: blue and underlined, always. They are the primary call to action */
.cw a { color: var(--cw-link); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.cw a:hover { background: var(--cw-link); color: var(--cw-paper); text-decoration: none; }
.cw a.cw-plain { color: inherit; text-decoration: none; }
.cw a.cw-plain:hover { background: none; color: inherit; text-decoration: underline; }

/* The dash rule: a short hyphen line between lines of text */
.cw-rule { display: block; width: 1ch; height: 1px; margin: 6px 0; background: var(--cw-ink); }
.cw-hr { height: 1px; margin: 0; border: 0; background: var(--cw-line); }

/* Type: mono everywhere outside tiles, small and plain */
.cw-h1, .cw-h2, .cw-h3 { margin: 0; font-family: var(--cw-mono); font-weight: 600; letter-spacing: -.01em; }
.cw-h1 { font-size: var(--cw-text-h1); line-height: 1.1; letter-spacing: -.03em; }
.cw-h2 { font-size: var(--cw-text-h2); line-height: 1.2; }
.cw-h3 { font-size: var(--cw-text-h3); line-height: 1.3; }
.cw-lead { max-width: var(--cw-measure); margin: 12px 0 0; font-size: var(--cw-text-lead); }
.cw-label { display: block; margin-bottom: 6px; color: var(--cw-soft); font-size: var(--cw-text-micro); text-transform: uppercase; letter-spacing: .08em; }
.cw-tag { display: inline-block; padding: 1px 6px; border: var(--cw-border); font-size: var(--cw-text-micro); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.cw-tag--ink { background: var(--cw-ink); color: var(--cw-ground); }
.cw-tag--acid { border-color: var(--cw-ink); background: var(--cw-acid); }

/* Nav: one line of plain text links, no bar, no logo art */
.cw-nav { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding-block: 20px; font-size: var(--cw-text-small); }
.cw .cw-nav__name { font-weight: 600; text-decoration: none; color: var(--cw-ink); }
.cw .cw-nav__name:hover { background: var(--cw-ink); color: var(--cw-ground); }
.cw-nav__links { display: flex; flex-wrap: wrap; gap: 4px 18px; }

/* Intro block: the top-left text that opens a page */
.cw-intro { max-width: 46ch; font-size: var(--cw-text-body); }
.cw-intro p { margin: 0; }

/* Buttons: flat ink rectangles, mono uppercase. Links do most of the work; use one button per view */
.cw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border: var(--cw-border); border-radius: var(--cw-radius); background: var(--cw-ink); color: var(--cw-ground); font: 600 var(--cw-text-small) var(--cw-mono); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; white-space: nowrap; cursor: pointer; }
.cw .cw-btn { color: var(--cw-ground); text-decoration: none; }
.cw .cw-btn:hover { background: var(--cw-blue); border-color: var(--cw-blue); color: var(--cw-paper); }
.cw .cw-btn--line { background: transparent; color: var(--cw-ink); }
.cw .cw-btn--line:hover { background: var(--cw-ink); border-color: var(--cw-ink); color: var(--cw-ground); }
.cw-btn--block { width: 100%; }
.cw-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 20px; }

/* Wall grid: three columns of tiles, captions under each. Leave holes on purpose */
.cw-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px var(--cw-gap); }
.cw-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cw-grid__hole { min-height: 1px; }
.cw-span-2 { grid-column: span 2; }
@media (max-width: 860px) {
  .cw-grid, .cw-grid--2 { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .cw-grid__hole { display: none; }
  .cw-span-2 { grid-column: auto; }
}

/* Tile: a flat poster pinned to the wall. The word inside is cropped by the edge */
.cw-tile { position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: var(--cw-paper); color: var(--cw-ink); }
.cw-tile--tall { aspect-ratio: 4 / 5; }
.cw-tile--wide { aspect-ratio: 21 / 9; }
.cw-tile--blue { background: var(--cw-blue); color: var(--cw-paper); }
.cw-tile--red { background: var(--cw-red); color: var(--cw-ink); }
.cw-tile--pink { background: var(--cw-pink); color: var(--cw-ink); }
.cw-tile--acid { background: var(--cw-acid); color: var(--cw-ink); }
.cw-tile--yellow { background: var(--cw-yellow); color: var(--cw-ink); }
.cw-tile--ink { background: var(--cw-ink); color: var(--cw-ground); }
.cw-tile__word { position: absolute; left: -.04em; top: -.14em; margin: 0; font-family: var(--cw-poster); font-size: var(--cw-text-poster); font-weight: 400; line-height: .86; letter-spacing: var(--cw-tracking-poster); text-transform: uppercase; white-space: nowrap; }
.cw-tile__word--sm { font-size: var(--cw-text-poster-sm); }
.cw-tile__word--bottom { top: auto; bottom: -.1em; }
.cw-tile__word--right { left: auto; right: -.04em; }
.cw-tile__word--stack { white-space: normal; }
.cw-tile__note { position: absolute; left: 12px; bottom: 10px; max-width: 26ch; font-size: var(--cw-text-micro); line-height: 1.35; }
.cw-tile__note--top { top: 10px; bottom: auto; }
.cw-tile__note--right { left: auto; right: 12px; text-align: right; }
.cw-tile__dots { position: absolute; inset: 0; background-image: radial-gradient(currentColor 1.2px, transparent 1.4px); background-size: 9px 9px; opacity: .22; pointer-events: none; }

/* Caption: the line of text under a tile */
.cw-cap { margin-top: 8px; font-size: var(--cw-text-small); }
.cw-cap b { font-weight: 600; }
.cw-cap span { color: var(--cw-soft); }

/* Riso: a word printed twice, pink over blue, slightly out of register */
.cw-riso { position: relative; display: inline-block; color: transparent; font-family: var(--cw-poster); text-transform: uppercase; line-height: .86; }
.cw-riso::before, .cw-riso::after { content: attr(data-word); position: absolute; inset: 0; mix-blend-mode: multiply; }
.cw-riso::before { color: var(--cw-blue); }
.cw-riso::after { color: var(--cw-pink); transform: translate(var(--cw-riso-shift), calc(var(--cw-riso-shift) * -.6)); }

/* Ticker: one running line of notices. Always inside .cw-ticker so it never widens the page */
.cw-ticker { overflow-x: clip; border-block: var(--cw-border); font-size: var(--cw-text-small); text-transform: uppercase; letter-spacing: .06em; }
.cw-ticker__track { display: flex; gap: 48px; width: max-content; padding-block: 7px; animation: cw-run 40s linear infinite; }
@keyframes cw-run { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .cw-ticker__track { animation: none; } }

/* Index list: rows of text with a right-hand value, ruled in ink */
.cw-index { margin: 0; padding: 0; list-style: none; border-top: var(--cw-border); }
.cw-index li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: var(--cw-border); }
.cw-index li > span:last-child { color: var(--cw-soft); text-align: right; white-space: nowrap; }

/* Pricing: plain ruled columns, the featured plan gets an acid tile header */
.cw-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--cw-gap); }
.cw-plan { display: flex; flex-direction: column; border: var(--cw-border); background: var(--cw-ground); }
.cw-plan__head { position: relative; overflow: hidden; height: 132px; border-bottom: var(--cw-border); background: var(--cw-paper); }
.cw-plan--featured .cw-plan__head { background: var(--cw-acid); }
.cw-plan__body { display: flex; flex: 1; flex-direction: column; gap: 12px; padding: 16px; }
.cw-plan__price { font-size: var(--cw-text-h2); font-weight: 600; }
.cw-plan__price small { color: var(--cw-soft); font-size: var(--cw-text-small); font-weight: 400; }
.cw-plan__list { flex: 1; margin: 0; padding: 0; list-style: none; font-size: var(--cw-text-small); }
.cw-plan__list li { padding: 5px 0; border-top: 1px dashed var(--cw-faint); }
.cw-plan__list li::before { content: "+ "; }
@media (max-width: 860px) { .cw-plans { grid-template-columns: minmax(0, 1fr); } }

/* Toggle: two text options, the pressed one is inked */
.cw-toggle { display: inline-flex; border: var(--cw-border); }
.cw-toggle button { padding: 6px 12px; border: 0; background: transparent; color: var(--cw-ink); font: var(--cw-text-small) var(--cw-mono); cursor: pointer; }
.cw-toggle button[aria-pressed="true"] { background: var(--cw-ink); color: var(--cw-ground); }

/* Table: comparison grid in ink rules. The wrap scrolls on phones */
.cw-table-wrap { overflow-x: auto; }
.cw-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: var(--cw-text-small); }
.cw-table th, .cw-table td { padding: 8px 10px; border-bottom: var(--cw-border); text-align: left; }
.cw-table thead th { border-top: var(--cw-border); background: var(--cw-ground-2); font-weight: 600; }
.cw-table td:not(:first-child), .cw-table th:not(:first-child) { text-align: center; }

/* FAQ: details with a plus or a minus */
.cw-faq { border-top: var(--cw-border); }
.cw-faq details { border-bottom: var(--cw-border); }
.cw-faq summary { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; font-weight: 600; cursor: pointer; list-style: none; }
.cw-faq summary::-webkit-details-marker { display: none; }
.cw-faq summary::after { content: "+"; }
.cw-faq details[open] summary::after { content: "-"; }
.cw-faq p { max-width: var(--cw-measure); margin: 0 0 14px; color: var(--cw-soft); }

/* Article: mono prose on a narrow measure, with tiles as figures */
.cw-article { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; }
.cw-article__side { font-size: var(--cw-text-small); }
@media (max-width: 860px) { .cw-article { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
.cw-prose { max-width: var(--cw-measure); font-size: var(--cw-text-lead); line-height: 1.6; }
.cw-prose p, .cw-prose ul, .cw-prose ol { margin: 0 0 1.1em; }
.cw-prose h2 { margin: 2em 0 .6em; font-size: var(--cw-text-h2); line-height: 1.2; }
.cw-prose h3 { margin: 1.6em 0 .5em; font-size: var(--cw-text-h3); }
.cw-prose ul { padding-left: 0; list-style: none; }
.cw-prose ul li::before { content: "- "; }
.cw-prose code { padding: 0 4px; background: var(--cw-paper); font-size: .92em; }
.cw-prose pre { overflow-x: auto; margin: 0 0 1.2em; padding: 14px 16px; background: var(--cw-ink); color: var(--cw-ground); font-size: 13px; line-height: 1.6; }
.cw-prose pre code { padding: 0; background: none; }
.cw-prose blockquote { margin: 1.6em 0; padding: 0 0 0 16px; border-left: 4px solid var(--cw-pink); font-size: var(--cw-text-h2); line-height: 1.3; }
.cw-prose figure { margin: 1.6em 0; }
.cw-prose figcaption { margin-top: 8px; color: var(--cw-soft); font-size: var(--cw-text-small); }
.cw-note { margin: 1.4em 0; padding: 12px 14px; border: var(--cw-border); background: var(--cw-acid); font-size: var(--cw-text-body); }

/* Form: square inputs on paper, ink borders, blue focus */
.cw-form { display: grid; gap: 16px; }
.cw-field { display: grid; gap: 4px; }
.cw-field label { font-size: var(--cw-text-small); font-weight: 600; }
.cw-input, .cw-select { width: 100%; padding: 10px 12px; border: var(--cw-border); border-radius: var(--cw-radius); background: var(--cw-paper); color: var(--cw-ink); font: var(--cw-text-body) var(--cw-mono); }
.cw-input:focus, .cw-select:focus { outline: 2px solid var(--cw-blue); outline-offset: 1px; }
.cw-help { color: var(--cw-soft); font-size: var(--cw-text-micro); }
.cw-field--error .cw-input { border-color: var(--cw-red); outline: 2px solid var(--cw-red); outline-offset: -2px; }
.cw-error { color: var(--cw-red); font-size: var(--cw-text-micro); font-weight: 600; }
.cw-check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--cw-text-small); }
.cw-check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--cw-ink); }
.cw-choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cw-choice label { display: block; padding: 10px; border: var(--cw-border); background: var(--cw-paper); font-size: var(--cw-text-small); cursor: pointer; }
.cw-choice input { position: absolute; opacity: 0; }
.cw-choice input:checked + label { background: var(--cw-ink); color: var(--cw-ground); }
@media (max-width: 480px) { .cw-choice { grid-template-columns: minmax(0, 1fr); } }

/* Footer: three columns of plain links and a last line */
.cw-footer { padding-block: 40px 28px; border-top: var(--cw-border); font-size: var(--cw-text-small); }
.cw-footer__cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.cw-footer__cols ul { margin: 0; padding: 0; list-style: none; }
.cw-footer__cols li { margin-bottom: 4px; }
.cw-footer__last { margin-top: 32px; color: var(--cw-soft); font-size: var(--cw-text-micro); }
@media (max-width: 860px) { .cw-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
