/* ND filter and long exposure calculator. Layout only.
   Every color is a token from /assets/fts.css and no font is named here, so a new palette or typeface
   reaches this page by changing fts.css alone. Tints are mixed from the accent token.
   The big readouts are h3 elements, which is how they pick up the brand's heading face.
   Accent is used for: the chosen mode, focus, the timer bar and the start button (all live state or actions). */

.nd-page [hidden] { display:none !important; }
.nd-hero { padding-bottom:24px; }
.nd-hero .lede { max-width:62ch; text-wrap:pretty; }   /* no one-word last line on a small phone */
.nd { padding:8px 0 72px; }
@media (max-width:640px){ .nd { padding-bottom:52px; } }
.nd-print-head { display:none; }
/* With scripts off, the empty controls stay out of sight and the note inside noscript explains. */
html:not(.nd-js) .nd-modes, html:not(.nd-js) .nd-grid { display:none; }

/* Mode switch: three radio chips */
.nd-modes { border:0; min-width:0; }
.nd-modes legend { padding:0; margin-bottom:10px; font-size:15px; font-weight:700; color:var(--mut); }
.nd-chips { display:flex; flex-wrap:wrap; gap:8px; }
.nd-chip { position:relative; cursor:pointer; }
.nd-chip input { position:absolute; opacity:0; width:1px; height:1px; }
.nd-chip span {
  display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:8px 16px;
  border:1px solid var(--field-stroke); border-radius:999px;
  font-size:15px; font-weight:600; line-height:1.3; color:var(--dim);
  transition:border-color .25s var(--ease-out), background-color .25s var(--ease-out);
}
.nd-chip:hover span { border-color:var(--txt); }
.nd-chip input:checked + span { border-color:var(--accent); background:transparent; background:color-mix(in srgb, var(--accent) 14%, transparent); color:var(--txt); }
.nd-chip input:focus-visible + span { outline:2px solid var(--accent); outline-offset:2px; }
/* One row on a phone: the three chips share the width, and may wrap their words before they ever push the page wide. */
@media (max-width:520px){
  .nd-chips { flex-wrap:nowrap; gap:6px; }
  .nd-chip { flex:1 1 auto; min-width:0; display:flex; }
  .nd-chip span { width:100%; padding-left:8px; padding-right:8px; text-align:center; }
}

/* Inputs left, answer right; one column on a phone, in reading order: inputs, answer, card. */
.nd-grid { display:grid; grid-template-columns:minmax(0, 1fr); gap:28px; margin-top:22px; grid-template-areas:"in" "out" "card"; }
.nd-grid > * { min-width:0; }
.nd-in { grid-area:in; }
.nd-out { grid-area:out; }
.nd-card { grid-area:card; }
@media (min-width:900px){
  .nd-grid { grid-template-columns:minmax(0, .82fr) minmax(0, 1.18fr); gap:36px 64px; grid-template-areas:"in out" "card out"; align-items:start; }
}

.nd-panel > :first-child .field:first-child, .nd-panel > .nd-two:first-child .field { margin-top:0; }
.nd-pick + .nd-pick, .nd-two + .nd-pick { margin-top:4px; }
.nd-two > .nd-pick + .nd-pick { margin-top:0; }
/* Small phones: frame rate and aperture stack, so a typed value never has to squeeze into half the width. */
@media (max-width:420px){ .nd-panel > .nd-two { grid-template-columns:minmax(0, 1fr); } .nd-panel > .nd-two > .nd-pick + .nd-pick { margin-top:4px; } .nd-panel > .nd-two > .nd-pick + .nd-pick .field:first-child { margin-top:18px; } }
.nd-two { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); gap:0 14px; }
.nd-hint { margin-top:8px; font-size:15px; line-height:1.55; color:var(--mut); max-width:52ch; }
.nd-hint:empty { display:none; }
.nd-typed { margin-top:12px; }
.nd-page .field .err { line-height:1.5; }
.nd-page .field input::placeholder { color:var(--mut); opacity:1; }

/* Filter stack */
.nd-filters { border:0; min-width:0; margin-top:26px; }
.nd-filters legend { padding:0; font-size:15px; font-weight:700; }
.nd-frow + .nd-frow { margin-top:14px; padding-top:6px; border-top:1px solid var(--line); }
.nd-frow-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.nd-frow-label { font-size:15px; font-weight:600; color:var(--dim); }
.nd-frow .field { margin-top:8px; }
.nd-frow .nd-two .field { margin-top:12px; }
/* The typed row: the notation gets the wider half so "ND number" is never cut short on a small phone. */
.nd-ftyped { grid-template-columns:minmax(0, 1.3fr) minmax(0, 1fr); }
.nd-filters > .nd-btn { margin-top:16px; }

