/* ============================================================
   PLACEINTEL — core design system (v5)
   Identity: "the architect's markup"
   Display  : Bricolage Grotesque   Labels: IBM Plex Mono
   Reading  : Newsreader            Sans : Inter
   ============================================================ */

:root {
  --paper:      #F6F1E6;
  --paper-2:    #F1EAD9;
  --surface:    #FDFBF5;
  --surface-2:  #EDE7D7;
  --ink:        #211E18;
  --ink-2:      #574F43;
  --ink-3:      #5E5547;
  --line:       #E0D8C5;
  --line-2:     #CFC5AC;
  --draft:      #C7BCA1;

  --sea:        #1C6A88;
  --sea-2:      #134F66;
  --sea-tint:   #DFEBEF;
  --sage:       #647F4F;
  --sage-2:     #4F6640;
  --sage-tint:  #E5EAD8;
  --terra:      #B05332;
  --terra-2:    #A24A2A;
  --terra-tint: #F4E1D6;
  --honey:      #7A5600;
  --honey-tint: #F1E6C7;
  --flag:       #B6432A;
  --flag-tint:  #F2DDD5;

  --shadow-sm: 0 1px 2px rgba(33,30,24,.05), 0 1px 1px rgba(33,30,24,.04);
  --shadow-md: 0 8px 22px -8px rgba(33,30,24,.12), 0 3px 8px -4px rgba(33,30,24,.08);
  --shadow-lg: 0 30px 64px -28px rgba(28,106,136,.30), 0 12px 28px -16px rgba(33,30,24,.16);

  --r-sm: 5px; --r-md: 9px; --r-lg: 15px;
  --maxw: 1180px;
  --nav-h: 58px;

  --ff-display: "Bricolage Grotesque", "Archivo", system-ui, sans-serif;
  --ff-read: "Newsreader", Georgia, serif;
  --ff-sans: "Inter", system-ui, -apple-system, sans-serif;
  --ff-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  --grid: color-mix(in srgb, var(--draft) 42%, transparent);
}

[data-theme="dark"] {
  --paper:      #16130E;
  --paper-2:    #1B1711;
  --surface:    #201B14;
  --surface-2:  #29231A;
  --ink:        #F0E9D8;
  --ink-2:      #BBB1A0;
  --ink-3:      #B7AD98;
  --line:       #332B20;
  --line-2:     #463A29;
  --draft:      #4A3F2C;

  --sea:        #5FACCA;
  --sea-2:      #8AC8E0;
  --sea-tint:   #133039;
  --sage:       #97B179;
  --sage-2:     #B0C795;
  --sage-tint:  #1B2516;
  --terra:      #DD835B;
  --terra-2:    #E8A07E;
  --terra-tint: #2F1C13;
  --honey:      #D4AC55;
  --honey-tint: #2A2310;
  --flag:       #DD7656;
  --flag-tint:  #2F1A12;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 8px 22px -8px rgba(0,0,0,.5);
  --shadow-lg: 0 30px 64px -28px rgba(0,0,0,.62), 0 12px 28px -16px rgba(0,0,0,.5);
  --grid: color-mix(in srgb, var(--draft) 60%, transparent);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 18px); }
