/* TT Grab — "the keeping room": an archivist's desk for creators' own clips.
   Paper and ink, a vermilion catalogue stamp, frame numbers like a contact sheet. */
:root {
  --paper: #f2ede3;
  --paper-2: #e8e1d3;
  --card: #fbf8f2;
  --ink: #1c1a16;
  --ink-2: #4a453c;
  --ink-3: #6f685c;
  --rule: #cfc6b4;
  --stamp: #c8402a;
  --stamp-ink: #ffffff;
  --ok: #2f6b45;
  --focus: #1f5fbf;
  --shadow: 0 1px 0 rgba(28, 26, 22, .06), 0 12px 30px -18px rgba(28, 26, 22, .35);
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --wrap: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15130f; --paper-2: #1e1b16; --card: #201d18; --ink: #efe8db; --ink-2: #c9c0b0;
    --ink-3: #a1988a; --rule: #3a352c; --stamp: #e2583f; --ok: #6fbf8a; --focus: #7fb0ff;
    --shadow: 0 1px 0 rgba(0,0,0,.4), 0 14px 34px -18px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #15130f; --paper-2: #1e1b16; --card: #201d18; --ink: #efe8db; --ink-2: #c9c0b0;
  --ink-3: #a1988a; --rule: #3a352c; --stamp: #e2583f; --ok: #6fbf8a; --focus: #7fb0ff;
  --shadow: 0 1px 0 rgba(0,0,0,.4), 0 14px 34px -18px rgba(0,0,0,.8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.6 var(--sans); text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--stamp); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 16px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }
.mono { font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }

/* Header */
.top { border-bottom: 1px solid var(--rule); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.mark { display: inline-flex; align-items: baseline; gap: 2px; text-decoration: none; font: 600 1.35rem/1 var(--serif); letter-spacing: -.01em; }
.mark .dot { color: var(--stamp); }
.mark small { font: 500 .66rem/1 var(--mono); letter-spacing: .08em; color: var(--ink-3); margin-left: 10px; text-transform: uppercase; }
.nav { display: flex; gap: 22px; font-size: .92rem; }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover { color: var(--stamp); }
@media (max-width: 640px) { .nav a.hide-sm, .mark small { display: none; } }

/* Hero */
.hero { padding: 64px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: 56px; align-items: start; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; gap: 40px; } .hero { padding-top: 40px; } }
.eyebrow { display: inline-flex; gap: 10px; align-items: center; margin-bottom: 20px; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--ink-3); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.02em; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5.1rem); font-variation-settings: "opsz" 144, "SOFT" 30; }
h1 em { font-style: italic; color: var(--stamp); font-weight: 400; }
.line { display: block; overflow: hidden; padding-bottom: .06em; }
.line > span { display: inline-block; transform: translateY(105%); animation: rise .9s cubic-bezier(.2,.7,.1,1) forwards; }
.line:nth-child(2) > span { animation-delay: .08s; }
.line:nth-child(3) > span { animation-delay: .16s; }
@keyframes rise { to { transform: none; } }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 34em; margin: 22px 0 32px; }

