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

/* Base */
.di { margin: 0; background: var(--di-paper); color: var(--di-ink); font-family: var(--di-sans); font-size: var(--di-text-body); line-height: var(--di-leading); -webkit-font-smoothing: antialiased; }
.di *, .di *::before, .di *::after { box-sizing: border-box; }
:where(.di) a { color: inherit; }
.di :focus-visible { outline: 2px solid var(--di-dot); outline-offset: 3px; }
.di-container { width: min(100% - 2 * var(--di-gutter), var(--di-container)); margin-inline: auto; }
.di-measure { max-width: var(--di-measure); }
.di-section { padding-block: var(--di-section); }
.di-section--top { padding-top: var(--di-top); }

/* Grid: three equal columns. Two-thirds + one-third for the masthead */
.di-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px var(--di-gutter); }
.di-span-2 { grid-column: span 2; }
@media (max-width: 860px) { .di-grid { grid-template-columns: 1fr 1fr; } .di-span-2 { grid-column: span 2; } }
@media (max-width: 600px) { .di-grid { grid-template-columns: 1fr; gap: 40px; } .di-span-2 { grid-column: auto; } }

/* Type: one family, weight and gray do the work */
.di-title { margin: 0; font-size: var(--di-text-title); font-weight: 700; letter-spacing: var(--di-tracking-title); line-height: 1.15; }
.di-statement { margin: 0; font-size: var(--di-text-statement); font-weight: 450; letter-spacing: -.01em; line-height: 1.33; }
.di-h2 { margin: 0 0 28px; font-size: var(--di-text-h2); font-weight: 500; letter-spacing: -.01em; line-height: 1.25; }
.di-soft { color: var(--di-soft); }
.di-gray { color: var(--di-gray); }
.di-mono { font-family: var(--di-mono); font-size: var(--di-text-small); letter-spacing: 0; }
.di-small { font-size: var(--di-text-small); }

/* The dot: one per page, at the top of the nav list */
.di-dot { display: block; width: var(--di-dot-size); height: var(--di-dot-size); border-radius: 50%; background: var(--di-dot); }
.di-dot--sm { display: inline-block; width: 8px; height: 8px; vertical-align: middle; margin-right: 8px; }

/* Masthead: title on the left, the dot and a vertical gray nav list on the right */
.di-mast { align-items: start; }
.di-mast .di-title a { text-decoration: none; }
.di-nav { display: flex; flex-direction: column; gap: 0; margin: 8px 0 0; padding: 0; list-style: none; font-size: var(--di-text-nav); font-weight: 450; line-height: 1.45; }
.di-nav a { color: var(--di-gray); text-decoration: none; transition: color .15s var(--di-ease); }
.di-nav a:hover, .di-nav a[aria-current="page"] { color: var(--di-ink); }
@media (max-width: 600px) { .di-mast__side { display: flex; align-items: flex-start; gap: 18px; } .di-nav { flex-direction: row; flex-wrap: wrap; gap: 4px 16px; margin: 0; font-size: 18px; } .di-dot { flex: none; margin-top: 4px; width: 16px; height: 16px; } }

/* Index entry: a bold name, then one plain line. The main repeating unit */
.di-entry { margin: 0 0 28px; }
.di-entry__name { display: block; margin: 0 0 4px; font-size: var(--di-text-body); font-weight: 600; line-height: 1.35; }
.di-entry__text { margin: 0; }
.di-entry__meta { color: var(--di-gray); }
a.di-entry { display: block; text-decoration: none; }
a.di-entry:hover .di-entry__name { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* Slab: a flat gray block, bold, with an arrow. Used for buttons and featured links */
.di-slab { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 16px 24px; border: 0; border-radius: var(--di-radius); background: var(--di-slab); color: var(--di-ink); font: 600 var(--di-text-body)/1.35 var(--di-sans); text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background .15s var(--di-ease); }
.di-slab:hover { background: var(--di-slab-2); }
.di-slab__sub { font-weight: 600; }
.di-slab--ink { background: var(--di-ink); color: var(--di-paper); }
.di-slab--ink:hover { background: var(--di-ink-2); }
.di-slab--wide { display: flex; width: 100%; white-space: normal; }
.di-arrow::after { content: " \2192"; }
.di-slab.di-arrow { flex-direction: row; align-items: center; }
.di-slab.di-arrow::after { margin-left: .35em; }
.di-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }

/* Text link: underlined only on hover, gray meta beside it */
.di-link { color: var(--di-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--di-gray); }
.di-link:hover { text-decoration-color: var(--di-ink); }

