/* Tarka, the Paper identity: one stylesheet for every page.
   A warm page, a bold serif, ink outlines with a hard shadow on what can be
   pressed, and three colours kept for what the eye should find: indigo for
   links and actions, coral for emphasis, amber as a highlighter.
   The night edition gives the same names other values; nothing else changes. */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --paper:  #f6f1e7;
  --raised: #fffdf8;
  --ink:    #14142b;
  --soft:   #4d473d;
  --faint:  #6f6757;
  --rule:   #d9d0bf;
  --indigo: #4338ca;
  --coral:  #e63e5c;
  --amber:  #ffb703;
  --hl:     #ffb703;
  --on-indigo: #ffffff;

  --serif: "Fraunces", "Tiro Devanagari Hindi", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Devanagari", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --line: 1.5px solid var(--ink);
  --press: 3px 3px 0 var(--ink);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:  #12121c;
    --raised: #1b1b29;
    --ink:    #f3efe6;
    --soft:   #bdb6a8;
    --faint:  #948d80;
    --rule:   #2c2c3d;
    --indigo: #8f88ff;
    --coral:  #ff6b85;
    --amber:  #ffc53d;
    --hl:     #5a4a12;
    --on-indigo: #12121c;
    color-scheme: dark;
  }
}

html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--sans); }
a { color: var(--indigo); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The mark: three dots. */
.mark { width: 30px; height: 25px; flex: none; }
.mark .d1 { fill: var(--coral); } .mark .d2 { fill: var(--indigo); } .mark .d3 { fill: var(--amber); }

/* Masthead and search box. */
.bar { display: flex; align-items: center; gap: 18px; padding: 18px 28px 0; max-width: 1180px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font: 800 26px/1 var(--serif); letter-spacing: -.04em; }
h1.brand { margin: 0; } h1.brand a { display: flex; align-items: center; gap: inherit; color: inherit; text-decoration: none; }
/* min-width: a text field has a width of its own (twenty characters), and
   a box in a row will not shrink below what is in it unless told it may.
   On a narrow phone that pushed the box, and the page, past the screen. */
.search { position: relative; flex: 1; min-width: 0; max-width: 560px; display: flex; align-items: center; background: var(--raised); border: var(--line); border-radius: 999px; box-shadow: var(--press); }
.search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: inherit; padding: 11px 6px 11px 18px; outline: none; }
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: var(--faint); opacity: 1; }
/* In use, the box's own outline turns indigo and thickens, and its shadow
   with it: one line, not a ring drawn around another. */
.search:focus-within { outline: 2px solid transparent; outline-offset: 2px; border-color: var(--indigo); box-shadow: inset 0 0 0 1.5px var(--indigo), 3px 3px 0 var(--indigo); }
.search button { border: 0; background: none; color: var(--ink); font: 600 17px var(--sans); padding: 8px 14px; cursor: pointer; }
.search .go { border-left: var(--line); border-radius: 0 999px 999px 0; }
.search kbd { font: 500 12px var(--mono); color: var(--faint); border: 1px solid var(--rule); border-radius: 6px; padding: 1px 6px; margin-right: 8px; }
.search [hidden] { display: none; }
/* Suggestions, put inside the box by its script: a list that drops below
   it, over the page. */
.sugg { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 5; list-style: none; margin: 0; padding: 6px; text-align: left; background: var(--raised); border: var(--line); border-radius: 18px; box-shadow: var(--press); }
.sugg[hidden] { display: none; }
.sugg li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; font-size: 16px; line-height: 1.3; color: var(--soft); cursor: pointer; overflow-wrap: anywhere; }
.sugg li b { color: var(--ink); font-weight: 600; }
.sugg li[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: inset 4px 0 0 var(--coral); }
.sugg-i { flex: none; display: grid; place-items: center; color: var(--faint); } .sugg-i svg { width: 17px; height: 17px; }

/* Tabs. */
.tabs { display: flex; gap: 24px; max-width: 1180px; margin: 16px auto 0; padding: 0 28px; border-bottom: var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 0 0 9px; color: var(--faint); text-decoration: none; font: 600 14px var(--sans); white-space: nowrap; }
.tabs a.on { color: var(--ink); box-shadow: inset 0 -3px 0 var(--coral); }