/* Grab form */
.grab { position: relative; background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 10px; box-shadow: var(--shadow); display: flex; gap: 8px; }
.grab label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.grab input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 400 1.02rem var(--sans); padding: 14px 12px; }
.grab input::placeholder { color: var(--ink-3); }
.grab input:focus { outline: none; }
.grab:focus-within { border-color: var(--ink-2); }
.btn { appearance: none; border: 0; cursor: pointer; border-radius: 10px; padding: 14px 22px; font: 600 1rem var(--sans); background: var(--ink); color: var(--paper); display: inline-flex; align-items: center; gap: 10px; text-decoration: none; transition: transform .15s ease, background .15s ease; min-height: 48px; }
.btn:hover { background: var(--stamp); color: var(--stamp-ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.btn.ghost:hover { border-color: var(--stamp); color: var(--stamp); background: transparent; }
.paste { font: 500 .8rem var(--mono); text-transform: uppercase; letter-spacing: .05em; background: transparent; border: 1px dashed var(--rule); color: var(--ink-2); border-radius: 8px; padding: 0 12px; cursor: pointer; }
.paste:hover { border-color: var(--stamp); color: var(--stamp); }
@media (max-width: 560px) { .grab { flex-wrap: wrap; } .grab input { flex-basis: 100%; } .grab .btn { flex: 1; justify-content: center; } .paste { min-height: 48px; } }
.hint { margin: 14px 2px 0; font-size: .9rem; color: var(--ink-3); }
.hint a { color: var(--ink-2); }

/* Developing bar */
.develop { height: 3px; margin: 14px 2px 0; background: var(--paper-2); border-radius: 2px; overflow: hidden; visibility: hidden; }
.develop.on { visibility: visible; }
.develop i { display: block; height: 100%; width: 35%; background: var(--stamp); animation: develop 1.2s ease-in-out infinite; }
@keyframes develop { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.status { min-height: 1.6em; margin: 10px 2px 0; font-size: .95rem; color: var(--ink-2); }
.status.err { color: var(--stamp); }

/* Specimen card (hero art) */
.specimen { position: relative; justify-self: end; width: min(100%, 300px); }
@media (max-width: 900px) { .specimen { justify-self: start; width: min(100%, 260px); } }
.sheet { position: relative; aspect-ratio: 9 / 16; border-radius: 18px; background: var(--ink); color: var(--paper); overflow: hidden; box-shadow: var(--shadow); transform: rotate(2.2deg); transition: transform .5s cubic-bezier(.2,.7,.1,1); }
.specimen:hover .sheet { transform: rotate(0deg) translateY(-4px); }
.sheet .frames { position: absolute; inset: 0 auto 0 0; width: 22px; background: repeating-linear-gradient(to bottom, transparent 0 14px, rgba(255,255,255,.14) 14px 22px); }
.sheet .frames.r { inset: 0 0 0 auto; }
.sheet .inner { position: absolute; inset: 22px 34px; display: flex; flex-direction: column; justify-content: space-between; }
.sheet .no { font: 500 .7rem var(--mono); letter-spacing: .1em; opacity: .7; }
.sheet .title { font: italic 400 1.7rem/1.1 var(--serif); }
.sheet .bars { display: grid; gap: 6px; }
.sheet .bars span { height: 6px; border-radius: 3px; background: rgba(255,255,255,.18); }
.sheet .bars span:nth-child(1) { width: 80%; } .sheet .bars span:nth-child(2) { width: 55%; } .sheet .bars span:nth-child(3) { width: 68%; }
.stamp { position: absolute; right: -14px; bottom: 54px; width: 108px; height: 108px; border-radius: 50%; border: 2px solid var(--stamp); color: var(--stamp); display: grid; place-items: center; text-align: center; font: 600 .66rem/1.25 var(--mono); letter-spacing: .1em; text-transform: uppercase; background: var(--paper); transform: rotate(-14deg); box-shadow: 0 0 0 4px var(--paper); }
.stamp b { display: block; font: italic 500 1.2rem/1 var(--serif); letter-spacing: 0; text-transform: none; margin: 2px 0; }
.stamp.thud { animation: thud .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes thud { 0% { transform: rotate(-14deg) scale(1.5); opacity: 0; } 100% { transform: rotate(-14deg) scale(1); opacity: 1; } }

/* Result: index card */
.result { padding: 0 0 32px; }
.card { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 24px; background: var(--card); border: 1px solid var(--rule); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); animation: deal .55s cubic-bezier(.2,.7,.1,1); }
@keyframes deal { from { opacity: 0; transform: translateY(18px) rotate(-.6deg); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) { .card { grid-template-columns: 96px minmax(0,1fr); gap: 16px; padding: 16px; } }
.thumb { aspect-ratio: 9 / 16; border-radius: 10px; background: var(--paper-2); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.card h2 { font-size: clamp(1.25rem, 2.6vw, 1.7rem); line-height: 1.2; margin: 6px 0 4px; overflow-wrap: anywhere; }
.meta { color: var(--ink-3); font-size: .92rem; }
.opts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.opt { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; text-decoration: none; border: 1px solid var(--rule); border-radius: 10px; padding: 10px 14px; min-width: 150px; background: var(--paper); transition: border-color .15s, transform .15s; }
.opt:hover { border-color: var(--stamp); color: var(--ink); transform: translateY(-2px); }
.opt strong { font-weight: 600; font-size: .98rem; }
.opt span { font: 500 .74rem var(--mono); color: var(--ink-3); letter-spacing: .03em; }
.opt.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.opt.primary span { color: var(--paper); opacity: .7; }
.opt.primary:hover { background: var(--stamp); border-color: var(--stamp); color: var(--stamp-ink); }
.reminder { margin-top: 14px; font-size: .88rem; color: var(--ink-3); }

/* Shelf: other Noor products */
.shelf { padding: 28px 0 8px; }
.shelf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--ink); padding-top: 14px; margin-bottom: 8px; }
.shelf-head h2 { font-size: 1.5rem; }
.shelf ol { list-style: none; margin: 0; padding: 0; }
.shelf li a { display: grid; grid-template-columns: 56px minmax(0, 1.1fr) minmax(0, 1.4fr) 32px; gap: 20px; align-items: baseline; padding: 20px 4px; border-bottom: 1px solid var(--rule); text-decoration: none; transition: background .2s, padding .2s; }
.shelf li a:hover { background: var(--card); padding-left: 14px; color: var(--ink); }
.shelf .n { font: 500 .78rem var(--mono); color: var(--ink-3); }
.shelf .name { font: 500 1.35rem/1.15 var(--serif); }
.shelf .what { color: var(--ink-2); font-size: .97rem; }
.shelf .go { font-size: 1.2rem; color: var(--stamp); transition: transform .2s; justify-self: end; }
.shelf li a:hover .go { transform: translateX(6px); }
@media (max-width: 720px) {
  .shelf li a { grid-template-columns: 40px minmax(0,1fr) 24px; gap: 4px 12px; }
  .shelf .what { grid-column: 2; grid-row: 2; }
  .shelf .go { grid-column: 3; grid-row: 1; }
}

/* Ledger: how it works */
section.block { padding: 72px 0; }
.block-head { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 40px; margin-bottom: 36px; align-items: end; }
@media (max-width: 800px) { .block-head { grid-template-columns: 1fr; gap: 12px; } }
.block-head h2 { font-size: clamp(2rem, 4vw, 3rem); }
.block-head p { color: var(--ink-2); margin: 0; max-width: 36em; }
.ledger { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); border-top: 1px solid var(--ink); }
.ledger li { padding: 22px 24px 8px 0; border-right: 1px solid var(--rule); }
.ledger li + li { padding-left: 24px; }
.ledger li:last-child { border-right: 0; }
.ledger .big { font: 300 3.4rem/1 var(--serif); color: var(--stamp); font-variation-settings: "opsz" 144; }
.ledger h3 { font-size: 1.3rem; margin: 14px 0 8px; }
.ledger p { margin: 0; color: var(--ink-2); font-size: .98rem; }
@media (max-width: 760px) {
  .ledger { grid-template-columns: 1fr; }
  .ledger li, .ledger li + li { padding: 20px 0; border-right: 0; border-bottom: 1px solid var(--rule); }
}

/* The rule (honest use) */
.rule { background: var(--ink); color: var(--paper); }
.rule .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; padding-top: 72px; padding-bottom: 72px; align-items: center; }
@media (max-width: 800px) { .rule .wrap { grid-template-columns: 1fr; gap: 20px; padding-top: 56px; padding-bottom: 56px; } }
.rule h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
.rule h2 em { color: var(--stamp); }
.rule p { color: var(--paper); opacity: .82; margin: 0 0 14px; }
.rule a { color: var(--paper); }
.rule .mono { color: var(--paper); opacity: .6; }

/* FAQ */
.faq { border-top: 1px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative; font: 500 1.2rem/1.3 var(--serif); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 16px; font: 300 1.6rem var(--sans); color: var(--stamp); transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .ans { padding: 0 0 22px; color: var(--ink-2); max-width: 46em; }
.faq .ans p { margin: 0 0 10px; }

/* Footer */
.foot { border-top: 1px solid var(--rule); padding: 48px 0 40px; margin-top: 24px; font-size: .93rem; color: var(--ink-2); }
.foot .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .foot .cols { grid-template-columns: 1fr; gap: 24px; } }
.foot h4 { margin: 0 0 10px; font: 500 .75rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot .fine { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--ink-3); font-size: .86rem; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Legal / prose pages */
.prose-page { padding: 56px 0 24px; }
.prose { max-width: 42em; }
.prose h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 10px; }
.prose h2 { font-size: 1.55rem; margin: 40px 0 10px; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 1.2em; }
.prose table { border-collapse: collapse; width: 100%; font-size: .94rem; margin: 12px 0; }
.prose th, .prose td { text-align: left; border-bottom: 1px solid var(--rule); padding: 10px 8px 10px 0; vertical-align: top; }
.prose th { font: 500 .75rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.updated { margin: 0 0 28px; }

/* Consent banner */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40; max-width: 560px; margin-left: auto; background: var(--card); color: var(--ink); border: 1px solid var(--rule); border-radius: 14px; padding: 18px; box-shadow: 0 20px 50px -20px rgba(0,0,0,.5); display: none; }
.consent.show { display: block; animation: deal .4s cubic-bezier(.2,.7,.1,1); }
.consent h2 { font-size: 1.15rem; margin-bottom: 6px; }
.consent p { margin: 0 0 14px; font-size: .92rem; color: var(--ink-2); }
.consent .row { display: flex; gap: 8px; flex-wrap: wrap; }
.consent .btn { padding: 10px 16px; min-height: 44px; font-size: .92rem; flex: 1 1 auto; justify-content: center; }
.consent .prefs { display: none; margin: 4px 0 14px; padding: 12px; border: 1px solid var(--rule); border-radius: 10px; font-size: .9rem; }
.consent .prefs.open { display: block; }
.consent .prefs label { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .line > span { transform: none; }
}

/* Mobile refinements: keep the result close to the paste box. */
.shelf .n { white-space: nowrap; }
@media (max-width: 900px) {
  .specimen { width: min(100%, 200px); }
  .hero:has(+ .result:not([hidden])) .specimen { display: none; }
}
@media (max-width: 720px) {
  .shelf li a { grid-template-columns: 52px minmax(0,1fr) 24px; }
}
