/* =========================================================
   Neuron Consult: design draft v2
   Calm, readable, red / white / black. 1200px container.
   ========================================================= */

@font-face { font-family: 'Inter'; src: url(../fonts/inter-latin.woff2) format('woff2'); font-weight: 400 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; src: url(../fonts/inter-latin-ext.woff2) format('woff2'); font-weight: 400 700; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --red: #cf1319;
  --red-hdr: #ad0f15;
  --red-deep: #8f0a0f;
  --ink: #141414;
  --ink-2: #3a3a3a;
  --ink-3: #5f5f5f;
  --line: #dcdcdc;
  --line-2: #bdbdbd;
  --paper: #ffffff;
  --sans: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --max: 1200px;
  --gut: 24px;
  --hdr: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
::selection { background: var(--red); color: #fff; }

.wrap { max-width: calc(var(--max) + 2 * var(--gut)); margin: 0 auto; padding: 0 var(--gut); }

/* ---------- icons ---------- */
.ic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
[id^="i-"] .a { stroke: var(--accent, var(--red)); }
[id^="i-"] .a[fill="currentColor"] { fill: var(--accent, var(--red)); }
.ic-mono { --accent: currentColor; }

/* ---------- type ---------- */
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--red); }
.meta { font-size: 14px; color: var(--ink-3); }
.lead { font-size: 18px; line-height: 1.55; color: var(--ink-2); max-width: 62ch; }