/* The page. */
.page { max-width: 1180px; margin: 0 auto; padding: 0 28px 40px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 40px; padding-top: 18px; }
.meta { margin: 0 0 4px; font-size: 13px; color: var(--faint); }
/* What was done with the search: corrected, kept to a site, priced. */
.scope { margin: 0 0 12px; padding: 10px 14px; border: var(--line); border-radius: 14px; background: var(--raised); font-size: 14px; color: var(--soft); }
.scope b { color: var(--ink); } .scope .meant { font-weight: 600; }

/* A result. */
.results { list-style: none; margin: 0; padding: 0; }
.results > li { padding: 16px 0; border-top: 1px solid var(--rule); }
.results > li:first-child { border-top: 0; }
.where { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--faint); margin-bottom: 3px; min-width: 0; }
.crumbs { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .crumbs b { color: var(--soft); font-weight: 500; }
.tile { width: 20px; height: 20px; flex: none; border-radius: 6px; background: var(--ink); color: var(--paper); font: 600 11px/20px var(--sans); text-align: center; text-transform: uppercase; overflow: hidden; }
.tile.has-icon { background: #fff; box-shadow: 0 0 0 1px var(--rule); } .tile img { display: block; width: 20px; height: 20px; object-fit: contain; }
.title { display: inline-block; color: var(--ink); text-decoration: none; font: 600 21px/1.22 var(--serif); letter-spacing: -.01em; overflow-wrap: anywhere; }
.title:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--coral); }
.title:visited { color: var(--soft); }
.snippet { margin: 4px 0 0; color: var(--soft); font-size: 15px; overflow-wrap: anywhere; }
mark { background: linear-gradient(transparent 58%, var(--hl) 58%); color: var(--ink); font-weight: 600; }
.buy { margin: 4px 0 0; font-size: 14px; color: var(--soft); } .buy b { font: 800 18px var(--serif); color: var(--ink); }
.credit, .unread-note { margin: 4px 0 0; font-size: 13px; color: var(--faint); }
.unread .title { color: var(--soft); }