/* Figure: a drawn object in a gray field, never a photo frame */
.di-figure { position: relative; aspect-ratio: 4 / 3; background: var(--di-slab); overflow: hidden; }
.di-figure svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.di-caption { margin: 10px 0 0; color: var(--di-gray); font-size: var(--di-text-small); }

/* Table: a schedule or price list with hairlines */
.di-table { width: 100%; border-collapse: collapse; font-size: var(--di-text-body); }
.di-table th { padding: 0 0 10px; color: var(--di-gray); font-weight: 450; text-align: left; }
.di-table td { padding: 12px 16px 12px 0; border-top: 1px solid var(--di-rule); vertical-align: top; }
.di-table td:first-child { font-weight: 600; }

/* Pricing: three columns of plain text, the price is a bold number */
.di-plan { display: flex; flex-direction: column; gap: 14px; padding-top: 20px; border-top: 2px solid var(--di-ink); }
.di-plan--pick { border-top-color: var(--di-dot); }
.di-plan__name { margin: 0; font-size: var(--di-text-h2); font-weight: 500; }
.di-plan__price { margin: 0; font-size: var(--di-text-title); font-weight: 700; letter-spacing: var(--di-tracking-title); line-height: 1; }
.di-plan__price span { color: var(--di-gray); font-size: var(--di-text-body); font-weight: 450; letter-spacing: 0; }
.di-list { margin: 0; padding: 0; list-style: none; }
.di-list li { padding: 6px 0; }
.di-list li::before { content: "+\00a0\00a0"; color: var(--di-gray); }

/* Toggle: two gray slabs, the chosen one ink */
.di-toggle { display: inline-flex; gap: 4px; }
.di-toggle button { padding: 8px 14px; border: 0; background: var(--di-slab); color: var(--di-soft); font: 500 var(--di-text-small) var(--di-sans); cursor: pointer; }
.di-toggle button[aria-pressed="true"] { background: var(--di-ink); color: var(--di-paper); }

/* Article */
.di-article { font-size: 18px; line-height: 1.6; }
.di-article p { margin: 0 0 1.1em; }
.di-article h2 { margin: 2em 0 .6em; font-size: var(--di-text-h2); font-weight: 600; letter-spacing: -.01em; }
.di-article blockquote { margin: 1.6em 0; padding: 0; font-size: var(--di-text-statement); font-weight: 450; line-height: 1.35; letter-spacing: -.01em; }
.di-article ul { margin: 0 0 1.1em; padding-left: 1.1em; }
.di-article li { margin-bottom: .35em; }

/* Forms: gray filled fields, no borders */
.di-form { display: grid; gap: 22px; }
.di-field { display: grid; gap: 8px; }
.di-label { font-size: var(--di-text-small); font-weight: 600; }
.di-hint { color: var(--di-gray); font-size: var(--di-text-small); }
.di-input, .di-select { width: 100%; padding: 14px 16px; border: 0; border-radius: var(--di-radius); background: var(--di-slab); color: var(--di-ink); font: 450 var(--di-text-body) var(--di-sans); }
.di-input::placeholder { color: var(--di-gray); }
.di-input:focus, .di-select:focus { outline: 2px solid var(--di-dot); outline-offset: 0; background: var(--di-paper); }
.di-check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--di-text-small); }
.di-check input { margin-top: 3px; accent-color: var(--di-ink); }
.di-choice { display: flex; flex-wrap: wrap; gap: 4px; }
.di-choice label { position: relative; }
.di-choice input { position: absolute; opacity: 0; }
.di-choice span { display: block; padding: 10px 14px; background: var(--di-slab); font-size: var(--di-text-small); font-weight: 500; cursor: pointer; }
.di-choice input:checked + span { background: var(--di-ink); color: var(--di-paper); }
.di-choice input:focus-visible + span { outline: 2px solid var(--di-dot); outline-offset: 2px; }

/* Footer: three gray columns, small */
.di-footer { padding-block: 56px 72px; color: var(--di-gray); font-size: var(--di-text-small); }
.di-footer a { color: var(--di-gray); text-decoration: none; }
.di-footer a:hover { color: var(--di-ink); }
.di-footer .di-list li::before { content: none; }
.di-footer .di-list li { padding: 2px 0; }

/* Drawing helpers for inline SVG figures, so drawings use the tokens too */
.di-figure .f-ink { fill: var(--di-ink); }
.di-figure .f-gray { fill: var(--di-gray); }
.di-figure .f-paper { fill: var(--di-paper); }
.di-figure .f-dot { fill: var(--di-dot); }
.di-figure .f-line { fill: none; stroke: var(--di-ink); stroke-width: 3; }
