:root {
  --bg: #F6F7F9;
  --card: #FFFFFF;
  --line: #E4E7EC;
  --ink: #0F172A;
  --body: #344054;
  --muted: #475467;
  --muted-2: #667085;
  --accent: #3347D6;
  --accent-soft: #EEF0FD;
  --dark: #0F172A;
  --dark-accent: #9DB0FF;
  --radius: 20px;
  --max: 1160px;
  --pad: 40px;
  --gap-section: 120px;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
ul, ol { list-style: none; }

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

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

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

.serif { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); letter-spacing: 0; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246, 247, 249, 0.86);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 72px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 700; }
.monogram {
  width: 38px; height: 38px; border-radius: 10px; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-size: 14px; font-weight: 800; letter-spacing: 0.02em;
}

.nav { display: flex; align-items: center; gap: 28px; }
.nav-links { display: flex; gap: 26px; }
.nav-links a { text-decoration: none; color: var(--body); font-weight: 500; font-size: 15px; }
.nav-links a:hover { color: var(--ink); }

.actions { display: flex; align-items: center; gap: 10px; }

.lang {
  display: inline-flex; border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 3px;
}
.lang button {
  font: 600 12px/1 var(--mono); letter-spacing: 0.06em; border: 0; background: transparent;
  color: var(--muted); padding: 8px 10px; border-radius: 999px; cursor: pointer; min-width: 40px;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.pill {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 14px;
  padding: 10px 18px; border-radius: 999px; transition: filter .2s;
}
.pill:hover { filter: brightness(1.1); }

.menu-btn {
  display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer; place-items: center;
}
.menu-btn svg { width: 20px; height: 20px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  padding: 14px 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1px solid var(--ink); transition: transform .2s, background .2s, color .2s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #1E293B; }
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-white { background: #fff; color: var(--ink); border-color: #fff; }
.btn-white:hover { background: var(--dark-accent); border-color: var(--dark-accent); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
a.card { display: block; text-decoration: none; color: inherit; }
.card.hover:hover, a.card:hover {
  border-color: var(--ink); transform: translateY(-3px);
  box-shadow: 0 14px 30px -18px rgba(15, 23, 42, 0.35);
}

/* ---------- Sections ---------- */
.section { padding-top: var(--gap-section); scroll-margin-top: 72px; }
.section-label { color: var(--accent); margin-bottom: 18px; display: block; }
.section-title {
  color: var(--ink); font-weight: 800; letter-spacing: -0.03em;
  font-size: clamp(30px, 4.4vw, 52px); line-height: 1.08; max-width: 860px;
}
.section-title .serif { font-size: 1.08em; }

/* ---------- Hero ---------- */
.hero { padding-top: 72px; }
.hero-top { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: end; }
.meta-line { color: var(--muted); margin-bottom: 22px; display: flex; flex-wrap: wrap; gap: 6px 10px; }
.meta-line .accent { color: var(--accent); }
.hero h1 {
  color: var(--ink); font-weight: 800; letter-spacing: -0.045em; line-height: 0.95;
  font-size: clamp(52px, 9.6vw, 112px);
}
.focus-line { font-family: var(--serif); font-style: italic; color: var(--accent); font-size: clamp(22px, 2.6vw, 32px); line-height: 1.3; margin-top: 18px; }
.focus-line .sep { color: var(--muted-2); padding: 0 .3em; }
.intro { max-width: 640px; margin-top: 22px; font-size: 17px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.portrait {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--card);
  aspect-ratio: 3 / 4; padding: 8px;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }

.hero-bottom { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; margin-top: 56px; }
.flow-card h2 { color: var(--muted); margin-bottom: 20px; font-weight: 500; }
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: 10px; }
.flow-step { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--bg); }
.flow-step.hl { border: 2px solid var(--accent); background: var(--accent-soft); }
.flow-step .num { color: var(--accent); display: block; margin-bottom: 6px; }
.flow-step strong { color: var(--ink); display: block; font-size: 15px; line-height: 1.3; }
.flow-step span.txt { font-size: 13px; color: var(--muted); display: block; margin-top: 6px; line-height: 1.45; }
.flow-arrow { display: grid; place-items: center; color: var(--muted-2); }
.flow-arrow svg { width: 18px; height: 18px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { padding: 20px; }
.tile .mono { color: var(--muted); display: block; margin-bottom: 8px; font-size: 11.5px; }
.tile p { color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.4; }

/* ---------- About ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; font-size: 16.5px; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 48px; }
.pillar .numeral { font-family: var(--serif); font-style: italic; color: var(--accent); font-size: 40px; line-height: 1; display: block; margin-bottom: 18px; }
.pillar h3 { color: var(--ink); font-size: 20px; letter-spacing: -0.01em; margin-bottom: 8px; }

/* ---------- Work ---------- */
.group { margin-top: 48px; }
.group-label { color: var(--muted); display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.group-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.project { display: flex; flex-direction: column; min-height: 230px; }
.project .num { color: var(--accent); }
.project h3 { color: var(--ink); font-size: 22px; letter-spacing: -0.02em; margin-top: 18px; line-height: 1.25; }
.project .pmeta { color: var(--muted); margin-top: 8px; font-size: 11.5px; }
.project p { margin-top: 12px; }
.project .more { margin-top: auto; padding-top: 18px; color: var(--ink); font-weight: 600; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; }
.project .more svg { width: 16px; height: 16px; transition: transform .2s; }
.project:hover .more svg { transform: translateX(3px); }

/* ---------- Timeline ---------- */
.timeline { margin-top: 48px; position: relative; padding-left: 36px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 40px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -36px; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--ink);
}
.tl-item:first-child::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.tl-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; align-items: baseline; }
.tl-head h3 { color: var(--ink); font-size: 19px; letter-spacing: -0.01em; line-height: 1.35; }
.tl-head .mono { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tl-org { color: var(--muted); margin-top: 4px; font-weight: 500; }
.tl-item ul { margin-top: 12px; display: grid; gap: 8px; }
.tl-item li { position: relative; padding-left: 18px; }
.tl-item li::before { content: ""; position: absolute; left: 0; top: 11px; width: 7px; height: 2px; background: var(--accent); }

/* ---------- Toolbox ---------- */
.toolbox { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 48px; align-items: start; }
.toolbox h3 { color: var(--ink); font-size: 18px; margin-bottom: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; color: var(--ink); background: var(--bg); font-weight: 500; }
.certs li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.certs li:first-child { border-top: 0; padding-top: 0; }
.certs .name { color: var(--ink); font-weight: 500; font-size: 14.5px; line-height: 1.4; }
.certs .mono { color: var(--muted); font-size: 11px; white-space: nowrap; padding-top: 3px; }

/* ---------- Community ---------- */
.community { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 48px; }
.community .card { padding: 22px; }
.community .mono { color: var(--accent); display: block; margin-bottom: 10px; }
.community p { color: var(--ink); font-weight: 500; font-size: 15px; line-height: 1.45; }

/* ---------- Contact ---------- */
.contact-panel {
  background: var(--dark); color: #CBD5E1; border-radius: 28px; text-align: center;
  padding: 88px 32px;
}
.contact-panel .section-label { color: var(--dark-accent); }
.contact-panel h2 { color: #fff; font-weight: 800; letter-spacing: -0.035em; font-size: clamp(36px, 6vw, 72px); line-height: 1.05; }
.contact-panel h2 .serif { color: var(--dark-accent); }
.contact-panel p { max-width: 560px; margin: 20px auto 0; font-size: 17px; }
.contact-panel .ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 34px; }

/* ---------- Footer ---------- */
.footer { padding: 48px 0 40px; }
.footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--muted); }
.footer a { color: var(--muted); }

/* ---------- Case study ---------- */
.case { padding-top: 56px; }
.back { display: inline-flex; gap: 8px; align-items: center; color: var(--body); text-decoration: none; font-weight: 600; font-size: 14px; }
.back svg { width: 16px; height: 16px; }
.case h1 { color: var(--ink); font-weight: 800; letter-spacing: -0.04em; font-size: clamp(38px, 6vw, 72px); line-height: 1.02; margin-top: 28px; max-width: 900px; }
.case .lead { font-size: 18px; max-width: 720px; margin-top: 18px; }
.case-media { margin-top: 40px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--card); padding: 8px; }
.case-media img { border-radius: 14px; width: 100%; max-height: 520px; object-fit: cover; }
.pal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; }
.pal h2 { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); font-size: 32px; margin-bottom: 10px; }
.case-side { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.case-side h2 { color: var(--muted); margin-bottom: 14px; font-weight: 500; }
.link-list { display: flex; flex-wrap: wrap; gap: 10px; }
a.card.next { margin-top: 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.next strong { color: var(--ink); font-size: 20px; letter-spacing: -0.01em; display: block; margin-top: 6px; }
.next svg { width: 22px; height: 22px; color: var(--ink); flex: none; }

/* ---------- AccessPilot architecture page ---------- */
.ap-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 24px; }
.ap-meta div { display: grid; gap: 4px; }
.ap-meta .mono { color: var(--muted); font-size: 11.5px; }
.ap-meta span:not(.mono) { color: var(--ink); font-weight: 600; font-size: 15px; }
.case-media.full img { max-height: none; object-fit: contain; }
.ap-note { margin-top: 18px; color: var(--muted); font-size: 14px; }
.arch-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; margin-top: 64px; align-items: start; }
.toc { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow-y: auto; padding-right: 8px; }
.toc-group { margin-bottom: 18px; }
.toc-group > .mono { color: var(--accent); display: block; margin-bottom: 6px; font-size: 11px; }
.toc a { display: flex; gap: 10px; padding: 4px 0; text-decoration: none; color: var(--body); font-size: 14px; line-height: 1.4; }
.toc a:hover { color: var(--ink); }
.toc a .mono { color: var(--muted-2); font-size: 11px; padding-top: 2px; }
.arch-body { display: grid; gap: 20px; }
.arch-sec { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; scroll-margin-top: 90px; min-width: 0; }
.arch-num { color: var(--accent); }
.arch-sec h2 { color: var(--ink); font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -0.02em; line-height: 1.2; margin: 8px 0 14px; }
.arch-sec h3 { color: var(--ink); font-size: 17px; margin: 22px 0 8px; }
.arch-sec p + p, .arch-sec p + ul, .arch-sec ul + p { margin-top: 12px; }
.arch-sec strong { color: var(--ink); }
.arch-sec ul { display: grid; gap: 8px; margin-top: 8px; }
.arch-sec li { position: relative; padding-left: 18px; }
.arch-sec li::before { content: ""; position: absolute; left: 0; top: 11px; width: 7px; height: 2px; background: var(--accent); }
.arch-sec code { font-family: var(--mono); font-size: 0.86em; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; overflow-wrap: anywhere; }
.badge { display: inline-block; vertical-align: middle; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 3px 9px; font-size: 10.5px; margin-left: 6px; }
.diagram { margin: 20px 0 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); padding: 20px; overflow-x: auto; }
.diagram pre.mermaid { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: pre; display: flex; justify-content: center; }
.diagram pre.mermaid svg { max-width: 100%; height: auto; }
.table-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; }
.arch-sec table { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 520px; }
.arch-sec th, .arch-sec td { text-align: left; padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.arch-sec thead th { border-top: 0; background: var(--bg); color: var(--muted); font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.arch-foot { color: var(--muted); text-align: center; margin-top: 12px; }
.tile .tile-link { display: inline-block; margin-top: 8px; color: var(--accent); font-size: 13px; font-weight: 600; }
.certs a.name { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.certs a.name:hover { text-decoration-color: var(--accent); }

@media (max-width: 1020px) {
  .arch-layout { grid-template-columns: 1fr; gap: 24px; margin-top: 40px; }
  .toc { position: static; max-height: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
  .toc-list { columns: 2; column-gap: 24px; }
  .toc-group { break-inside: avoid; }
}
@media (max-width: 560px) {
  .toc-list { columns: 1; }
  .arch-sec { padding: 22px; }
  .diagram { padding: 12px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .hero-bottom { grid-template-columns: 1fr; }
  .community { grid-template-columns: repeat(2, 1fr); }
  .toolbox { grid-template-columns: 1fr 1fr; }
  .toolbox .card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  :root { --pad: 20px; --gap-section: 72px; }
  .menu-btn { display: grid; }
  .nav-links {
    display: none; position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px var(--pad) 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 12px 0; font-size: 16px; }
  .hero { padding-top: 40px; }
  .hero-top { grid-template-columns: 1fr; gap: 32px; }
  .portrait { max-width: 260px; order: -1; }
  .two-col, .pillars, .work-grid, .pal, .case-side { grid-template-columns: 1fr; }
  .two-col { gap: 16px; }
  .flow { grid-template-columns: 1fr; }
  .flow-arrow svg { transform: rotate(90deg); }
  .contact-panel { padding: 64px 22px; border-radius: 22px; }
}

@media (max-width: 560px) {
  :root { --pad: 16px; }
  .pill-text { display: none; }
  .pill { padding: 10px 14px; }
  .tiles, .community, .toolbox { grid-template-columns: 1fr; }
  .card { padding: 22px; }
  .brand .name { display: none; }
  .btn { width: 100%; justify-content: center; }
  .contact-panel .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card.hover:hover, a.card:hover { transform: none; }
}
