/* ==========================================================================
   BiMSolutions v3 theme: "drawing sheet"
   Loaded after the page's own styles and brand-refresh.css. Only restyles;
   markup hooks (login, TH/EN, theme toggle, Supabase) are unchanged.
   Palette: drawing-ink navy + logo orange. Type: Athiti throughout.
   ========================================================================== */

:root, :root[data-theme="dark"] {
  --bg: #0f1b2d;          /* drawing ink */
  --bg-2: #132338;
  --bg-3: #1a2d46;
  --surface: #16263b;
  --surface-2: #1d3250;
  --line: #2b4060;        /* drafting line */
  --grid-line: #1d3149;
  --ink: #e8eef5;         /* paper */
  --ink-2: #b8c6d6;
  --ink-3: #8ea2b9;
  --accent: #f07d1a;      /* logo orange */
  --accent-soft: #ffb36b;
  --accent-dim: rgba(240,125,26,.13);
  --shadow-strong: rgba(240,125,26,.32);
  --shadow-soft: rgba(5,12,24,.35);
  --gridline: rgba(255,170,90,.38);
  --cad: 'Athiti', 'Inter', sans-serif;
}
:root[data-theme="light"] {
  --bg: #f3f6f9;          /* drawing paper */
  --bg-2: #e9eef4;
  --bg-3: #dde5ee;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --line: #c5d1de;
  --grid-line: #dbe3ec;
  --ink: #12233a;
  --ink-2: #3a4d66;
  --ink-3: #5d7089;
  --accent: #c85f08;      /* darker orange: 4.6:1 on paper */
  --accent-soft: #a94f05;
  --accent-dim: rgba(200,95,8,.10);
  --shadow-strong: rgba(200,95,8,.28);
  --shadow-soft: rgba(18,35,58,.10);
  --gridline: rgba(200,95,8,.42);
}

/* ---------- Type ---------- */
h1, h2 { letter-spacing: -.01em; }
h2 { font-weight: 700; }
.kicker {
  font-family: var(--cad); font-weight: 600; font-size: 16px;
  letter-spacing: .02em; text-transform: none; color: var(--accent);
  display: inline-flex; align-items: center; gap: 10px;
}
.kicker::before { content: ''; width: 22px; height: 2px; background: currentColor; }
.section-head.center .kicker { justify-content: center; }
.section-sub { color: var(--ink-2); }
.accent, .hero h1 .accent { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: inherit; -webkit-text-fill-color: currentColor; }

