/* invertdb.com, from the "InvertDB landing page" design canvas (design_handoff_invertdb/). */

:root {
  --paper: #F4F1E8;
  --card: #FBF9F2;
  --ink: #1D1D1B;
  --mint: #C6EAE2;
  --teal: #1F5F57;
  --orange: #EF6A23;
  --yellow: #F2CF1D;
  --blue: #5AAFDA;
  --navy: #2B5FB4;
  --red: #B3261E;
  --rule: #CFC6AC;
  --lcd: #C8D0B5;
  --lcd-ink: #22261F;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --cond: 'IBM Plex Sans Condensed', 'IBM Plex Sans', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --wrap: 1200px;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.6; }
a { color: var(--ink); }
a:hover { color: var(--red); }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header band */
.site-header { position: relative; padding: 18px max(24px, calc(50% - 576px)); display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; background: var(--teal); color: var(--paper); border-bottom: 2px solid var(--ink); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--paper); }
.brand:hover { color: var(--paper); }
.brand-mark { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border: 2px solid var(--paper); font-family: var(--cond); font-weight: 700; font-size: 24px; line-height: 1; }
.brand-word { font-family: var(--cond); font-weight: 700; font-size: 24px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 8px 28px; font-family: var(--cond); font-weight: 600; font-size: 16px; }
.site-nav a { text-decoration: none; color: var(--paper); }
.site-nav a:hover { color: var(--yellow); }
.site-nav a[aria-current='page'] { text-decoration: underline; text-underline-offset: 4px; }

/* hero */
.hero { position: relative; overflow: hidden; background: var(--mint); border-bottom: 2px solid var(--ink); }
.hero-grid { position: relative; max-width: var(--wrap); margin: 0 auto; padding: 56px 24px 88px; display: flex; flex-wrap: wrap; gap: 64px; align-items: flex-start; }
.hero-copy { flex: 1 1 440px; min-width: 0; }
.hero-title { margin: 0; font-family: var(--cond); font-weight: 700; font-size: clamp(64px, 9vw, 120px); line-height: 0.9; letter-spacing: -0.03em; color: var(--teal); }
.hero-lede { margin: 28px 0 0; font-size: 20px; max-width: 28em; }
.hero-points { margin: 32px 0 0; padding: 0; list-style: none; max-width: 32em; border-top: 1.5px solid var(--ink); }
.hero-points li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ink); }
.hero-points li::before { content: ''; width: 10px; height: 10px; margin-top: 8px; background: var(--orange); border: 1.5px solid var(--ink); }
.hero-art { position: relative; flex: 1 1 520px; min-width: 0; margin: 0; display: flex; justify-content: center; align-self: center; }
.prism-svg { max-width: 100%; height: auto; overflow: hidden; }

