/* ============================================================
   axplusb — Investment Advisor Web App
   Shared design system (Soft theme) + app shell + sidebar + modal
   Rebuilt from the Claude Code Design handoff (.dc.html specs).
   ============================================================ */

:root {
  --bg: #F4EEE5;
  --surface: #FFFFFF;
  --ink: #241F19;
  --muted: #7E746A;
  --line: #E8DFD2;
  --accent: oklch(0.62 0.115 72);
  --accent-ink: #FFFFFF;
  --accent-soft: oklch(0.955 0.03 75);
  --pos: #3f7d5a;
  --neg: #c2724a;
  --head: "Schibsted Grotesk", sans-serif;
  --body: "Instrument Sans", sans-serif;
  --mono: "JetBrains Mono", monospace;
  --radius: 20px;
  --radius-sm: 13px;
}

/* oklch fallback for older browsers */
@supports not (color: oklch(0.62 0.115 72)) {
  :root { --accent: #C0863E; --accent-soft: #F7EFE2; }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html, body { overflow-x: clip; }          /* guard against horizontal scroll (clip, not hidden — hidden makes body a scroll container and breaks the sticky sidebar) */

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent); color: #fff; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
input[type=range] { accent-color: var(--accent); }
h1, h2, h3 { text-wrap: balance; }
img { max-width: 100%; }

/* ============================================================
   APP SHELL
   ============================================================ */
.ax-app { display: flex; align-items: flex-start; min-height: 100vh; }
.ax-main { flex: 1; min-width: 0; color: var(--ink); }

/* ------------------------------------------------------------
   SIDEBAR (single shared component, injected by shell.js)
   ------------------------------------------------------------ */
.ax-side {
  position: sticky; top: 0; height: 100vh; width: 248px; flex: none;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 40;
  font-family: var(--body);
}
.ax-side__logo {
  height: 92px; flex: none; display: flex; align-items: center;
  padding: 0 24px; border-bottom: 1px solid var(--line);
}
.ax-side__logo a {
  display: flex; align-items: baseline; gap: 1px;
  font-family: var(--head); font-weight: 600; font-size: 23px;
  color: var(--ink); letter-spacing: -.01em; text-decoration: none;
}
.ax-side__logo .ax-plus { color: var(--accent); }

.ax-side__scroll { flex: 1; position: relative; min-height: 0; }
.ax-nav {
  height: 100%; overflow-y: auto; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 2px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.ax-nav::-webkit-scrollbar { width: 0; display: none; }

.ax-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  font-size: 14.5px; font-weight: 500; text-decoration: none;
  color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.ax-nav a svg { flex: none; }
.ax-nav a:hover { background: var(--accent-soft); color: var(--ink); }
.ax-nav a.is-active {
  background: var(--accent-soft); color: var(--ink); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}

.ax-grp {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  letter-spacing: .08em; padding: 16px 12px 7px; cursor: pointer;
  background: none; border: none; width: 100%; text-align: left;
}
.ax-grp:hover { color: var(--ink); }
.ax-grp .ax-chev { font-size: 14px; color: var(--muted); transition: transform .2s; }
.ax-grp[aria-expanded="false"] .ax-chev { transform: rotate(-90deg); }

.ax-grp-items { display: flex; flex-direction: column; gap: 2px; }
.ax-grp-items[hidden] { display: none; }

/* animated scroll hint */
@keyframes axscrollhint { 0%,100% { opacity: 0; transform: translateY(-3px); } 50% { opacity: .6; transform: translateY(3px); } }
.ax-scrollhint {
  position: absolute; left: 0; right: 0; bottom: 0; height: 44px;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 6px; pointer-events: none;
  background: linear-gradient(to top, var(--surface) 30%, transparent);
}
.ax-scrollhint svg { animation: axscrollhint 1.9s ease-in-out infinite; }

.ax-side__foot { padding: 16px; border-top: 1px solid var(--line); flex: none; }
.ax-side__foot a {
  display: block; text-align: center; text-decoration: none;
  font-size: 14.5px; font-weight: 600; font-family: var(--body);
  border-radius: 12px;
}
.ax-side__foot .ax-btn-primary { background: var(--accent); color: #fff; padding: 13px; }
.ax-side__foot .ax-btn-ghost { margin-top: 9px; background: none; color: var(--ink); border: 1px solid var(--line); padding: 12px; font-size: 14px; }

/* ------------------------------------------------------------
   MOBILE DRAWER (hamburger + off-canvas ≤ 820px)
   ------------------------------------------------------------ */
.ax-burger {
  display: none; position: fixed; top: 14px; left: 14px; z-index: 62;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(40,30,15,.14);
}
.ax-burger svg { display: block; }
.ax-overlay { display: none; position: fixed; inset: 0; background: rgba(20,15,8,.42); z-index: 55; }
.ax-overlay.is-open { display: block; }

/* in-drawer close (X) — shown only when the off-canvas drawer is active */
.ax-side__close {
  display: none; position: absolute; top: 28px; right: 16px; z-index: 3;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  align-items: center; justify-content: center; color: var(--ink);
}

@media (max-width: 820px) {
  .ax-side {
    position: fixed; top: 0; left: 0; z-index: 60; height: 100dvh;
    transform: translateX(-100%); transition: transform .25s ease;
  }
  .ax-side.is-open { transform: none; box-shadow: 0 0 60px rgba(30,20,10,.32); }
  .ax-burger { display: flex; }
  .ax-burger.is-open { display: none; }   /* hamburger hides while drawer is open */
  .ax-side__close { display: flex; }
}

/* ------------------------------------------------------------
   INNER PAGE CONTENT WRAPPER
   Shared by about / contact / relocation / talent / president /
   working. The fixed hamburger ends at 58px (top 14 + 44), so on
   mobile the wrapper gets the same 74px top offset the legal
   pages already use (legal.css → .ax-doc, FR-467) and the kicker
   is no longer covered.
   ------------------------------------------------------------ */
@media (max-width: 820px) {
  .ax-page { padding: 74px 18px 52px !important; }   /* room for the fixed hamburger */
}

/* ------------------------------------------------------------
   ABOUT PAGE — mobile grids
   The page is laid out with inline styles, so these overrides
   need !important to win over them. Desktop is untouched.
   ------------------------------------------------------------ */
@media (max-width: 820px) {
  .ab-card { padding: 24px 22px !important; }
  .ab-timeline { grid-template-columns: 1fr !important; }
  .ab-timeline > div { padding: 13px 0 !important; }   /* stacked: the 1px grid gap becomes a divider */
}
@media (max-width: 640px) {
  .ab-stats { grid-template-columns: repeat(2, 1fr) !important; }
  .ab-stats > div { padding: 20px 18px !important; }
  .ab-cards { grid-template-columns: 1fr !important; }
  .ab-facts { grid-template-columns: 1fr !important; }
}

/* ------------------------------------------------------------
   CALLBACK MODAL (shared, injected by shell.js)
   ------------------------------------------------------------ */
.ax-modal { position: fixed; inset: 0; z-index: 90; display: none; }
.ax-modal.is-open { display: block; }
.ax-modal__scrim { position: absolute; inset: 0; background: rgba(20,15,8,.5); }
.ax-modal__card {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: calc(100% - 40px); max-width: 440px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: 0 40px 90px -30px rgba(30,20,10,.6); overflow: hidden;
}
.ax-modal__body { padding: 30px 30px 32px; }
.ax-modal__kicker { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: .06em; margin-bottom: 10px; }
.ax-modal__title { font-family: var(--head); font-weight: 600; font-size: 24px; letter-spacing: -.01em; margin: 0 0 8px; }
.ax-modal__sub { font-size: 14.5px; color: var(--muted); margin: 0 0 20px; line-height: 1.55; }
.ax-modal__close {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-size: 18px; line-height: 1; display: flex;
  align-items: center; justify-content: center;
}
.ax-field { display: block; margin-bottom: 12px; }
.ax-field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.ax-field input, .ax-field select, .ax-field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 15px; color: var(--ink);
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s;
}
.ax-field textarea { min-height: 118px; resize: vertical; font-family: inherit; line-height: 1.5; }
.ax-field input:focus, .ax-field select:focus, .ax-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ax-field input:invalid.ax-touched, .ax-field textarea:invalid.ax-touched { border-color: var(--neg); }
.ax-field .ax-err { display: none; color: var(--neg); font-size: 12px; margin-top: 4px; }
.ax-field.ax-show-err .ax-err { display: block; }
.ax-modal__submit {
  width: 100%; margin-top: 6px; background: var(--accent); color: #fff;
  border: none; padding: 14px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600;
}
.ax-modal__submit:hover { filter: brightness(1.04); }
.ax-modal__thanks { text-align: center; padding: 12px 0 4px; }
.ax-modal__thanks .ax-check {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 16px;
  background: color-mix(in srgb, var(--pos) 14%, transparent); color: var(--pos);
  display: flex; align-items: center; justify-content: center;
}
.ax-legal { font-size: 11.5px; color: var(--muted); margin: 14px 2px 0; line-height: 1.5; }
.ax-legal a { color: var(--accent); }