/* Buttons that are not the page's one action */
.nd-btn {
  font:inherit; font-size:15px; font-weight:700; line-height:1.3; color:var(--txt); background:transparent;
  border:1.5px solid var(--field-stroke); border-radius:12px; min-height:44px; padding:9px 16px; cursor:pointer;
  transition:border-color .25s var(--ease-out);
}
.nd-btn:hover, .nd-btn:focus-visible { border-color:var(--accent); }
.nd-btn:disabled { opacity:.45; cursor:not-allowed; border-color:var(--field-stroke); }
/* Remove: a quiet text button, still 44px to the thumb. */
.nd-btn.nd-remove { padding:6px 0 6px 12px; border-color:transparent; font-weight:600; color:var(--dim); text-decoration:underline; text-underline-offset:3px; }
.nd-btn.nd-remove:hover, .nd-btn.nd-remove:focus-visible { border-color:transparent; color:var(--txt); text-decoration-color:var(--accent); }

/* The answer. It carries the site's .panel class, so its box follows the brand. */
.nd-read { display:flex; flex-direction:column; gap:4px; font-weight:800; }
.nd-read-k { font-size:15px; font-weight:700; line-height:1.4; letter-spacing:.01em; color:var(--mut); }
/* Sizes are steps from the DESIGN.md type ramp: display for the shutter time and the timer, display-page for worded answers. */
.nd-read-v { font-size:clamp(36px, 6.4vw, 68px); line-height:1; letter-spacing:-0.02em; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
#out-reverse .nd-read-v, #out-video .nd-read-v { font-size:clamp(34px, 6.2vw, 60px); line-height:1.02; }
.nd-say { margin-top:14px; font-size:16.5px; line-height:1.6; color:var(--dim); max-width:50ch; }
.nd-problem { font-size:16.5px; line-height:1.6; color:var(--dim); }
.nd-problem::before { content:""; display:inline-block; width:8px; height:8px; margin-right:10px; border-radius:50%; background:var(--error); vertical-align:middle; }

.nd-ledger { margin-top:18px; border-top:1px solid var(--line-strong); }
.nd-ledger div { display:grid; grid-template-columns:minmax(0, 150px) minmax(0, 1fr); gap:16px; padding:10px 0; border-bottom:1px solid var(--line); font-size:15px; line-height:1.5; }
.nd-ledger dt { color:var(--mut); font-weight:600; }
.nd-ledger dd { color:var(--txt); font-variant-numeric:tabular-nums; }
@media (max-width:440px){ .nd-ledger div { grid-template-columns:1fr; gap:0; } }

/* Nearest real filters */
.nd-opt-h { margin-top:22px; font-size:15px; font-weight:700; color:var(--mut); }
.nd-opts { margin-top:8px; border-top:1px solid var(--line-strong); }
.nd-opt { padding:14px 0 16px; border-bottom:1px solid var(--line); }
.nd-opt h4 { font-size:16.5px; font-weight:700; line-height:1.4; }
.nd-opt p { margin-top:4px; font-size:15px; line-height:1.6; color:var(--dim); max-width:54ch; }
.nd-opt .nd-opt-names { color:var(--mut); font-variant-numeric:tabular-nums; }
.nd-opt .nd-btn { margin-top:12px; }
.nd-vnd { margin-top:14px; }

/* Bulb timer */
/* The ledger above ends on a rule, so the timer needs none of its own. */
.nd-timer { margin-top:22px; }
.nd-timer-k { font-size:15px; font-weight:700; color:var(--mut); }
/* Quiet until it runs: the answer above is the bright number, the count takes over once it starts. */
.nd-timer-v { font-size:clamp(36px, 6.4vw, 68px); font-weight:700; line-height:1.1; font-variant-numeric:tabular-nums; color:var(--mut); }
.nd-timer.is-running .nd-timer-v { color:var(--txt); }
.nd-timer.is-done .nd-timer-v { color:var(--green); }
.nd-bar { height:4px; margin-top:10px; border-radius:999px; background:var(--line-strong); overflow:hidden; }
.nd-bar i { display:block; height:100%; background:var(--accent); transform-origin:left center; transform:scaleX(0); }
.nd-timer-btns { display:flex; gap:10px; margin-top:16px; }
.nd-timer .nd-go { flex:1 1 auto; width:auto; margin-top:0; min-height:48px; padding:12px 18px; font-size:16.5px; }
.nd-timer .nd-btn { min-height:48px; }
.nd-check { display:inline-flex; align-items:center; gap:10px; min-height:44px; margin-top:8px; font-size:15px; color:var(--dim); cursor:pointer; }
.nd-check input { width:20px; height:20px; accent-color:var(--accent); }
.nd-timer .nd-hint { margin-top:2px; }
@media (prefers-reduced-motion: reduce) { .nd-bar { display:none; } }

.nd-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; margin-top:22px; }
.nd-offline { margin-top:12px; }