html.lg { font-size: 112.5%; zoom: 1.12; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
body {
  margin: 0; font-family: var(--ff-sans);
  background: var(--paper); color: var(--ink); line-height: 1.62;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background .4s ease, color .4s ease;
}
h1,h2,h3,h4,h5 { font-family: var(--ff-display); font-weight: 600; line-height: 1.08; letter-spacing: -.018em; margin: 0; color: var(--ink); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
::selection { background: var(--honey-tint); }
:focus-visible { outline: 2px solid var(--sea); outline-offset: 3px; border-radius: 3px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 92px 0; }

/* ---- eyebrow + dimension line (signature divider) ---- */
.eyebrow { font-family: var(--ff-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--sea); display: inline-flex; align-items: center; gap: 10px; }
.eyebrow::before { content:""; width: 26px; height: 1px; background: currentColor; opacity: .55; }

.dim { display:flex; align-items:center; gap:14px; font-family: var(--ff-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.dim::before, .dim::after { content:""; height: 1px; background: var(--line-2); flex: 1; position: relative; }
.dim::before { box-shadow: 0 -3px 0 -2px var(--line-2); }
.dim.tick::before, .dim.tick::after { background-image: linear-gradient(var(--line-2),var(--line-2)); }
.dim .tk { width: 1px; height: 8px; background: var(--line-2); }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-family: var(--ff-sans); font-size: 15px; font-weight: 600; padding: 12px 22px; border-radius: var(--r-md); border: 1px solid transparent; transition: transform .14s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease, color .2s ease; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--sea); color: #fff; box-shadow: var(--shadow-sm); }
[data-theme="dark"] .btn-primary { color:#07151b; }
.btn-primary:hover { background: var(--sea-2); box-shadow: var(--shadow-md); }
.btn-warm { background: var(--terra); color: #fff; box-shadow: var(--shadow-sm); }
[data-theme="dark"] .btn-warm { color:#1c0d06; }
.btn-warm:hover { background: var(--terra-2); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--sea); color: var(--sea); }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { font-size: 16px; padding: 15px 28px; }

/* ---- status dots ---- */
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display:inline-block; }
.dot.clear  { background: var(--sage); }
.dot.caution{ background: var(--honey); }
.dot.risk   { background: var(--flag); }

/* ---- drafting-grid ground ---- */
.blueprint { position: relative; }
.blueprint::before {
  content:""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 30px 30px; background-position: center;
  -webkit-mask-image: radial-gradient(120% 100% at 50% 0%, #000 38%, transparent 78%);
  mask-image: radial-gradient(120% 100% at 50% 0%, #000 38%, transparent 78%);
  opacity: .8;
}
.blueprint > * { position: relative; z-index: 1; }

/* ---- corner registration marks ---- */
.regmark { position: relative; }
.regmark::before, .regmark::after { content:""; position:absolute; width:11px; height:11px; pointer-events:none; opacity:.6; }
.regmark::before { top:9px; left:9px; border-top:1.5px solid var(--draft); border-left:1.5px solid var(--draft); }
.regmark::after  { bottom:9px; right:9px; border-bottom:1.5px solid var(--draft); border-right:1.5px solid var(--draft); }

/* ============ NAV ============ */
.nav { position: sticky; top: 0; z-index: 100; height: var(--nav-h); background: color-mix(in srgb, var(--paper) 82%, transparent); backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid transparent; transition: border-color .3s ease; }
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; gap: 16px; height: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand .mark { width: 30px; height: 30px; flex: none; }
.brand .bt { font-family: var(--ff-display); font-weight: 700; font-size: 19px; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
.brand .bt-a { color: var(--sea-2); }
.brand .bt-b { color: var(--terra-2); }
.brand small { font-family: var(--ff-mono); font-size: 9.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); display:block; margin-top: 2px; }
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.nav-links > * { position: relative; }
.navlink { font-size: 14.5px; font-weight: 500; color: var(--ink-2); padding: 9px 13px; border-radius: var(--r-sm); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; background: none; border: none; font-family: inherit; transition: color .15s ease, background .15s ease; }
.navlink:hover, .navlink[aria-expanded="true"] { color: var(--ink); background: var(--surface-2); }
.navlink.active { color: var(--sea); }
.navlink .chev { width: 12px; height: 12px; transition: transform .2s ease; }
.navlink[aria-expanded="true"] .chev { transform: rotate(180deg); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.theme-toggle { width: 34px; height: 34px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); transition: all .2s ease; }
.theme-toggle:hover { color: var(--sea); border-color: var(--sea); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }
.tsize { font-family: var(--ff-sans); font-size: 13px; font-weight: 700; line-height: 1; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md); height: 34px; padding: 0 9px; display: inline-flex; align-items: center; gap: 1px; cursor: pointer; transition: all .2s ease; }
.tsize sup { font-size: 9px; }
.tsize:hover { color: var(--sea); border-color: var(--sea); }
.tsize.on, .tsize[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.mega { position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(8px); width: 660px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 12px; z-index: 120; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .18s ease, transform .18s ease, visibility .18s; }
.mega.open { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.mega::before { content:""; position:absolute; top:-12px; left:0; right:0; height:12px; }
.mega-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.mega-item { display: flex; gap: 13px; padding: 12px; border-radius: var(--r-md); transition: background .15s ease; cursor: pointer; }
.mega-item:hover { background: color-mix(in srgb, var(--surface-2) 35%, var(--surface)); }
.mega-item .mi-ic { width: 38px; height: 38px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--sea-tint); color: var(--sea); }
.mega-item .mi-ic svg { width: 19px; height: 19px; }
.mega-item h5 { font-family: var(--ff-sans); font-size: 14px; font-weight: 600; margin: 0 0 3px; color: var(--ink); }
.mega-item p { font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.mega-foot { margin-top: 8px; padding: 12px 13px; border-top: 1px solid var(--line); display:flex; align-items:center; justify-content:space-between; gap: 12px; }
.mega-foot span { font-size: 13px; color: var(--ink-2); }
.menu-btn { display: none; width: 36px; height: 36px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; color: var(--ink); }
.drawer { position: fixed; inset: 0; z-index: 200; visibility: hidden; }
.drawer.open { visibility: visible; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(20,16,10,.5); opacity: 0; transition: opacity .25s ease; }
.drawer.open .drawer-scrim { opacity: 1; }
.drawer-panel { position: absolute; top: 0; right: 0; height: 100%; width: min(340px, 86vw); background: var(--paper); border-left: 1px solid var(--line); padding: 22px; transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1); overflow-y: auto; }
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.drawer a, .drawer .d-section > span { display: block; width: 100%; text-align: left; font-family: var(--ff-sans); font-size: 16px; font-weight: 500; color: var(--ink); padding: 13px 4px; border-bottom: 1px solid var(--line); }
.drawer .d-section > span { font-family: var(--ff-mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); border: none; padding-bottom: 4px; }
.drawer .d-sub a { font-size: 14px; color: var(--ink-2); padding: 10px 4px 10px 16px; font-weight: 400; border-bottom: none; }
.close-x { width: 40px; height: 40px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; color: var(--ink); }

/* ============================================================ MEGA NAV ============================================================ */
.mlinks { display:flex; align-items:center; gap:2px; margin-left:10px; }
.m-item { position:static; }
.m-trigger { font-family:inherit; font-size:14.5px; font-weight:500; color:var(--ink-2); padding:9px 14px; border-radius:var(--r-sm); display:inline-flex; align-items:center; gap:6px; cursor:pointer; background:none; border:none; transition:color .15s ease, background .15s ease; }
.m-trigger:hover, .m-item.open .m-trigger { color:var(--ink); background:var(--surface-2); }
.m-trigger .chev { width:12px; height:12px; transition:transform .2s ease; }
.m-item.open .m-trigger .chev { transform:rotate(180deg); }

/* detached full-width card: floats below the header as its own layer */
.m-panel { position:absolute; top:calc(100% + 10px); left:50%; width:min(var(--maxw), calc(100vw - 32px)); background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--shadow-lg); z-index:120; opacity:0; visibility:hidden; transform:translateX(-50%) translateY(8px); transition:opacity .2s ease, transform .2s ease, visibility .2s; }
.m-item.open .m-panel { opacity:1; visibility:visible; transform:translateX(-50%); }
.m-panel::before { content:""; position:absolute; top:-18px; left:0; right:0; height:18px; }

/* content kept aligned with the page container */
.m-inner { padding:24px 26px 18px; }
.m-cols { display:grid; gap:6px; }
.m-panel.wide .m-cols { grid-template-columns:repeat(3, minmax(0,1fr)); column-gap:32px; }
.m-panel.mid .m-cols { grid-template-columns:repeat(2, minmax(0,1fr)); column-gap:40px; }
.m-col-l { font-family:var(--ff-mono); font-size:10.5px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-3); padding:0 12px 8px; display:block; border-bottom:1px solid var(--line); margin-bottom:8px; }
.m-link { display:flex; gap:14px; padding:13px 12px; border-radius:var(--r-md); transition:background .14s ease; }
.m-link:hover { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.m-ic { width:40px; height:40px; flex:none; border-radius:10px; display:grid; place-items:center; background:var(--sea-tint); color:var(--sea); }
.m-ic svg { width:19px; height:19px; }
.m-link.sage .m-ic { background:var(--sage-tint); color:var(--sage-2); }
[data-theme="dark"] .m-link.sage .m-ic { color:var(--sage); }
.m-link b { font-family:var(--ff-sans); font-size:14.5px; font-weight:600; color:var(--ink); display:block; line-height:1.25; }
.m-link small { font-size:12.5px; color:var(--ink-3); line-height:1.45; display:block; margin-top:4px; }
.m-cta { margin-top:16px; padding:16px 12px 4px; border-top:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.m-cta .mc-t b { font-size:14px; color:var(--ink); }
.m-cta .mc-t small { display:block; font-size:12.5px; color:var(--ink-3); margin-top:3px; }
@media (max-width:1040px){ .mlinks { display:none; } .nav-right .hide-sm { display:none; } }


/* ============ FOOTER ============ */
.footer { border-top: 1px solid var(--line); padding: 60px 0 36px; background: var(--surface); }
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px; margin-bottom: 40px; }
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; max-width: 320px; margin-bottom: 16px; }
.footer-reg { display: inline-flex; align-items: center; gap: 8px; font-family: var(--ff-mono); font-size: 10.5px; color: var(--ink-3); border: 1px solid var(--line); padding: 7px 12px; border-radius: 100px; }
.footer h5 { font-family: var(--ff-mono); font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 15px; }
.footer ul { list-style: none; padding: 0; margin: 0; display:grid; gap:10px; }
.footer li a { font-size: 13.5px; color: var(--ink-2); transition: color .15s ease; }
.footer li a:hover { color: var(--sea); }
.footer-bot { border-top: 1px solid var(--line); padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-family: var(--ff-mono); font-size: 11.5px; color: var(--ink-3); }

@media (max-width: 1024px) {
  .nav-links { display: none; }
  .nav-right .btn-warm, .nav-right .btn-primary { display: none; }
  .menu-btn { display: grid; place-items: center; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

/* ---- mobile navbar: keep the wordmark on one line ---- */
@media (max-width: 680px) {
  .nav { height: auto; min-height: var(--nav-h); padding: 7px 0; }
  .nav-inner { padding: 0 14px; gap: 10px; }
  .brand { gap: 9px; min-width: 0; }
  .brand .mark { width: 26px; height: 26px; }
  .brand .bt { font-size: 16.5px; letter-spacing: -.025em; }
  .brand small { display: none; }
  .nav-right { gap: 7px; }
  .theme-toggle, .menu-btn { width: 32px; height: 32px; }
  .tsize { height: 32px; padding: 0 7px; font-size: 12px; }
}
@media (max-width: 350px) {
  .nav-right .tsize { display: none; }
}
@media (max-width: 760px) { .section { padding: 64px 0; } }
@media (max-width: 560px) { .footer-top { grid-template-columns: 1fr; gap: 28px; } }

/* ---- reveal ---- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.4,0,.2,1); }
.reveal.in { opacity: 1; transform: none; }
