/* ============================================================
   BrickAI — shared brand system
   Source of truth: _branding/brand-identity.md + brickai-tokens.css
   Paper #F3F4EE · Ink #17181C · Royal Blue #0037C6
   Inter (display) · Source Serif 4 (body) · JetBrains Mono (labels)
   ============================================================ */

:root {
  /* Colour */
  --primary:        #0037C6;   /* Royal Blue — accent, links, CTAs            */
  --primary-bright: #0A49ED;   /* Electric — hover / focus                    */
  --primary-deep:   #00269A;   /* Pressed                                     */
  --ink:            #17181C;   /* Headlines + primary text                    */
  --ink-soft:       #4A4C52;   /* Secondary text                              */
  --paper:          #F3F4EE;   /* Page background — warm off-white, NOT white */
  --paper-2:        #ECEDE5;   /* subtle alt fill                             */
  --surface:        #FFFFFF;   /* Cards, panels                               */
  --hairline:       #E2E3DC;   /* Borders, dividers, grid lines               */
  --muted:          #9A9C98;   /* Disabled, placeholders                      */
  --success:        #1F7A4D;
  --warning:        #B86E00;
  --danger:         #BE2F29;

  /* Type */
  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body:    'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --tracking-label: 0.1em;
  --tracking-tight: -0.02em;

  /* Spacing (8px base) */
  --space-xs: 8px; --space-sm: 16px; --space-md: 24px;
  --space-lg: 48px; --space-xl: 64px; --space-2xl: 96px;

  /* Radius */
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 16px; --radius-full: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(23,24,28,.06);
  --shadow-md: 0 4px 16px rgba(23,24,28,.08);
  --shadow-lg: 0 12px 40px rgba(23,24,28,.12);

  --maxw: 1140px;
  --nav-h: 72px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--primary); color: #fff; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
@media (max-width: 600px){ .wrap { padding: 0 22px; } }

/* ---------- Type primitives ---------- */
.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--primary);
}
.eyebrow.on-ink { color: #fff; opacity: .82; }

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); font-weight: 800; letter-spacing: var(--tracking-tight); line-height: 1.04; }
h1 { font-size: clamp(40px, 6.4vw, 70px); }
h2 { font-size: clamp(30px, 4vw, 46px); letter-spacing: -0.018em; line-height: 1.06; }
h3 { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
h4 { font-size: 17px; font-weight: 700; letter-spacing: 0; }
em.accent { font-style: normal; color: var(--primary); }

.lede { font-family: var(--font-body); font-size: 20px; line-height: 1.55; color: var(--ink-soft); max-width: 60ch; }
.prose { max-width: 66ch; }
.prose p { margin-top: 18px; }

/* the signature short blue rule */
.rule { display: block; width: 120px; height: 4px; background: var(--primary); border: 0; border-radius: 2px; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .01em;
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 13px 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  transition: transform .14s ease, background .16s ease, border-color .16s ease;
}
.btn .arr { transition: transform .2s cubic-bezier(.23,1,.32,1); }
.btn:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--primary-bright); border-color: var(--primary-bright); }
  .btn:hover .arr { transform: translateX(4px); }
}
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
}
.btn-on-ink { background: #fff; color: var(--primary-deep); border-color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .btn-on-ink:hover { background: var(--paper); color: var(--primary-deep); border-color: var(--paper); }
}

/* ---------- Nav ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.nav-in { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); }
.brand-lockup { display: inline-flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.brand-lockup .ai { color: var(--primary); }
.brick-mark { width: 26px; height: 22px; flex: none; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links > a, .nav-trigger {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft);
  padding: 9px 14px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: 0; cursor: pointer; transition: color .16s ease, background .16s ease;
}
.nav-links > a:hover, .nav-trigger:hover, .nav-item.open .nav-trigger { color: var(--ink); background: var(--paper-2); }
.nav-trigger .caret { width: 9px; height: 9px; transition: transform .2s ease; }
.nav-item.open .nav-trigger .caret { transform: rotate(180deg); }

.nav-item { position: relative; }
.nav-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 320px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 8px; opacity: 0; transform: translateY(-6px);
  pointer-events: none; transition: opacity .16s ease, transform .16s ease;
}
.nav-item.open .nav-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
/* invisible bridge across the 8px gap so hover→click doesn't drop the menu */
.nav-menu::before { content: ""; position: absolute; top: -12px; left: 0; right: 0; height: 12px; }
.nav-menu a { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--radius-sm); transition: background .14s ease; }
.nav-menu a:hover { background: var(--paper-2); }
.nav-menu .mi-ic { width: 34px; height: 34px; flex: none; border-radius: var(--radius-sm); background: var(--paper-2); display: grid; place-items: center; color: var(--primary); }
.nav-menu .mi-t { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 8px; letter-spacing: -0.01em; }
.nav-menu .mi-d { font-family: var(--font-body); font-size: 13.5px; color: var(--ink-soft); line-height: 1.4; margin-top: 2px; }
.tag-wip { font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent); padding: 2px 6px; border-radius: var(--radius-full); }