/* Phones: while the answer is still below the screen, a strip along the bottom shows it and jumps to it. */
.nd-peek {
  position:fixed; left:0; right:0; bottom:0; z-index:30; display:flex; align-items:baseline; justify-content:space-between; gap:16px;
  padding:12px 20px calc(12px + env(safe-area-inset-bottom)); background:var(--surface); border-top:1px solid var(--line-strong); text-decoration:none;
}
.nd-peek span { font-size:15px; font-weight:700; color:var(--mut); }
.nd-peek b { font-size:19px; font-weight:700; line-height:1.3; font-variant-numeric:tabular-nums; text-align:right; }
@media (min-width:900px){ .nd-peek { display:none !important; } }
.nd-copied { font-size:15px; color:var(--dim); }

/* Tables: the card and the names table */
.nd-table { width:100%; border-collapse:collapse; font-size:15px; line-height:1.4; font-variant-numeric:tabular-nums; }
.nd-table th, .nd-table td { padding:10px 14px 10px 0; text-align:left; font-weight:400; border-bottom:1px solid var(--line); vertical-align:baseline; }
.nd-table th:last-child, .nd-table td:last-child { padding-right:0; }
.nd-table thead th { font-weight:600; color:var(--mut); border-bottom-color:var(--line-strong); }
.nd-table tbody th { font-weight:700; color:var(--txt); }
.nd-table td { color:var(--dim); }

.nd-card h3 { font-size:19px; }
.nd-card .nd-table { max-width:360px; margin-top:14px; }
.nd-card .nd-table td { color:var(--txt); font-weight:600; }
.nd-card .nd-btn { margin-top:18px; }

.nd-scroll { margin-top:26px; overflow-x:auto; }
.nd-names { max-width:760px; }
@media (max-width:560px){
  .nd-names th:nth-child(5), .nd-names td:nth-child(5) { display:none; }
  .nd-names th, .nd-names td { padding-right:10px; }
}
.nd-src { margin-top:16px; font-size:12.5px; line-height:1.6; color:var(--mut); max-width:78ch; }
.nd-src a { text-decoration:underline; text-underline-offset:3px; }

.nd-try { margin-top:44px; max-width:860px; }
.nd-try h3 { font-size:19px; }
.nd-try p { margin-top:8px; }
.nd-try p + p { margin-top:14px; }

/* Paper: one sheet. The answer and the card on the left, the names table on the right, in the paper's own ink
   (system colors, so no palette is named here). */
@media print {
  :root { color-scheme:light; }
  body { background:Canvas; color:CanvasText; font-size:12.5px; }
  .nd-page { --ground:Canvas; --surface:Canvas; --raised:Canvas; --txt:CanvasText; --dim:CanvasText; --mut:CanvasText; --line:GrayText; --line-strong:CanvasText; --field-stroke:GrayText;
    display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1.3fr); column-gap:36px; align-items:start; }
  .nav, footer, .nd-hero, .nd-modes, .nd-in, .nd-actions, .nd-offline, .nd-peek, .nd-timer, .nd-btn, #math, #signup, noscript { display:none !important; }
  .nd-page .wrap { max-width:none; padding:0; }
  .nd-print-head { display:block; font-size:12.5px; margin-bottom:14px; }
  .nd, .band { padding:0; border:0; background:none; }
  .nd-grid { display:block; margin:0; }
  .nd-out.panel { padding:0 0 6px; border:0; background:none; }
  .nd-read-v { font-size:40px !important; }
  .nd-say, .nd-hint { font-size:12.5px; }
  .nd-ledger div { grid-template-columns:minmax(0, 110px) minmax(0, 1fr); gap:10px; padding:5px 0; font-size:12.5px; }
  .nd-card { margin-top:16px; break-inside:avoid; }
  #names { break-inside:avoid; }
  #names h2 { font-size:19px; max-width:none; }
  #names .lede { font-size:12.5px; margin-top:6px; max-width:none; }
  .nd-names th:nth-child(5), .nd-names td:nth-child(5) { display:table-cell; }
  .nd-table { font-size:12.5px; }
  .nd-table th, .nd-table td { padding-top:4px; padding-bottom:4px; }
  .nd-scroll { margin-top:10px; overflow:visible; }
}