/* sign-up */
.signup { margin-top: 36px; max-width: 520px; display: flex; flex-direction: column; gap: 10px; }
.signup-label { font-family: var(--mono); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; text-wrap: balance; }
.signup-row { display: flex; gap: 10px; flex-wrap: wrap; }
.signup input[type='email'] { flex: 1 1 240px; min-height: 48px; padding: 0 14px; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--card); font-family: var(--mono); font-size: 15px; color: var(--ink); }
.btn { min-height: 48px; padding: 0 22px; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--orange); color: var(--ink); font-family: var(--cond); font-weight: 700; font-size: 17px; cursor: pointer; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.signup fieldset { border: 0; margin: 0; padding: 0; display: flex; gap: 4px 20px; flex-wrap: wrap; align-items: center; }
.signup legend { float: left; margin-right: 8px; font-size: 14px; }
.signup fieldset label { display: flex; align-items: center; gap: 6px; font-size: 14px; min-height: 32px; }
.signup input[type='radio'] { accent-color: var(--ink); }
.signup-status { margin: 0; padding: 12px 16px; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--card); font-family: var(--mono); font-size: 14px; }
.signup-status[hidden] { display: none; }
.signup-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* how it works */
.how { border-bottom: 2px solid var(--ink); background: var(--yellow); }
.how-grid { max-width: var(--wrap); margin: 0 auto; padding: 80px 24px; display: flex; flex-wrap: wrap; gap: 56px 72px; align-items: flex-start; }
.calc-fig { position: relative; flex: 0 1 440px; min-width: 0; margin: 0 0 0 72px; }
.calc { position: relative; width: 440px; max-width: 100%; padding: 18px; border: 2px solid var(--ink); border-radius: 20px; background: var(--card); }
.callout { position: absolute; left: -72px; display: flex; align-items: center; }
.callout span:first-child { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--paper); font-family: var(--mono); font-size: 12px; font-weight: 600; }
.callout span:last-child { width: 48px; border-top: 1.5px solid var(--ink); }
.calc-brand { display: flex; justify-content: space-between; align-items: baseline; margin: 0 2px 10px; }
.calc-brand b { font-family: var(--cond); font-weight: 700; font-size: 15px; }
.calc-brand i { font-family: var(--cond); font-style: italic; font-size: 14px; }
.calc-bezel { background: var(--ink); border-radius: 8px; padding: 12px; }
.lcd { background: var(--lcd); color: var(--lcd-ink); border-radius: 3px; padding: 10px 12px; height: 340px; display: flex; flex-direction: column; gap: 8px; font-family: var(--mono); font-size: 13px; line-height: 1.4; overflow: hidden; }
.lcd-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; border-bottom: 1.5px solid var(--lcd-ink); padding-bottom: 4px; font-size: 12px; }
.lcd-top b { font-weight: 700; }
.lcd-steps { display: flex; gap: 4px; }
.lcd-steps span { padding: 0 4px; }
.lcd-steps span.on { background: var(--lcd-ink); color: var(--lcd); }
.lcd-screen { flex: 1; min-height: 0; overflow: auto; }
.lcd-hint { margin: 0; font-size: 11px; border-top: 1px solid var(--lcd-ink); padding-top: 4px; }
.lcd-in { animation: lcdIn .5s steps(6); }
@keyframes lcdIn { from { opacity: 0; clip-path: inset(0 0 100% 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
.sweep { animation: sweep 2.6s linear infinite; }
@keyframes sweep { from { left: -2%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .lcd-in, .sweep { animation: none; } }
.lcd .row-src { display: grid; grid-template-columns: 26px minmax(0, 1fr) 30px; gap: 8px; padding: 1px 0; }
.lcd .row-src b { font-weight: 700; }
.lcd .row-src span:last-child { text-align: right; }
.lcd .row-units { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 2px 0; }
.lcd .row-units b { font-weight: 700; width: 24px; }
.lcd .chip { border: 1.5px solid var(--lcd-ink); border-radius: 3px; padding: 0 4px; }
.lcd .query { border: 1.5px solid var(--lcd-ink); padding: 6px 8px; margin-bottom: 8px; }
.lcd .pre { white-space: pre; }
.lcd .res-head, .lcd .res-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 2px 4px; }
.lcd .res-head { padding: 1px 4px; background: var(--lcd-ink); color: var(--lcd); font-weight: 700; }
.lcd .res-row { border-bottom: 1px solid var(--lcd-ink); }
.lcd .chart { display: flex; align-items: flex-end; justify-content: space-around; height: 130px; border-bottom: 1.5px solid var(--lcd-ink); border-left: 1.5px solid var(--lcd-ink); padding: 0 12px; }
.lcd .chart-bar { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 44px; }
.lcd .chart-bar span { font-size: 11px; }
.lcd .chart-labels { display: flex; justify-content: space-around; padding: 2px 12px 0 14px; font-size: 11px; }
.lcd .chart-labels span { width: 44px; text-align: center; }
.keys-label { margin: 16px 2px 6px; font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: 0.1em; }
.keys-label.q { margin-top: 12px; }
.keys { display: grid; gap: 8px; }
.keys.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.keys.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.keys.k4 { margin-top: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.key { min-height: 44px; border: 1.5px solid var(--ink); border-radius: 5px; cursor: pointer; font-weight: 700; color: var(--ink); background: var(--card); box-shadow: 0 2px 0 var(--ink); }
.key.src { font-family: var(--cond); font-size: 16px; }
.key.para { font-family: var(--mono); font-size: 12px; background: var(--blue); }
.key.back { font-size: 18px; }
.key.run { grid-column: span 3; background: var(--orange); font-family: var(--cond); font-size: 17px; }
.key[aria-pressed='true'] { background: var(--ink); color: var(--card); transform: translateY(2px); box-shadow: none; }
.how-copy { flex: 1 1 340px; min-width: 0; max-width: 520px; }
.how-copy h2, .oss h2 { margin: 0; font-family: var(--cond); font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; }
.how-copy h2 { font-size: clamp(32px, 3.6vw, 44px); }
.how-copy > p { margin: 16px 0 0; font-size: 18px; }
.parts { margin-top: 28px; border: 1.5px solid var(--ink); padding: 16px 18px; background: var(--paper); }
.parts > p { margin: 0 0 10px; font-family: var(--cond); font-weight: 700; font-size: 15px; }
.parts ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 20px; font-size: 14px; line-height: 1.4; }
.parts li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; }
.num { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border: 1.5px solid var(--ink); border-radius: 50%; font-family: var(--mono); font-size: 11px; font-weight: 600; }

/* open source */
.oss-inner { max-width: var(--wrap); margin: 0 auto; padding: 88px 24px; }
.oss h2 { font-size: clamp(36px, 4.4vw, 54px); line-height: 1; }
.oss-lede { margin: 16px 0 36px; font-size: 18px; max-width: 38em; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-product { border: 1.5px dashed var(--ink); padding: 14px 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; align-items: baseline; }
.stack-product b { font-family: var(--mono); font-weight: 600; font-size: 17px; }
.stack-product span { font-size: 15px; }
.crate { border: 1.5px solid var(--ink); background: var(--card); display: flex; align-items: stretch; }
.crate-bar { flex: 0 0 12px; border-right: 1.5px solid var(--ink); }
.crate-body { flex: 1; min-width: 0; padding: 16px 20px; display: flex; flex-wrap: wrap; gap: 8px 32px; align-items: baseline; }
.crate h3 { margin: 0; font-family: var(--mono); font-size: 17px; font-weight: 600; }
.crate-body h3 { flex: 0 0 220px; }
.crate-body > p { flex: 1 1 320px; margin: 0; font-size: 15px; }
.crate p.links { flex: 0 0 auto; margin: 0; display: flex; flex-wrap: wrap; gap: 16px; font-family: var(--mono); font-size: 13px; }
.storage { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.storage .crate { flex-direction: column; }
.storage .crate-bar { flex: 0 0 10px; height: 10px; border-right: 0; border-bottom: 1.5px solid var(--ink); }
.storage .crate-body { flex-direction: column; flex-wrap: nowrap; gap: 8px; align-items: stretch; }
.storage .crate-body > p, .storage .crate-body h3 { flex: none; }
.storage .crate p.links { margin-top: auto; }
.crate-bar[data-color='orange'] { background: var(--orange); }
.crate-bar[data-color='yellow'] { background: var(--yellow); }
.crate-bar[data-color='blue'] { background: var(--blue); }

/* footer */
.site-footer { border-top: 2px solid var(--ink); background: var(--navy); color: var(--paper); }
.site-footer .wrap { padding-top: 32px; padding-bottom: 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; font-family: var(--mono); font-size: 13px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 24px; }
.site-footer a { color: var(--paper); }
.site-footer a:hover { color: var(--yellow); }

/* bulletins: index */
.page-hero { position: relative; overflow: hidden; background: var(--mint); border-bottom: 2px solid var(--ink); }
.page-hero-art { position: absolute; top: 84px; left: calc(50% + 200px); pointer-events: none; }
.page-hero-art .prism-svg { width: 400px; height: 270px; }
.page-hero-inner { position: relative; max-width: var(--wrap); margin: 0 auto; padding: 56px 24px 80px; }
.page-hero h1 { margin: 0; font-family: var(--cond); font-weight: 700; font-size: clamp(56px, 8vw, 104px); line-height: 0.92; letter-spacing: -0.03em; color: var(--teal); }
.page-hero-lede { margin: 20px 0 0; font-size: 19px; max-width: 32em; }
.bulletins { max-width: var(--wrap); margin: 0 auto; padding: 64px 24px 96px; line-height: 1.55; }
.feature { display: flex; flex-wrap: wrap; text-decoration: none; color: var(--ink); border: 1.5px solid var(--ink); background: var(--card); margin-bottom: 48px; }
.feature:hover { color: var(--ink); }
.feature:hover h2 { text-decoration: underline; text-underline-offset: 6px; }
.feature-copy { flex: 1 1 380px; min-width: 0; padding: 32px; border-right: 1.5px solid var(--ink); display: flex; flex-direction: column; gap: 14px; }
.tag { align-self: flex-start; border: 1.5px solid var(--ink); border-radius: 4px; padding: 3px 10px; font-family: var(--cond); font-weight: 700; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }
.feature h2 { margin: 0; font-family: var(--cond); font-style: italic; font-weight: 400; font-size: 44px; line-height: 1.02; }
.feature-copy > p { margin: 0; font-size: 17px; }
.feature-copy p.meta { margin-top: auto; font-family: var(--mono); font-size: 13px; }
.feature-art { flex: 1 1 380px; min-width: 0; padding: 28px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.mini-lcd { background: #A9B29A; color: var(--lcd-ink); border-radius: 4px; padding: 14px 16px; font-family: var(--mono); font-size: 14px; line-height: 1.6; box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.35); }
.mini-lcd-top { border-bottom: 1.5px solid var(--lcd-ink); padding-bottom: 4px; margin-bottom: 6px; display: flex; justify-content: space-between; font-weight: 600; }
.mini-lcd-row { display: grid; grid-template-columns: 80px 1fr; }
.mini-lcd-row.on { background: var(--lcd-ink); color: #A9B29A; font-weight: 600; }
.mini-keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mini-keys span { min-height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: #F1EBD6; font-family: var(--cond); font-weight: 700; font-size: 14px; border: 1.5px solid var(--ink); }
.mini-keys span.wide { grid-column: span 2; }
.mini-keys span.blue { background: var(--blue); }
.mini-keys span.orange { background: var(--orange); }
.bl-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 130px; gap: 16px; }
.bl-head { padding: 10px 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); font-family: var(--cond); font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; }
.bl-head span:last-child, .bl-date { text-align: right; }
.bl-list { list-style: none; margin: 0; padding: 0; border-bottom: 2px solid var(--ink); }
.bl-list li { border-bottom: 1px solid var(--rule); }
.bl-list li:last-child { border-bottom: 0; }
.bl-list a { padding: 22px 0; text-decoration: none; align-items: baseline; }
.bl-list a:hover .bl-title { text-decoration: underline; text-underline-offset: 5px; }
.bl-no { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; min-height: 30px; border-radius: 5px; font-family: var(--cond); font-weight: 700; font-size: 14px; border: 1.5px solid var(--ink); }
.bl-kind { display: block; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.bl-title { font-family: var(--cond); font-style: italic; font-size: 28px; line-height: 1.15; }
.bl-date { font-family: var(--mono); font-size: 13px; }
@media (max-width: 760px) {
  .bl-row { grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; }
  .bl-row > span:last-child { grid-column: 2; text-align: left; }
  .bl-head { display: none; }
  .callout { display: none; }
  .calc-fig { margin-left: 0; }
  .feature-copy { border-right: 0; border-bottom: 1.5px solid var(--ink); }
}
@media (max-width: 980px) { .page-hero-art { display: none; } }

/* bulletin and plain pages */
.article { max-width: 760px; margin: 0 auto; padding: 56px 24px 96px; font-size: 18px; line-height: 1.65; }
.article h2 { margin: 2em 0 0.4em; font-family: var(--cond); font-weight: 700; font-size: 30px; line-height: 1.1; }
.article h3 { margin: 1.6em 0 0.3em; font-family: var(--cond); font-weight: 700; font-size: 22px; }
.article code { font-family: var(--mono); font-size: 0.88em; background: var(--card); border: 1px solid var(--rule); border-radius: 3px; padding: 0 4px; }
.article pre { background: var(--ink); color: var(--paper); padding: 16px 18px; border-radius: 6px; overflow-x: auto; font-size: 14px; line-height: 1.5; }
.article pre code { background: none; border: 0; padding: 0; color: inherit; }
.article li { margin: 0.3em 0; }
.article form { margin-top: 1em; }
.post-meta { margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-family: var(--mono); font-size: 13px; }
.post-meta .tag { background: var(--card); }
.page-hero h1.post-title { font-style: italic; font-weight: 400; font-size: clamp(40px, 6vw, 72px); line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.stub-note { border: 1.5px solid var(--ink); background: var(--yellow); padding: 14px 18px; font-family: var(--mono); font-size: 14px; line-height: 1.5; }
.back-link { margin-top: 48px; font-family: var(--mono); font-size: 14px; }
.signup [hidden] { display: none !important; }
/* keep long titles clear of the prism, which starts at 50% + 200px */
.page-hero h1.post-title, .page-hero .page-hero-lede { max-width: min(100%, calc(50vw + 200px - max(24px, 50vw - 576px) - 32px)); }