.nav-cta { margin-left: 8px; }
.nav-toggle { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; background: none; border: 1px solid var(--hairline); border-radius: var(--radius-sm); color: var(--ink); cursor: pointer; }

@media (max-width: 940px){
  .nav-links, .nav-cta-desktop { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* mobile sheet */
.nav-sheet { display: none; border-top: 1px solid var(--hairline); background: var(--paper); }
.nav-sheet.open { display: block; }
.nav-sheet .wrap { padding-top: 8px; padding-bottom: 20px; }
.nav-sheet a, .nav-sheet .sheet-group > span {
  display: block; font-family: var(--font-mono); font-size: 13px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink); padding: 15px 0; border-bottom: 1px solid var(--hairline);
}
.nav-sheet .sheet-group > span { color: var(--ink-soft); border-bottom: 0; padding-bottom: 4px; }
.nav-sheet .sheet-sub a { padding-left: 16px; color: var(--ink-soft); font-size: 12px; }
.nav-sheet .btn { width: 100%; justify-content: center; margin-top: 18px; color: #fff; font-family: var(--font-display); text-transform: none; letter-spacing: .01em; padding: 13px 22px; border-bottom: 0; }

/* ---------- Generic section scaffold ---------- */
.section { border-bottom: 1px solid var(--hairline); }
.section-pad { padding-block: var(--space-2xl); }
@media (max-width: 760px){ .section-pad { padding-block: var(--space-xl); } }
.section-head { max-width: 720px; }
.section-head h2 { margin-top: 14px; }
.section-head .lede { margin-top: 18px; }

/* faint vertical grid lines for hero/feature backgrounds */
.gridlines { position: relative; }
.gridlines::before {
  content:""; position:absolute; inset:0; pointer-events:none; opacity:.6;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(100%/12 - 1px), var(--hairline) calc(100%/12 - 1px) calc(100%/12));
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%);
  mask-image: linear-gradient(180deg, #000, transparent 75%);
}

/* reverse (Ink) band */
.band-ink { background: var(--ink); color: var(--paper); }
.band-ink h2, .band-ink h3 { color: #fff; }
.band-ink .lede { color: color-mix(in srgb, var(--paper) 80%, transparent); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--paper); padding: 64px 0 32px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px){ .foot-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
.site-footer .brand-lockup { color: #fff; }
.site-footer .brand-lockup .ai { color: var(--primary-bright); }
.site-footer .brick-mark .ink { fill: #fff; }
.foot-blurb { font-family: var(--font-body); font-size: 14.5px; color: color-mix(in srgb, var(--paper) 72%, transparent); max-width: 32ch; margin-top: 16px; }
.foot-col h5 { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: color-mix(in srgb, var(--paper) 60%, transparent); margin-bottom: 14px; }
.foot-col li { list-style: none; margin-bottom: 10px; }
.foot-col a { font-family: var(--font-body); font-size: 14.5px; color: color-mix(in srgb, var(--paper) 82%, transparent); transition: color .14s ease; }
.foot-col a:hover { color: #fff; }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 48px; padding-top: 22px; border-top: 1px solid color-mix(in srgb, var(--paper) 16%, transparent); font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; color: color-mix(in srgb, var(--paper) 56%, transparent); }

/* ---------- Booking modal ---------- */
.bk-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; visibility: hidden; }
.bk-modal.open { visibility: visible; }
.bk-modal__backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--ink) 55%, transparent); backdrop-filter: blur(3px); opacity: 0; transition: opacity .2s ease; }
.bk-modal.open .bk-modal__backdrop { opacity: 1; }
.bk-modal__dialog { position: relative; width: min(560px, 96vw); height: min(760px, 88vh); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; opacity: 0; transform: translateY(10px) scale(.985); transition: opacity .24s ease, transform .24s cubic-bezier(.23,1,.32,1); }
.bk-modal.open .bk-modal__dialog { opacity: 1; transform: none; }
.bk-modal__close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--hairline); border-radius: var(--radius-full); background: var(--surface); color: var(--ink); cursor: pointer; transition: background .14s ease; }
@media (hover: hover) and (pointer: fine) { .bk-modal__close:hover { background: var(--paper-2); } }
.bk-modal__load { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; color: var(--ink-soft); }
.bk-modal__frame { position: relative; z-index: 1; width: 100%; height: 100%; border: 0; background: transparent; }
@media (max-width: 560px){
  .bk-modal { padding: 0; }
  .bk-modal__dialog { width: 100%; height: 100%; border-radius: 0; }
}

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s cubic-bezier(.23,1,.32,1), transform .6s cubic-bezier(.23,1,.32,1); }
.reveal.in { opacity: 1; transform: none; }
.rise { opacity: 0; transform: translateY(14px); animation: rise .62s cubic-bezier(.23,1,.32,1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
.d1{animation-delay:.05s}.d2{animation-delay:.13s}.d3{animation-delay:.22s}.d4{animation-delay:.32s}.d5{animation-delay:.44s}

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal, .rise { opacity: 1 !important; transform: none !important; }
}