/* ---------- Header ---------- */
body > nav, .bims-header { background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 1px solid var(--line); }
html[data-theme="light"] body > nav, html[data-theme="light"] .bims-header { background: color-mix(in srgb, #ffffff 90%, transparent); border-bottom-color: var(--line); }
nav .menu-item > button:hover, nav .menu-item > a:hover { color: var(--accent); background: var(--accent-dim); }
.mega { border-radius: 6px; background: var(--surface); }
.mega-link-icon { background: var(--accent-dim); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.mega-badge { background: var(--accent); }

/* ---------- Buttons ---------- */
.btn { border-radius: 4px; font-weight: 600; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 70%, #000), 0 10px 26px -12px var(--shadow-strong); }
html[data-theme="light"] .btn-primary { color: #fff; }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn:focus-visible, .hero-offering:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Hero: the drawing sheet ---------- */
.hero {
  padding: 112px 0 200px;
  background: #0b1626 url('./bim-learning-hero.png') center / cover no-repeat;
}
.hero::before {
  background:
    linear-gradient(90deg, rgba(9,19,34,.94) 0%, rgba(9,19,34,.86) 46%, rgba(9,19,34,.55) 100%);
}
.hero .grid-bg {
  opacity: 1;
  background-image:
    linear-gradient(rgba(140,170,205,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140,170,205,.07) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: none; mask-image: none;
}
.hero-inner { text-align: left; max-width: 1240px; position: relative; z-index: 2; }
.hero h1 {
  color: #f4f7fb; max-width: 15ch;
  font-size: clamp(40px, 6.2vw, 78px); line-height: 1.08; font-weight: 700;
  margin: 18px 0 22px;
}
.hero .hero-sub { color: #c9d6e5; max-width: 56ch; margin-left: 0; margin-right: 0; font-size: 18px; }
.hero .cta-row { justify-content: flex-start; }
.hero .badge {
  border-radius: 3px; background: transparent; color: #ffb36b;
  border: 1px solid rgba(255,179,107,.45);
  font-family: var(--cad); font-size: 15px; letter-spacing: .04em; text-transform: none; padding: 6px 12px;
}
.hero .badge .dot { background: #f07d1a; box-shadow: 0 0 0 4px rgba(240,125,26,.18); }
.hero .btn-ghost { color: #e8eef5; border-color: rgba(232,238,245,.35); background: rgba(9,19,34,.4); }
.hero .btn-ghost:hover { border-color: #ffb36b; color: #ffb36b; }

/* Structural grid overlay: gridlines + bubbles like a Revit plan (decorative). */
.hero-grid { position: absolute; inset: 0; z-index: 1; pointer-events: none; color: var(--gridline); }
.hero-grid svg { width: 100%; height: 100%; display: block; }
.hero-grid .gl { stroke: currentColor; stroke-width: 1; stroke-dasharray: 14 4 2 4; vector-effect: non-scaling-stroke; }
.hero-grid .bub circle { fill: #0c1828; stroke: #f07d1a; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.hero-grid .bub text { fill: #ffcf9f; font: 600 15px 'Athiti', sans-serif; text-anchor: middle; dominant-baseline: central; }
.hero-grid .dim { stroke: rgba(255,207,159,.55); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hero-grid .dimtxt { fill: rgba(255,207,159,.8); font: 500 13px 'Athiti', sans-serif; text-anchor: middle; }
@media (prefers-reduced-motion: no-preference) {
  .hero-grid .gl { stroke-dashoffset: 400; animation: drawGrid 1.6s .15s ease-out forwards; }
  .hero-grid .bub { opacity: 0; animation: bubIn .5s ease-out forwards; }
  .hero-grid .bub:nth-of-type(odd) { animation-delay: 1.1s; }
  .hero-grid .bub:nth-of-type(even) { animation-delay: 1.3s; }
}
@keyframes drawGrid { to { stroke-dashoffset: 0; } }
@keyframes bubIn { to { opacity: 1; } }

/* Product in place: the real ribbon, pinned like a detail on the sheet. */
.hero-ribbon { position: relative; margin: 44px 0 0; max-width: 1100px; }
.hero-ribbon img {
  display: block; width: 100%; height: auto; background: #fff;
  border: 1px solid rgba(255,255,255,.55); border-radius: 3px;
  box-shadow: 0 24px 60px -18px rgba(0,0,0,.65);
}
.hero-ribbon figcaption {
  display: flex; align-items: center; gap: 12px; margin-top: 12px;
  color: #c9d6e5; font-size: 14px;
}
.hero-ribbon figcaption::before { content: ''; width: 34px; height: 1px; background: #f07d1a; }
.hero-ribbon .tag {
  font-family: var(--cad); color: #ffb36b; font-size: 15px; letter-spacing: .03em;
  border: 1px solid rgba(255,179,107,.5); padding: 1px 8px; border-radius: 2px;
}

/* ---------- Offerings strip under the hero ---------- */
.offerings-section { margin-top: -120px; background: linear-gradient(to bottom, transparent 0 120px, var(--bg-2) 120px); }
.hero-offering {
  border-radius: 4px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 18px 40px -24px var(--shadow-soft); position: relative; overflow: hidden;
}
.hero-offering::after {
  content: ''; position: absolute; top: 0; right: 0; width: 0; height: 0;
  border-style: solid; border-width: 0 18px 18px 0; border-color: transparent var(--line) transparent transparent;
  transition: border-color .2s ease;
}
.hero-offering:hover, .hero-offering:focus-visible { transform: translateY(-3px); border-color: var(--accent); background: var(--surface); }
.hero-offering:hover::after, .hero-offering:focus-visible::after { border-right-color: var(--accent); }
.hero-offering-no { font-family: var(--cad); font-size: 15px; letter-spacing: .03em; font-weight: 600; }
.hero-offering:first-child { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), var(--surface) 70%); }

/* ---------- Panels (was: identical rounded SaaS cards) ---------- */
.value, .feature, .std, .roadmap-card, .course-card {
  border-radius: 4px !important; background: var(--surface) !important; border: 1px solid var(--line) !important;
  box-shadow: none !important; position: relative;
}
.value:hover, .roadmap-card:hover, .std:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)) !important; }
.value::before, .roadmap-card::before {
  content: ''; position: absolute; left: -1px; top: -1px; width: 28px; height: 3px; background: var(--accent);
}
.value .num { display: none; }  /* not a sequence: remove 01/02/03 */
.value h3 { padding-right: 0; }
.value p, .roadmap-card p { color: var(--ink-2); }
.features-section { background: var(--bg-2); }
.features-section figure { border-radius: 4px !important; box-shadow: 0 24px 50px -28px var(--shadow-soft) !important; }
.roadmap-icon { background: var(--accent-dim) !important; color: var(--accent) !important; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 4px !important; }
.roadmap-badge { border-radius: 2px !important; background: transparent !important; color: var(--ink-3) !important; border: 1px dashed var(--line) !important; font-family: var(--cad); letter-spacing: .03em; text-transform: none; font-size: 13px !important; }
.std-code { border-radius: 2px !important; background: var(--accent) !important; color: #fff !important; font-family: var(--cad); font-size: 16px !important; letter-spacing: .02em; }

/* ---------- Method statement: a real sequence, drawn as a dimension chain ---------- */
.step-icon {
  border-radius: 50%; background: var(--bg); border: 1.5px solid var(--accent); color: var(--accent);
  font-family: var(--cad); font-size: 26px; font-weight: 600;
}
.workflow .arrow { color: var(--accent); opacity: .8; }

/* ---------- Final call to action: the title block ---------- */
.final-cta { background: var(--bg-2); padding: 110px 0; }
.final-cta::before { display: none; }
.final-cta .wrap {
  border: 1px solid var(--line); background: var(--surface); padding: 56px 40px; border-radius: 4px;
  position: relative;
}
.final-cta .wrap::after {
  content: 'BiMSolutions  |  Revit Extension 2.9.0  |  Revit 2027';
  position: absolute; right: -1px; bottom: -1px; padding: 6px 12px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink-3);
  font: 500 13px var(--cad); letter-spacing: .04em;
}
.final-cta .cta-row .btn-primary + .btn-primary { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.final-cta .cta-row .btn-primary + .btn-primary:hover { background: var(--accent-dim); }

/* ---------- Footer ---------- */
footer { border-top: 2px solid var(--accent); background: var(--bg); }

@media (max-width: 1050px) {
  .hero { padding: 88px 0 72px; }
  .offerings-section { margin-top: 0; background: var(--bg-2); }
  .hero-grid .bub, .hero-grid .dim, .hero-grid .dimtxt { display: none; }
}
@media (max-width: 640px) {
  .hero h1 { font-size: 38px; }
  .hero-grid { display: none; }
  .final-cta .wrap { padding: 40px 20px 56px; }
  .final-cta .wrap::after { left: -1px; right: -1px; text-align: center; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .fade-in { animation: none !important; }
}

/* ==========================================================================
   Shop (shop.html): map its own variables onto the drawing-sheet palette
   ========================================================================== */
:root, :root[data-theme="dark"] { --blue: var(--accent); --blue-soft: var(--accent-soft); --muted: var(--ink-2); --quiet: var(--ink-3); }
:root[data-theme="light"] { --blue: var(--accent); --blue-soft: var(--accent-soft); --muted: var(--ink-2); --quiet: var(--ink-3); }
main > .hero {
  position: relative; padding: 76px 0 62px; overflow: hidden;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--bg);
  border-bottom: 2px solid var(--accent);
}
main > .hero .eyebrow { font-family: var(--cad); font-size: 17px; letter-spacing: .02em; text-transform: none; color: var(--accent); }
main > .hero h1 { font-size: clamp(40px, 5.4vw, 68px); color: var(--ink); }
.sidebar, .notice, .search, .closing, .cart-panel, .cart-item, .empty { border-radius: 4px !important; }
.filters button { border-radius: 3px; }
.filters button.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.catalog .card { border-radius: 4px; background: var(--surface); }
.catalog .card:hover { border-color: var(--accent); }
.catalog .card-art,
.catalog .card[data-category="course"] .card-art,
.catalog .card[data-category="service"] .card-art {
  background:
    linear-gradient(rgba(140,170,205,.10) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(90deg, rgba(140,170,205,.10) 1px, transparent 1px) 0 0 / 16px 16px,
    #142538;
  border-bottom: 1px solid var(--line);
}
.catalog .card[data-category="extension"] .card-art { box-shadow: inset 4px 0 0 #f07d1a; }
.catalog .card-art svg { color: #ffb36b; }
.catalog .card[data-category="course"] .card-art svg, .catalog .card[data-category="service"] .card-art svg { color: #c9d6e5; }
.catalog .status { border-radius: 2px; font-family: var(--cad); font-size: 15px; letter-spacing: .02em; border-color: rgba(255,179,107,.55); color: #ffd3a8; }
.catalog .card-category { color: var(--accent); font-family: var(--cad); font-size: 15px; letter-spacing: .02em; }
.catalog .card a, .card-actions .primary-action, .cart-checkout, .shop-cart-button { border-radius: 4px; background: var(--accent); border-color: var(--accent); }
.catalog .card a:hover, .card-actions .primary-action:hover { background: var(--accent); filter: brightness(1.08); }
.shop-cart-count { color: var(--accent); }
.lang-switch button.active, .bims-header-language button.active { background: var(--accent); color: #fff; }
.bims-header-language button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main > .hero h1 { color: var(--ink); }
main > .hero p { color: var(--ink-2); }

/* ---------- v3.1: learning links / service block ---------- */
section[aria-labelledby="learning-links-title"] { border-top: 1px solid var(--line); background: var(--bg-2); }
section[aria-labelledby="learning-links-title"] > .wrap {
  display: grid; grid-template-columns: 1fr 1fr; column-gap: 64px; row-gap: 14px; align-items: start;
}
section[aria-labelledby="learning-links-title"] > .wrap > :nth-child(-n+3) { grid-column: 1; }
section[aria-labelledby="learning-links-title"] > .wrap > :nth-child(n+4) { grid-column: 2; }
section[aria-labelledby="learning-links-title"] > .wrap > h2:nth-child(4), section[aria-labelledby="learning-links-title"] > .wrap > p:nth-child(5) { padding-left: 28px; border-left: 2px solid var(--accent); }
section[aria-labelledby="learning-links-title"] > .wrap > :nth-child(1),
section[aria-labelledby="learning-links-title"] > .wrap > :nth-child(4) { grid-row: 1; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.25; margin: 0; }
section[aria-labelledby="learning-links-title"] > .wrap > :nth-child(2),
section[aria-labelledby="learning-links-title"] > .wrap > :nth-child(5) { grid-row: 2; color: var(--ink-2); margin: 0; }
section[aria-labelledby="learning-links-title"] > .wrap > :nth-child(3),
section[aria-labelledby="learning-links-title"] > .wrap > :nth-child(6) { grid-row: 3; }
section[aria-labelledby="learning-links-title"] > .wrap > a.btn { justify-self: start; margin: 8px 0 0 30px; }
section[aria-labelledby="learning-links-title"] ul { list-style: none; padding: 0; margin: 4px 0 0; line-height: 1.5 !important; }
section[aria-labelledby="learning-links-title"] li { border-top: 1px solid var(--line); }
section[aria-labelledby="learning-links-title"] li:last-child { border-bottom: 1px solid var(--line); }
section[aria-labelledby="learning-links-title"] li a { display: flex; justify-content: space-between; gap: 16px; padding: 13px 2px; color: var(--ink); text-decoration: none; font-weight: 600; }
section[aria-labelledby="learning-links-title"] li a::after { content: '↗'; color: var(--accent); }
section[aria-labelledby="learning-links-title"] li a:hover { color: var(--accent); }

.hero-ribbon figcaption .tag, .hero-ribbon .tag { white-space: nowrap; }

@media (max-width: 860px) {
  section[aria-labelledby="learning-links-title"] > .wrap { grid-template-columns: 1fr; }
  section[aria-labelledby="learning-links-title"] > .wrap > * { grid-column: 1 !important; grid-row: auto !important; }
  section[aria-labelledby="learning-links-title"] > .wrap > :nth-child(4) { margin-top: 36px; }
  section[aria-labelledby="learning-links-title"] > .wrap > a.btn { margin-left: 30px; }
}
@media (max-width: 640px) {
  .hero-ribbon { display: none; }
  .actions { gap: 6px !important; }
  .actions > .facebook-link { display: none !important; }
  .actions > button.cta + button.cta { display: none !important; }
  .actions > .cta { white-space: nowrap; padding: 8px 14px !important; }
}