/* Beside the results. */
.side section { margin-bottom: 26px; }
.side h2 { margin: 0 0 10px; font: 800 18px/1 var(--serif); letter-spacing: -.02em; }
.vids, .stories { list-style: none; margin: 0; padding: 0; }
.vids { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vids a, .stories a { color: var(--ink); text-decoration: none; }
.vids .frame { display: block; aspect-ratio: 16 / 9; border: var(--line); border-radius: 12px; overflow: hidden; background: var(--raised); } .vids img { display: block; width: 100%; height: 100%; object-fit: cover; }
.vids b { display: block; margin-top: 6px; font: 600 13px/1.3 var(--sans); }
.stories li { padding: 10px 0; border-top: 1px solid var(--rule); } .stories li:first-child { border-top: 0; padding-top: 0; }
.stories a { font: 600 16px/1.25 var(--serif); }
.by { margin: 3px 0 0; font-size: 12px; color: var(--faint); }

/* Pager, empty states, footer. */
.pager { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.pager a, .chip, .btn { display: inline-block; padding: 8px 15px; border: var(--line); border-radius: 999px; background: var(--raised); color: var(--ink); text-decoration: none; font: 500 14px var(--sans); }
.pager a, .btn { box-shadow: var(--press); }
.pager a:active, .btn:active { transform: translate(3px, 3px); box-shadow: none; }
.btn { background: var(--indigo); color: var(--on-indigo); font-weight: 600; }
.pager span { font-size: 13px; color: var(--faint); }
.empty { padding: 44px 0 20px; max-width: 520px; } .empty .mark { width: 48px; height: 40px; }
.empty h2 { margin: 14px 0 8px; font: 800 30px/1.1 var(--serif); letter-spacing: -.03em; } .empty p { margin: 0; color: var(--soft); }
.foot { max-width: 1180px; margin: 0 auto; padding: 16px 28px 28px; border-top: var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--faint); }

/* The lead: the page's headline block. */
.lead { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 40px; padding: 24px 0; border-bottom: 3px double var(--ink); }
.lead-shop, .lead-site, .lead-howto { display: block; }
.lead-howto h1 { font-size: clamp(28px, 3.6vw, 42px); line-height: 1.05; max-width: 22ch; }
.says { margin: 0 0 12px; max-width: 66ch; color: var(--soft); font-size: 17px; }
.lead pre { margin: 0 0 14px; padding: 14px 18px; max-width: 760px; max-height: 22em; overflow: auto; border: var(--line); border-radius: 12px; background: var(--ink); color: var(--paper); font: 500 14px/1.6 var(--mono); tab-size: 4; box-shadow: var(--press); }
.lead-howto .src { margin-top: 12px; max-width: 760px; }
.kick { margin: 0; font: 700 11px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--indigo); }
.lead h1 { margin: 6px 0 10px; font: 800 clamp(34px, 5vw, 56px)/1 var(--serif); letter-spacing: -.04em; overflow-wrap: anywhere; }
.lead h1 em { font-style: italic; font-weight: 500; background: linear-gradient(transparent 62%, var(--hl) 62%); }
.extract { margin: 0 0 14px; max-width: 60ch; color: var(--soft); }
.extract::first-letter { float: left; font: 800 46px/.82 var(--serif); padding: 5px 8px 0 0; color: var(--ink); }
.lead-note { margin: 0 0 12px; font-size: 14px; color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.lead-facts { border-left: 1px solid var(--rule); padding-left: 28px; align-self: start; }
.lead-facts dl { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin: 0 0 14px; }
.lead-facts dd { margin: 0; font: 600 19px/1.2 var(--serif); overflow-wrap: anywhere; } .lead-facts dd a { color: inherit; }
.lead-facts dt { font-size: 12px; color: var(--faint); }
.src { margin: 0; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--faint); }
.products { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.products a { display: block; padding: 12px 14px; border: var(--line); border-radius: 16px; background: var(--raised); box-shadow: var(--press); color: var(--ink); text-decoration: none; }
.products b { display: block; font: 800 22px/1.1 var(--serif); } .products span { display: block; margin-top: 4px; font-size: 14px; }
.side:empty { display: none; }
.cols:has(> .side:empty) { grid-template-columns: minmax(0, 760px); }
/* The home page: today's front page. */
.masthead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; max-width: 1080px; margin: 0 auto; padding: 28px 28px 14px; border-bottom: 3px double var(--ink); }
.masthead .brand { font-size: 46px; gap: 12px; } .masthead .mark { width: 44px; height: 36px; }
.dateline { margin: 0; text-align: right; }
.dateline b { display: block; font: 600 11px/1.6 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--indigo); }
.dateline i { font: italic 500 14px var(--serif); color: var(--soft); }
.front .page { max-width: 1080px; }
.front .search { max-width: 640px; margin: 26px auto 28px; box-shadow: 4px 4px 0 var(--ink); }
.front .search:focus-within { box-shadow: inset 0 0 0 1.5px var(--indigo), 4px 4px 0 var(--indigo); }
.front .search input { padding: 15px 8px 15px 22px; font-size: 17px; }
.today .kick span { letter-spacing: 0; text-transform: none; font-weight: 500; color: var(--faint); margin-left: 8px; }
.edition { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 2fr); gap: 36px; margin-top: 12px; }
.top h2 { margin: 0 0 8px; font: 800 clamp(28px, 3.6vw, 40px)/1.04 var(--serif); letter-spacing: -.03em; }
.top a, .more a { color: var(--ink); text-decoration: none; }
.top a:hover, .more a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--coral); }
.more { list-style: none; margin: 0; padding: 0 0 0 28px; border-left: 1px solid var(--rule); display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; align-content: start; }
.more li { padding: 11px 0; border-top: 1px solid var(--rule); } .more li:nth-child(-n+2) { border-top: 0; padding-top: 0; }
.more a { font: 600 17px/1.24 var(--serif); }