/* ---------- buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 46px; padding: 0 20px;
  border: 1.5px solid var(--red); background: var(--red); color: #fff; text-decoration: none; border-radius: 2px;
  font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn .ic { width: 20px; height: 20px; stroke-width: 2.1; --accent: currentColor; }
.btn:hover { background: var(--red-deep); border-color: var(--red-deep); }
.btn-ink { background: var(--ink); border-color: var(--ink); }
.btn-ink:hover { background: var(--red); border-color: var(--red); }
.btn-line { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-line:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-white { background: #fff; border-color: #fff; color: var(--ink); }
.btn-white:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14px; }

.more { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--red); text-decoration: none; white-space: nowrap; }
.more .ic { width: 20px; height: 20px; stroke-width: 2.1; --accent: currentColor; transition: transform .15s; }
.more:hover { text-decoration: underline; text-underline-offset: 3px; }
button.more { background: none; border: 0; padding: 0; cursor: pointer; }
.more:hover .ic { transform: translateX(3px); }

.tag {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 2px;
  font-size: 12px; font-weight: 600; letter-spacing: .03em; border: 1px solid currentColor; white-space: nowrap;
}
.tag .ic { width: 12px; height: 12px; stroke-width: 2.2; --accent: currentColor; }
.tag-red { color: var(--red); }
.tag-solid { background: var(--red); border-color: var(--red); color: #fff; }
.tag-ink { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- header (red) ---------- */
.hdr { position: sticky; top: 0; z-index: 50; background: var(--red-hdr); color: #fff; }
.hdr-in { height: var(--hdr); display: flex; align-items: center; gap: 36px; }
.logo { display: flex; align-items: center; flex: none; background: #fff; height: 100%; padding: 0 20px; margin-left: -20px; text-decoration: none; }
.logo img { height: 40px; width: auto; }
.nav { display: flex; gap: 26px; height: 100%; }
.nav a { position: relative; display: flex; align-items: center; text-decoration: none; font-size: 15px; font-weight: 500; color: #fff; }
.nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #fff; transform: scaleY(0); transform-origin: bottom; transition: transform .15s; }
.nav a:hover::after, .nav a[aria-current]::after { transform: scaleY(1); }
.nav a[aria-current] { font-weight: 600; }
.hdr-tools { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.langs { display: flex; gap: 8px; align-items: center; }
.flag { width: 26px; height: 18px; padding: 0; border: 1px solid rgba(255,255,255,.75); background: none; cursor: pointer; display: block; opacity: .75; transition: opacity .15s; }
.flag svg { width: 100%; height: 100%; display: block; }
.flag:hover, .flag[aria-pressed="true"] { opacity: 1; }
.flag[aria-pressed="true"] { outline: 2px solid #fff; outline-offset: 2px; }
.tool { position: relative; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; background: none; border: 0; padding: 0; font-size: 15px; font-weight: 500; color: #fff; cursor: pointer; }
.tool .ic { width: 24px; height: 24px; --accent: currentColor; }
.tool:hover span { text-decoration: underline; text-underline-offset: 3px; }
.cart-count { position: absolute; top: -7px; right: -10px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #fff; color: var(--red-hdr); font: 700 11px/18px var(--sans); text-align: center; }
.tool:hover .cart-count { text-decoration: none; }
.menu-btn { display: none; }
.mnav { display: none; }

/* ---------- footer (calm, white) ---------- */
.ftr { border-top: 1px solid var(--ink); margin-top: 72px; }
.ftr-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; gap: 32px; padding-top: 40px; padding-bottom: 36px; font-size: 14.5px; line-height: 1.75; color: var(--ink-2); }
.ftr a { text-decoration: none; }
.ftr a:hover { color: var(--red); text-decoration: underline; }
.ftr h4 { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); margin-bottom: 10px; }
.ftr-brand img { height: 40px; width: auto; }
.ftr .motto { margin-top: 14px; font-weight: 600; color: var(--ink); }
.ftr-small { margin-top: 12px; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.ftr-base { border-top: 1px solid var(--line); }
.ftr-base .wrap { display: flex; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; font-size: 13px; color: var(--ink-3); }

/* ---------- breadcrumb & page head ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--ink-3); padding-top: 22px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--red); text-decoration: underline; }
.crumbs span[aria-hidden] { color: var(--line-2); }
.phead { padding: 12px 0 24px; border-bottom: 1px solid var(--line); margin-bottom: 28px; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.phead h1 { font-size: 36px; margin-bottom: 8px; }
.phead .lead { font-size: 17px; }

/* =========================================================
   HOME
   ========================================================= */
.hero { position: relative; margin-top: 12px; min-height: 290px; display: flex; align-items: center; color: #fff; overflow: hidden; background: #0e1a26; }
.hero .slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.1s ease; }
.hero .slide.is-on { opacity: 1; }
.hero-ctrl { position: absolute; z-index: 3; right: 12px; bottom: 12px; display: flex; gap: 4px; }
.hero-btn { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 2px; background: rgba(10,14,18,.4); color: #fff; cursor: pointer; transition: background .15s; }
.hero-btn:hover { background: rgba(10,14,18,.75); }
.hero-btn .ic { width: 22px; height: 22px; stroke-width: 2.8; --accent: currentColor; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(8,14,20,.84) 0%, rgba(8,14,20,.6) 48%, rgba(8,14,20,0) 82%); }
.hero-in { position: relative; z-index: 2; padding: 34px 44px; max-width: 620px; }
.hero .eyebrow { color: #fff; opacity: .85; margin-bottom: 12px; }
.hero h1 { font-size: 34px; line-height: 1.15; margin-bottom: 12px; }
.hero p { font-size: 16.5px; line-height: 1.55; opacity: .92; margin-bottom: 22px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; margin-top: 40px; }
.split > section { min-width: 0; }
.sec-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); margin-bottom: 16px; }
.sec-hd h2 { font-size: 22px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 10px; border: 1px solid var(--line-2); border-radius: 2px;
  text-decoration: none; font-size: 14.5px; font-weight: 500; background: #fff; cursor: pointer;
}
.chip .ic { width: 22px; height: 22px; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; --accent: #fff; }
.chip .n { color: var(--ink-3); font-size: 13px; }
.chip[aria-pressed="true"] .n { color: #bdbdbd; }

/* project cards (home + projects page) */
.pgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 18px; }
.pgrid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pcard { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; }
.pcard .ph { aspect-ratio: 3 / 2; overflow: hidden; background: #e9e9e9; }
.pcard .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.pcard:hover .ph img { transform: scale(1.04); }
.pcard h3 { font-size: 15.5px; font-weight: 600; line-height: 1.35; letter-spacing: -0.005em; }
.pcard:hover h3 { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.pcard .meta { font-size: 13.5px; margin-top: 3px; }
.pcard .sub { font-size: 14px; color: var(--ink-2); line-height: 1.45; margin-top: 4px; }

/* shop entries on home */
.entries { display: flex; flex-direction: column; }
.entry { display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.entry > .ic { width: 40px; height: 40px; stroke-width: 1.4; }
.entry h3 { font-size: 16.5px; font-weight: 600; }
.entry p { font-size: 14.5px; color: var(--ink-3); line-height: 1.45; margin-top: 2px; }
.entry .go { width: 22px; height: 22px; color: var(--ink-3); --accent: currentColor; transition: transform .15s, color .15s; }
.entry:hover h3 { color: var(--red); }
.entry:hover .go { color: var(--red); transform: translateX(3px); }
.newbooks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 2px 0 18px; border-bottom: 1px solid var(--line); }
.nb { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: start; text-decoration: none; color: inherit; }
.nb img { width: 84px; height: auto; border: 1px solid var(--line-2); }
.nb .tag { margin-bottom: 8px; }
.nb h3 { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.nb .price { font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.nb:hover h3 { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }

/* =========================================================
   PROJECTS
   ========================================================= */
.filters { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.filters .chips { margin: 0; }
.filters-r { display: flex; align-items: center; gap: 14px; }
.select { height: 38px; padding: 0 34px 0 12px; border: 1px solid var(--line-2); border-radius: 2px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23141414' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center; appearance: none; font-size: 14.5px; cursor: pointer; }
.count { font-size: 14px; color: var(--ink-3); white-space: nowrap; }
.search { position: relative; display: flex; align-items: center; }
.search .ic { position: absolute; left: 10px; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; stroke-width: 2; }
.search input { height: 38px; width: 230px; padding: 0 12px 0 36px; border: 1px solid var(--line-2); border-radius: 2px; font-size: 14.5px; background: #fff; }
.search input:hover { border-color: var(--ink-3); }
.search input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 2px var(--red); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.empty .more { background: none; border: 0; padding: 0; margin-top: 8px; cursor: pointer; }
.empty { padding: 40px 0; color: var(--ink-3); }

.more-refs { margin-top: 56px; }
.more-refs h2 { font-size: 22px; margin-bottom: 14px; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); padding: 0 12px 10px 0; border-bottom: 2px solid var(--ink); }
.table td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }

/* project detail */
.pd { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 48px; }
.pd-head { padding: 12px 0 24px; }
.pd-head h1 { font-size: 34px; margin: 8px 0 6px; }
.pd-head .sub { font-size: 18px; color: var(--ink-2); }
.gallery .main { aspect-ratio: 3 / 2; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.gallery .main img { width: 100%; height: 100%; object-fit: contain; }
.gallery .thumbs { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.gallery .thumbs button { width: 96px; aspect-ratio: 3 / 2; padding: 0; border: 1px solid var(--line-2); background: #fff; cursor: pointer; overflow: hidden; }
.gallery .thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.gallery .thumbs button[aria-current="true"] { outline: 2px solid var(--red); outline-offset: 1px; }
.pd-body h2 { font-size: 20px; margin: 30px 0 10px; }
.pd-body p { font-size: 17px; line-height: 1.65; color: var(--ink-2); max-width: 68ch; }
.ticks li { position: relative; padding: 8px 0 8px 28px; font-size: 16px; color: var(--ink-2); border-bottom: 1px solid var(--line); line-height: 1.45; }
.ticks li::before { content: ''; position: absolute; left: 2px; top: 15px; width: 12px; height: 6px; border-left: 2px solid var(--red); border-bottom: 2px solid var(--red); transform: rotate(-45deg); }

.facts { border: 1px solid var(--ink); }
.facts-hd { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--ink); font-weight: 700; }
.facts-hd .ic { width: 28px; height: 28px; }
.facts dl { margin: 0; }
.facts .row { display: grid; grid-template-columns: 42% 1fr; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); font-size: 15px; }
.facts .row:last-child { border-bottom: 0; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 500; }
.facts .key dd { font-weight: 700; }
.pd-side { display: flex; flex-direction: column; gap: 18px; }
.pd-side .note { font-size: 14px; color: var(--ink-3); line-height: 1.5; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 48px; border-top: 1px solid var(--ink); }
.pager a { display: flex; flex-direction: column; gap: 4px; padding: 16px 0; text-decoration: none; }
.pager a.next { text-align: right; align-items: flex-end; }
.pager .meta { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.pager .meta .ic { width: 18px; height: 18px; --accent: currentColor; }
.pager b { font-weight: 600; font-size: 16px; }
.pager a:hover b { color: var(--red); }
.kbd { display: inline-block; min-width: 22px; padding: 0 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 3px; font-size: 12px; text-align: center; color: var(--ink-3); line-height: 18px; }

/* =========================================================
   SHOP
   ========================================================= */
.subnav { display: flex; gap: 8px; flex-wrap: wrap; }
.shop-sec { margin-top: 56px; scroll-margin-top: calc(var(--hdr) + 16px); }
.shop-sec:first-of-type { margin-top: 0; }

.feat { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 36px; }
.fb { display: grid; grid-template-columns: 150px 1fr; gap: 22px; padding: 22px; border: 1px solid var(--line-2); }
.fb img { width: 150px; border: 1px solid var(--line-2); }
.fb h3 { font-size: 19px; margin: 8px 0 4px; }
.fb h3 a { text-decoration: none; }
.fb h3 a:hover { color: var(--red); text-decoration: underline; }
.fb .by { font-size: 14.5px; color: var(--ink-3); }
.fb .desc { font-size: 14.5px; color: var(--ink-2); line-height: 1.5; margin: 10px 0 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fb .buy { display: flex; flex-wrap: wrap; gap: 8px; }

.bgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px 20px; }
.bcard { display: flex; flex-direction: column; gap: 10px; }
.bcard .cv { display: block; aspect-ratio: 144 / 213; border: 1px solid var(--line-2); overflow: hidden; background: #f2f2f2; }
.bcard .cv img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.bcard:hover .cv img { transform: scale(1.03); }
.bcard h3 { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.bcard h3 a { text-decoration: none; }
.bcard h3 a:hover { color: var(--red); text-decoration: underline; }
.bcard .meta { font-size: 13px; }
.bcard .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }
.bcard .price { font-weight: 600; font-size: 15px; }
.bcard .price.mem { font-weight: 500; font-size: 13.5px; color: var(--ink-3); }
.icon-btn { width: 38px; height: 38px; flex: none; display: inline-grid; place-items: center; border: 1.5px solid var(--red); background: var(--red); color: #fff; --accent: #fff; cursor: pointer; border-radius: 2px; }
.icon-btn .ic { width: 22px; height: 22px; }
.icon-btn:hover { background: var(--red-deep); border-color: var(--red-deep); }

/* membership block */
.member { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; align-items: start; }
.member-copy h2 { font-size: 26px; margin: 8px 0 12px; }
.member-copy p { color: var(--ink-2); font-size: 16.5px; }
.member-copy .ticks { margin: 16px 0 0; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--ink); margin-top: 32px; }
.plan { padding: 22px 20px; display: flex; flex-direction: column; gap: 6px; }
.plan + .plan { border-left: 1px solid var(--ink); }
.plan.hl { box-shadow: inset 0 4px 0 var(--red); }
.plan .top { display: flex; justify-content: space-between; align-items: flex-start; }
.plan .top > .ic { width: 36px; height: 36px; stroke-width: 1.4; }
.plan h3 { font-size: 18px; margin-top: 6px; }
.plan .pr { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.plan .pr small { font-size: 14px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.plan .yr { font-size: 13.5px; color: var(--ink-3); }
.plan ul { margin: 8px 0 18px; font-size: 14.5px; color: var(--ink-2); }
.plan li { padding: 5px 0 5px 22px; position: relative; line-height: 1.4; }
.plan li::before { content: ''; position: absolute; left: 1px; top: 11px; width: 10px; height: 5px; border-left: 2px solid var(--red); border-bottom: 2px solid var(--red); transform: rotate(-45deg); }
.plan .btn { margin-top: auto; }

/* ask-the-books demo */
.ask { border: 1px solid var(--ink); display: flex; flex-direction: column; }
.ask-hd { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--ink); }
.ask-hd > .ic { width: 28px; height: 28px; }
.ask-hd b { font-size: 16px; }
.ask-hd .tag { margin-left: auto; }
.ask-body { display: flex; flex-direction: column; gap: 14px; padding: 18px 16px; min-height: 250px; max-height: 420px; overflow: auto; }
.msg-q { align-self: flex-end; max-width: 85%; background: var(--ink); color: #fff; padding: 10px 14px; font-size: 15px; line-height: 1.45; }
.msg-a { max-width: 95%; border-left: 3px solid var(--red); padding: 2px 0 2px 14px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.cite { display: inline-flex; align-items: center; gap: 6px; margin: 8px 6px 0 0; padding: 3px 8px; border: 1px solid var(--red); color: var(--red); font-size: 12.5px; font-weight: 600; text-decoration: none; border-radius: 2px; }
.cite .ic { width: 15px; height: 15px; stroke-width: 2; --accent: currentColor; }
.typing { display: inline-flex; gap: 4px; padding: 8px 0 8px 14px; border-left: 3px solid var(--red); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
.ask-sugg { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 14px; }
.ask-sugg button { border: 1px solid var(--line-2); background: #fff; padding: 6px 10px; font-size: 13.5px; cursor: pointer; border-radius: 2px; text-align: left; line-height: 1.35; }
.ask-sugg button:hover { border-color: var(--ink); }
.ask-in { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--ink); padding: 0 6px 0 0; height: 52px; margin: 0; }
.ask-in input { flex: 1; height: 100%; border: 0; padding: 0 16px; font-size: 15px; background: none; min-width: 0; }
.ask-in input:focus { outline: none; }
.ask-in:focus-within { box-shadow: inset 0 0 0 2px var(--red); }
.ask-in button { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: var(--red); color: #fff; cursor: pointer; border-radius: 2px; }
.ask-in button:hover { background: var(--red-deep); }
.ask-in button .ic { width: 20px; height: 20px; --accent: currentColor; }
.ask-in [disabled] { opacity: .5; }
.ask-scope { font-size: 13px; color: var(--ink-3); margin-left: 4px; }
.ask-sugg .meta { font-size: 13px; align-self: center; margin-right: 2px; }
.ask-note { font-size: 12.5px; color: var(--ink-3); padding: 8px 16px; border-top: 1px solid var(--line); }
.ask-lg .ask-body { min-height: 340px; max-height: 480px; }

/* member-area screenshot in a minimal browser frame */
.shot { display: block; margin-top: 28px; border: 1px solid var(--ink); text-decoration: none; background: #fff; transition: transform .3s, box-shadow .3s; }
.shot:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.14); }
.shot-bar { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-bottom: 1px solid var(--ink); font-size: 12px; color: var(--ink-3); }
.shot-bar i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--line-2); }
.shot-bar span { margin-left: 8px; }
.shot img { width: 100%; height: auto; }
.shot-cap, .member-copy .shot-cap { margin-top: 8px; font-size: 13.5px; color: var(--ink-3); }

/* software */
.soft { display: grid; grid-template-columns: 64px 1fr auto; gap: 22px; align-items: center; padding: 22px 24px; border: 1px solid var(--line-2); }
.soft > .ic { width: 56px; height: 56px; stroke-width: 1.2; }
.soft h3 { font-size: 19px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.soft p { color: var(--ink-2); font-size: 15.5px; margin-top: 4px; max-width: 70ch; }

/* =========================================================
   BOOK DETAIL
   ========================================================= */
.bd { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 56px; align-items: start; padding-top: 16px; }
.bd-cover { position: sticky; top: calc(var(--hdr) + 24px); }
.bd-cover img { width: 100%; border: 1px solid var(--line-2); }
.bd h1 { font-size: 32px; margin: 10px 0 6px; }
.bd .sub { font-size: 17px; color: var(--ink-2); font-style: italic; margin-bottom: 6px; }
.bd .by { font-size: 16px; color: var(--ink-3); }
.formats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 26px 0 18px; }
.fmt { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1.5px solid var(--line-2); cursor: pointer; border-radius: 2px; }
.fmt input { position: absolute; opacity: 0; pointer-events: none; }
.fmt b { font-size: 15px; }
.fmt .p { font-size: 22px; font-weight: 700; }
.fmt small { font-size: 13px; color: var(--ink-3); line-height: 1.35; }
.fmt:hover { border-color: var(--ink); }
.fmt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 4px 0 var(--red); }
.fmt:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; }
.buyrow { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; height: 46px; border: 1.5px solid var(--ink); border-radius: 2px; }
.qty button { width: 40px; height: 100%; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.qty button .ic { width: 18px; height: 18px; }
.qty output { min-width: 28px; text-align: center; font-weight: 600; }
.added { display: none; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; }
.added .ic { color: var(--red); --accent: currentColor; }
.added a { color: var(--red); font-weight: 600; }
.added.show { display: inline-flex; }
.specs { margin: 30px 0 0; border-top: 2px solid var(--ink); }
.specs .row { display: grid; grid-template-columns: 160px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.specs dt { color: var(--ink-3); }
.specs dd { margin: 0; }
.bd-desc { margin-top: 28px; font-size: 17px; line-height: 1.65; color: var(--ink-2); max-width: 66ch; }
.aibox { margin-top: 28px; display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 18px 20px; border: 1px solid var(--ink); }
.aibox > .ic { width: 40px; height: 40px; stroke-width: 1.4; }
.aibox h3 { font-size: 17px; margin-bottom: 4px; }
.aibox p { font-size: 15px; color: var(--ink-2); margin-bottom: 8px; }
.related { margin-top: 56px; }
.related h2 { font-size: 22px; margin-bottom: 18px; }

/* =========================================================
   CART
   ========================================================= */
.cart { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 48px; align-items: start; }
.citem { display: grid; grid-template-columns: 72px 1fr auto auto; gap: 18px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.citem:first-child { border-top: 2px solid var(--ink); }
.citem img { width: 72px; border: 1px solid var(--line-2); }
.citem h3 { font-size: 16px; font-weight: 600; }
.citem h3 a { text-decoration: none; }
.citem h3 a:hover { color: var(--red); }
.citem .meta { font-size: 14px; }
.citem .qty { height: 38px; }
.citem .qty button { width: 32px; }
.citem .sum { font-weight: 600; min-width: 70px; text-align: right; }
.rm { background: none; border: 0; padding: 0; font-size: 13.5px; color: var(--ink-3); text-decoration: underline; cursor: pointer; margin-top: 4px; }
.rm:hover { color: var(--red); }
.summary { border: 1px solid var(--ink); padding: 22px; position: sticky; top: calc(var(--hdr) + 20px); }
.summary h2 { font-size: 18px; margin-bottom: 14px; }
.summary .row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 15px; border-bottom: 1px solid var(--line); }
.summary .total { font-weight: 700; font-size: 18px; border-bottom: 0; padding-top: 14px; }
.summary .btn { width: 100%; margin-top: 16px; }
.summary .note { font-size: 13px; color: var(--ink-3); margin-top: 12px; line-height: 1.5; }
.upsell { display: grid; grid-template-columns: 40px 1fr; gap: 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); text-decoration: none; }
.upsell > .ic { width: 36px; height: 36px; stroke-width: 1.4; }
.upsell b { color: var(--ink); display: block; }
.upsell:hover b { color: var(--red); }
.cart-empty { padding: 48px 0; border-top: 2px solid var(--ink); }
.cart-empty p { color: var(--ink-3); margin: 8px 0 20px; }
.demo-note { display: none; margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--red); font-size: 14px; }
.demo-note.show { display: block; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .hdr-in { gap: 24px; }
  .nav { gap: 18px; }
  .nav a { font-size: 14.5px; }
  .tool span:not(.cart-count):not(.sr) { display: none; }
  .bgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pgrid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .feat { grid-template-columns: 1fr; }
  .member { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  :root { --hdr: 60px; --gut: 16px; }
  .nav, .hdr-tools > .langs { display: none; }
  .menu-btn { display: inline-flex; }
  .logo { padding: 0 14px; margin-left: -16px; }
  .logo img { height: 32px; }
  .mnav:not([hidden]) {
    display: flex; flex-direction: column; justify-content: space-between; position: fixed; left: 0; right: 0; top: var(--hdr); bottom: 0;
    background: #fff; color: var(--ink); padding: 8px var(--gut) 28px; z-index: 60; overflow: auto;
  }
  .mnav nav { display: flex; flex-direction: column; }
  .mnav nav a { text-decoration: none; font-size: 22px; font-weight: 600; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .mnav nav a[aria-current] { color: var(--red); }
  .mnav-login { display: flex; gap: 10px; align-items: center; margin-top: 20px; font-size: 17px; font-weight: 600; text-decoration: none; }
  .mnav .langs { gap: 14px; margin-top: 20px; }
  .mnav .flag { width: 36px; height: 24px; border-color: var(--ink); opacity: 1; }
  .mnav .flag[aria-pressed="true"] { outline-color: var(--red); }
  body.menu-open { overflow: hidden; }

  .hero { margin: 0 calc(-1 * var(--gut)); min-height: 0; }
  .hero-in { padding: 32px var(--gut); }
  .hero::before { background: rgba(8,14,20,.66); }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 16px; }
  .split { grid-template-columns: 1fr; gap: 40px; margin-top: 32px; }
  .pgrid, .pgrid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
  .pd { grid-template-columns: 1fr; gap: 32px; }
  .bd { grid-template-columns: 1fr; gap: 28px; }
  .bd-cover { max-width: 240px; }
  .cart { grid-template-columns: 1fr; }
  .summary { position: static; }
  .bgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plans { grid-template-columns: 1fr; }
  .plan + .plan { border-left: 0; border-top: 1px solid var(--ink); }
  .ftr-in { grid-template-columns: 1fr 1fr; }
  .ftr-brand { grid-column: 1 / -1; }
  .ftr-base .wrap { flex-direction: column; gap: 4px; }
}
@media (max-width: 560px) {
  .phead h1, .pd-head h1 { font-size: 28px; }
  .newbooks { grid-template-columns: 1fr; }
  .fb { grid-template-columns: 96px 1fr; padding: 16px; gap: 16px; }
  .fb img { width: 96px; }
  .bgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .formats { grid-template-columns: 1fr; }
  .soft { grid-template-columns: 48px 1fr; }
  .soft > .ic { width: 44px; height: 44px; }
  .soft .btn { grid-column: 1 / -1; }
  .citem { grid-template-columns: 56px 1fr; }
  .citem img { width: 56px; }
  .citem .qty, .citem .sum { grid-column: 2; justify-self: start; }
  .ftr-in { grid-template-columns: 1fr; }
  .tool:not(.menu-btn):not(.tool-cart) { display: none; }
  .table .hide-s { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }


/* =========================================================
   v3 additions: drawer, membership page, login, 404
   ========================================================= */

/* cart drawer */
.drawer { position: fixed; inset: 0; z-index: 100; visibility: hidden; }
.drawer.open { visibility: visible; }
.scrim { position: absolute; inset: 0; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .25s; }
.drawer.open .scrim { opacity: 1; }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: #fff; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.2,.7,.2,1); border-left: 1px solid var(--ink); }
.drawer.open .drawer-panel { transform: none; }
.drawer-hd { display: flex; align-items: center; justify-content: space-between; height: var(--hdr); padding: 0 20px; background: var(--red-hdr); color: #fff; flex: none; }
.drawer-hd h2 { font-size: 18px; }
.drawer-x { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; color: #fff; cursor: pointer; margin-right: -8px; }
.drawer-x .ic { --accent: currentColor; }
.drawer-note { display: flex; align-items: center; gap: 8px; margin: 16px 20px 0; padding: 10px 12px; border-left: 3px solid var(--red); font-size: 14.5px; font-weight: 500; }
.drawer-note .ic { width: 20px; height: 20px; color: var(--red); --accent: currentColor; }
.drawer-body { flex: 1; overflow: auto; padding: 8px 20px; }
.drawer-foot { flex: none; padding: 16px 20px 20px; border-top: 1px solid var(--ink); display: flex; flex-direction: column; gap: 10px; }
.drawer-foot:empty { display: none; }
.drawer-foot .row { display: flex; justify-content: space-between; font-size: 16px; }
.drawer-foot .meta { font-size: 13.5px; margin-top: -4px; }
.drawer-foot .btn { width: 100%; }
.drawer-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 32px 0; color: var(--ink-3); }
.drawer-empty .ic-lg { width: 44px; height: 44px; stroke-width: 1.3; color: var(--ink); }
body.drawer-on { overflow: hidden; }
.citem-s { grid-template-columns: 56px 1fr auto; gap: 8px 14px; padding: 16px 0; }
.citem-s:first-child { border-top: 0; }
.citem-s img, .citem-s .cicon { width: 56px; grid-row: span 2; align-self: start; }
.citem-s h3 { font-size: 14.5px; line-height: 1.35; }
.citem-s .meta { font-size: 13px; }
.citem-s .qty { grid-column: 2; height: 34px; justify-self: start; }
.citem-s .qty button { width: 30px; }
.citem-s > span:empty { display: none; }
.citem-s .sum { grid-column: 3; grid-row: 1; align-self: start; font-size: 14.5px; }
.cicon { display: grid; place-items: center; width: 72px; aspect-ratio: 144 / 213; border: 1px solid var(--line-2); }
.cicon .ic { width: 32px; height: 32px; stroke-width: 1.4; }

/* membership page */
.mp-cta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 20px; }
.mp-main { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 40px; align-items: start; }
.steps { counter-reset: s; display: flex; flex-direction: column; }
.steps li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.steps li:first-child { padding-top: 0; }
.steps .ic { width: 40px; height: 40px; stroke-width: 1.4; }
.steps h3 { font-size: 16.5px; margin-bottom: 2px; }
.steps h3::before { counter-increment: s; content: counter(s) '. '; color: var(--red); }
.steps p { font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.lib-strip { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; }
.lib-strip a { display: block; aspect-ratio: 144 / 213; border: 1px solid var(--line-2); overflow: hidden; }
.lib-strip img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.lib-strip a:hover img { transform: scale(1.05); }
.faq { border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; font-weight: 600; font-size: 16.5px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { width: 20px; height: 20px; transition: transform .2s; }
.faq details[open] summary .ic { transform: rotate(45deg); }
.faq summary:hover { color: var(--red); }
.faq details p { padding: 0 0 18px; color: var(--ink-2); max-width: 70ch; }
.mp-sec { margin-top: 56px; }

/* login */
.login { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; border: 1px solid var(--ink); margin-top: 8px; }
.login-form { padding: 40px; }
.login-form h1 { font-size: 30px; margin-bottom: 6px; }
.login-form .lead { font-size: 16px; margin-bottom: 26px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 14.5px; font-weight: 600; }
.field input { height: 46px; padding: 0 14px; border: 1.5px solid var(--line-2); border-radius: 2px; font-size: 16px; background: #fff; }
.field input:hover { border-color: var(--ink-3); }
.field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 2px var(--red); }
.field-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 22px; font-size: 14.5px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--red); margin: 0; }
.field-row a { color: var(--red); font-weight: 500; }
.login-form .btn { width: 100%; }
.login-form .note { margin-top: 16px; font-size: 14px; color: var(--ink-3); }
.login-side { border-left: 1px solid var(--ink); padding: 40px; display: flex; flex-direction: column; gap: 14px; }
.login-side > .ic { width: 48px; height: 48px; stroke-width: 1.3; }
.login-side h2 { font-size: 22px; }
.login-side p { color: var(--ink-2); }
.login-side .covers { display: flex; gap: 10px; margin: 8px 0; }
.login-side .covers img { width: 72px; border: 1px solid var(--line-2); }
.login-side .btn { align-self: flex-start; margin-top: auto; }

/* 404 */
.nf { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: center; padding: 48px 0 16px; }
.nf-art { width: 100%; height: auto; }
.nf .code { font-size: 15px; font-weight: 600; color: var(--red); letter-spacing: .06em; }
.nf h1 { font-size: 36px; margin: 8px 0 12px; }
.nf p { font-size: 17px; color: var(--ink-2); max-width: 52ch; }
.nf-links { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin-top: 22px; border-top: 2px solid var(--ink); }
.nf-links a { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.nf-links a .ic { width: 30px; height: 30px; }
.nf-links a:hover { color: var(--red); }

@media (max-width: 960px) {
  .bd-cover { position: static; max-width: 280px; }
  .mp-main { grid-template-columns: 1fr; }
  .lib-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .login { grid-template-columns: 1fr; }
  .login-side { border-left: 0; border-top: 1px solid var(--ink); }
  .login-form, .login-side { padding: 28px 20px; }
  .nf { grid-template-columns: 1fr; gap: 24px; padding-top: 24px; }
  .nf-art { max-width: 320px; }
}
@media (max-width: 560px) {
  .nf-links { grid-template-columns: 1fr; }
  .nf h1 { font-size: 28px; }
  .ask-scope { display: none; }
  .filters-r { width: 100%; flex-wrap: wrap; }
  .search { flex: 1; }
  .search input { width: 100%; }
}


/* =========================================================
   Draft preview switcher (not part of the final site)
   ========================================================= */
.pv { position: fixed; left: 16px; bottom: 16px; z-index: 90; font-size: 14px; }
.pv-toggle { width: 44px; height: 44px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 50%; background: #fff; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.15); padding: 0; }
.pv-toggle .ic { width: 24px; height: 24px; }
.pv-toggle:hover { border-color: var(--red); }
.pv-panel { position: absolute; left: 0; bottom: 54px; width: 280px; background: #fff; border: 1px solid var(--ink); box-shadow: 0 6px 24px rgba(0,0,0,.14); }
.pv-hd { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--ink); font-weight: 700; }
.pv-hd small { font-weight: 500; color: var(--ink-3); font-size: 12px; }
.pv-group { padding: 12px 14px 14px; }
.pv-group + .pv-group { border-top: 1px solid var(--line); }
.pv-label { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.pv-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--ink); border-radius: 2px; overflow: hidden; }
.pv-seg button { height: 34px; border: 0; background: #fff; cursor: pointer; font-size: 13.5px; font-weight: 500; padding: 0; }
.pv-seg button + button { border-left: 1px solid var(--ink); }
.pv-seg button:hover { background: #f3f3f3; }
.pv-seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.pv-reset { display: block; width: 100%; padding: 10px 14px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font-size: 13px; color: var(--ink-3); cursor: pointer; text-decoration: underline; }
.pv-reset:hover { color: var(--red); }
@media print { .pv { display: none; } }

/* =========================================================
   Chat: writing-out effect (public widget + member area)
   ========================================================= */
.ask-chat { display: flex; flex-direction: column; }
.msg-a .caret { display: inline-block; width: .5em; height: 1.05em; margin-left: 2px; vertical-align: -.18em; background: var(--red); animation: caret .9s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.cite.fade-in { animation: fadeUp .35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } }
.chat-empty { display: flex; gap: 14px; align-items: center; margin: auto 0; color: var(--ink-3); font-size: 15px; line-height: 1.5; }
.chat-empty .ic { width: 40px; height: 40px; flex: none; stroke-width: 1.4; color: var(--ink); }