/* The small pages: an article, and a form. */
.masthead.plain { max-width: 760px; } .masthead.plain .brand { font-size: 32px; gap: 9px; } .masthead.plain .mark { width: 33px; height: 27px; }
.small .page, .small .foot { max-width: 760px; }
.prose { padding-top: 26px; }
.prose h1 { margin: 6px 0 12px; font: 800 clamp(34px, 6vw, 52px)/1 var(--serif); letter-spacing: -.04em; }
.prose h2 { margin: 34px 0 8px; padding-top: 14px; border-top: 1px solid var(--rule); font: 800 22px/1.15 var(--serif); letter-spacing: -.02em; }
.prose p, .prose li { color: var(--soft); max-width: 66ch; } .prose li { margin-bottom: 7px; } .prose ul { padding-left: 20px; }
.prose .standfirst { font: 500 19px/1.5 var(--serif); color: var(--ink); }
.prose code { font: 500 .9em var(--mono); background: var(--raised); border: 1px solid var(--rule); border-radius: 5px; padding: 1px 5px; color: var(--ink); }
.prose pre { margin: 12px 0; padding: 13px 16px; overflow-x: auto; border: var(--line); border-radius: 12px; background: var(--ink); color: var(--paper); font: 500 13px/1.65 var(--mono); }
.colophon { margin-top: 30px; font-size: 13px; color: var(--faint); }
.add { margin: 22px 0 8px; }
.ask { display: flex; gap: 12px; flex-wrap: wrap; }
.add input { min-width: 0; padding: 12px 18px; border: var(--line); border-radius: 999px; background: var(--raised); color: var(--ink); font: inherit; }
.ask input { flex: 1 1 240px; } .add input::placeholder { color: var(--faint); opacity: 1; }
.add input:focus-visible, .add button:focus-visible, .add summary:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; }
.add button { padding: 11px 22px; border: var(--line); border-radius: 999px; background: var(--indigo); color: var(--on-indigo); font: 600 15px var(--sans); box-shadow: var(--press); cursor: pointer; }
.add button:active { transform: translate(3px, 3px); box-shadow: none; } .add button:disabled { opacity: .6; cursor: default; }
.said { margin: 14px 0 0; padding: 10px 14px; border: var(--line); border-radius: 14px; background: var(--raised); color: var(--ink); }
.said.good { box-shadow: inset 5px 0 0 var(--indigo); } .said.bad { box-shadow: inset 5px 0 0 var(--coral); } .said[hidden] { display: none; }
.add details { margin-top: 14px; } .add summary { cursor: pointer; color: var(--indigo); font-weight: 600; width: fit-content; }
.add details label { display: block; margin: 12px 0 6px; font-weight: 600; color: var(--ink); } .add details label span { font-weight: 400; color: var(--faint); }
.add details input { width: 100%; max-width: 460px; } .hint { font-size: 14px; color: var(--faint); }

/* Phones: a layout of their own, not the wide one squeezed. */
@media (max-width: 760px) {
  .masthead { padding: 18px 16px 10px; } .masthead .brand { font-size: 30px; } .masthead .brand span { display: inline; } .masthead .mark { width: 30px; height: 25px; }
  .dateline i { display: none; }
  .masthead.plain .brand { font-size: 26px; } .masthead.plain .dateline i { display: inline; } .prose h2 { margin-top: 26px; }
  .front .search { margin: 16px 0 20px; } .front .search input { padding: 12px 6px 12px 18px; font-size: 16px; }
  .today .kick span { display: block; margin: 2px 0 0; }
  .edition { display: block; }
  .more { display: block; border-left: 0; padding: 0; margin-top: 14px; border-top: 1px solid var(--rule); } .more li:nth-child(-n+2) { border-top: 1px solid var(--rule); padding-top: 11px; } .more li:first-child { border-top: 0; } .more li:nth-child(n+5) { display: none; }
  .lead { display: block; padding: 16px 0; }
  .lead pre { font-size: 13px; padding: 12px 14px; }
  .lead-facts { border-left: 0; padding-left: 0; margin-top: 14px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; } .chips a { white-space: nowrap; }
  .products { grid-template-columns: 1fr; }
  .extract::first-letter { font-size: 38px; }
  .bar { padding: 12px 16px 0; gap: 10px; }
  .brand span { display: none; }
  .search { max-width: none; } .search kbd { display: none; }
  .tabs { margin-top: 12px; padding: 0 16px; gap: 20px; }
  .page { padding: 0 16px 32px; }
  .cols { display: flex; flex-direction: column; gap: 0; padding-top: 14px; }
  .side { order: -1; }
  .side section { margin-bottom: 18px; }
  .vids, .stories { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .vids li, .stories li { flex: 0 0 62%; scroll-snap-align: start; border: 0; padding: 0; }
  .title { font-size: 19px; }
  .foot { padding: 14px 16px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
