/* ============================================================================
   AIA4 — aia4.io site stylesheet
   Built on the AIA4 Design System tokens. 0px radius. 1px borders. No shadows.
   ============================================================================ */
@import url("fonts.css");
@import url("colors.css");
@import url("typography.css");
@import url("spacing.css");
@import url("motion.css");
@import url("base.css");

/* ---- Page chrome ------------------------------------------------------- */
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: .04;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2"/></filter><rect width="120" height="120" filter="url(%23n)"/></svg>');
}
.centerline { position: fixed; left: 50%; top: 0; bottom: 0; width: 1px; background: rgba(237,237,236,.08); z-index: 0; }

/* ---- Type voices -------------------------------------------------------- */
.meta, .aia4-meta {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500; text-transform: uppercase; letter-spacing: .08em;
  font-size: 12px;
}
.h-display, .h1, .h2, .h3 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600; text-transform: uppercase;
  letter-spacing: -.04em; line-height: .88; margin: 0;
}
.h1 { font-weight: 700; font-size: clamp(44px, 7.2vw, 110px); }
.h2 { font-size: clamp(30px, 3.4vw, 42px); }
.h3 { font-size: clamp(20px, 2vw, 26px); }
.lead { font-size: 20px; color: var(--text-secondary); max-width: 60ch; }
p { max-width: 65ch; }
a { color: inherit; }

/* ---- Nav ---------------------------------------------------------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 40px;
  background: var(--bg-glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
}
.nav img { height: 32px; object-fit: contain; display: block; }
.nav .links { display: flex; gap: 10px; align-items: center; }
.nav .links a { text-decoration: none; transition: color .2s; }
.nav .links a:hover { color: var(--crimson); }
.nav .links .sep { color: var(--bone-faint); }
.nav .links .book { color: var(--crimson); }
.nav-burger { display: none; }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  font-family: "Space Grotesk", sans-serif; font-weight: 600;
  text-transform: uppercase; letter-spacing: .02em; font-size: 14px;
  padding: 14px 28px; border: 1px solid transparent;
  background: var(--action-primary); color: var(--bone);
  transition: all .2s cubic-bezier(.16,1,.3,1);
}
/* NOTE: base.css sets a:hover{color:var(--crimson)} — buttons are <a>, so hover
   text color must be pinned or crimson-on-crimson renders "blank". */
.btn:hover, a.btn:hover { background: var(--action-primary-hover); color: var(--bone); }
.btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.btn.ghost { background: transparent; border-color: currentColor; color: var(--bone); }
.btn.ghost:hover, a.btn.ghost:hover { background: var(--bone); color: var(--carbon); border-color: var(--bone); }

/* ---- Layout primitives -------------------------------------------------- */
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 40px; box-sizing: border-box; }
.section { position: relative; padding: 96px 0; border-top: 1px solid var(--border-light); }
.section-head { display: flex; align-items: baseline; gap: 24px; margin-bottom: 64px; }
.section-head .num { color: var(--crimson); }
.section-head .meta { color: var(--bone-dim); }
.grid { display: grid; gap: 24px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: 5fr 7fr; gap: 64px; align-items: start; }

/* ---- Hero ---------------------------------------------------------------- */
.hero { position: relative; min-height: 92vh; display: grid; place-items: center; padding: 140px 40px 90px; box-sizing: border-box; }
.hero.short { min-height: 64vh; }
.frame { position: relative; border: 1px solid var(--border); padding: 72px 64px; max-width: 1000px; text-align: center; }
.frame.left { text-align: left; }
.dot { position: absolute; width: 6px; height: 6px; border-radius: 999px; background: var(--bone); }
.dot.tl { left: -3px; top: -3px; } .dot.tr { right: -3px; top: -3px; }
.dot.bl { left: -3px; bottom: -3px; } .dot.br { right: -3px; bottom: -3px; }
.cta-row { display: flex; gap: 12px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.frame.left .cta-row { justify-content: flex-start; }
.statusbar { position: absolute; left: 40px; right: 40px; bottom: 24px; display: flex; justify-content: space-between; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }
.pulse { display: inline-block; width: 6px; height: 6px; border-radius: 999px; background: var(--crimson); margin-right: 8px; animation: pulse 2s infinite; }

/* ---- Cards --------------------------------------------------------------- */
.card {
  position: relative; border: 1px solid var(--border); padding: 24px;
  display: flex; flex-direction: column; gap: 12px; background: transparent;
  transition: border-color .2s;
}
.card:hover { border-color: var(--bone); }
.card .meta { color: var(--bone-dim); }
.card h3 { margin: 0; }
.card p { color: var(--text-secondary); font-size: 15px; margin: 0; }
.card .foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border-light); color: var(--bone-faint); display: flex; justify-content: space-between; }
a.card { text-decoration: none; }
a.card:hover .foot { color: var(--crimson); }

/* ---- Stats --------------------------------------------------------------- */
.stat { border-left: 1px solid var(--border); padding-left: 24px; }
.stat .n { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: clamp(42px, 4.8vw, 68px); letter-spacing: -.04em; line-height: .9; }
.stat .n em { font-style: normal; color: var(--crimson); }
.stat .l { color: var(--bone-dim); margin-top: 12px; }

/* ---- Numbered rows (process / principles / dimensions) ------------------- */
.rows { border-top: 1px solid var(--border); }
.row { display: grid; grid-template-columns: 96px 1fr 2fr; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.row .idx { font-family: "IBM Plex Mono", monospace; color: var(--crimson); font-size: 14px; }
.row h3 { margin: 0; }
.row p { color: var(--text-secondary); margin: 0; }

/* ---- Accordion (FAQ) ------------------------------------------------------ */
details { border-bottom: 1px solid var(--border); }
details summary {
  cursor: pointer; list-style: none; display: grid; grid-template-columns: 72px 1fr 24px;
  gap: 16px; padding: 20px 0; align-items: baseline;
  font-family: "Space Grotesk", sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: -.01em;
}
details summary::-webkit-details-marker { display: none; }
details summary .idx { font-family: "IBM Plex Mono", monospace; color: var(--crimson); font-size: 13px; font-weight: 500; }
details summary .mark { color: var(--bone-faint); text-align: right; }
details[open] summary .mark { color: var(--crimson); }
details .a { padding: 0 0 24px 88px; color: var(--text-secondary); max-width: 65ch; }

/* ---- CTA band ------------------------------------------------------------- */
.band { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 80px 0; text-align: center; }
.band .h2 { margin-bottom: 24px; }

/* ---- Forms ---------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.field label { font-family: "IBM Plex Mono", monospace; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--bone-dim); }
.field input, .field textarea, .field select {
  background: transparent; border: 1px solid var(--border); color: var(--bone);
  font-family: "Space Grotesk", sans-serif; font-size: 16px; padding: 12px 14px; border-radius: 0;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--bone); }

/* ---- Footer ---------------------------------------------------------------- */
footer { border-top: 1px solid var(--border); padding: 64px 0 40px; position: relative; z-index: 1; background: var(--bg-page); }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.foot-grid .meta { color: var(--bone-dim); margin-bottom: 16px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.foot-grid a { text-decoration: none; color: var(--text-secondary); transition: color .2s; }
.foot-grid a:hover { color: var(--crimson); }
.foot-base { display: flex; justify-content: space-between; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--border-light); color: var(--bone-faint); flex-wrap: wrap; gap: 12px; }

/* ---- Article / legal body -------------------------------------------------- */
.prose { max-width: 65ch; }
.prose h2 { font-family: "Space Grotesk", sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: -.02em; font-size: 22px; margin: 48px 0 16px; }
.prose p, .prose li { color: var(--text-secondary); }
.prose .idx { color: var(--crimson); font-family: "IBM Plex Mono", monospace; font-size: 14px; margin-right: 12px; }

/* ---- Booking modal ------------------------------------------------------------ */
.aia4-modal {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center;
  padding: 20px; box-sizing: border-box;
  background: rgba(7,7,7,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.aia4-modal[hidden] { display: none; }
.aia4-modal .box {
  position: relative; background: var(--carbon); border: 1px solid var(--border);
  padding: 40px; max-width: 680px; width: 100%; max-height: calc(100dvh - 40px); overflow: auto;
}
.aia4-modal .box .dot { position: absolute; width: 6px; height: 6px; border-radius: 999px; background: var(--bone); }
.aia4-modal .close {
  position: absolute; top: 0; right: 0; border: none; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: transparent; color: var(--bone-dim); font-family: "IBM Plex Mono", monospace;
  font-size: 12px; letter-spacing: .08em; padding: 10px 14px; cursor: pointer;
}
.aia4-modal .close:hover { color: var(--crimson); }
.aia4-modal .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 560px) { .aia4-modal .grid2 { grid-template-columns: 1fr; } .aia4-modal .box { padding: 28px 20px; } }
body.aia4-modal-open { overflow: hidden; }

/* ---- Mobile thumb nav -------------------------------------------------------- */
.thumbnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
  display: none; grid-template-columns: repeat(4, 1fr);
  background: var(--bg-glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.thumbnav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 56px; text-decoration: none;
  font-family: "IBM Plex Mono", monospace; font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .08em; color: var(--bone-dim);
  border-left: 1px solid var(--border-light);
}
.thumbnav a:first-child { border-left: none; }
.thumbnav a .g { font-size: 16px; line-height: 1; font-family: "Space Grotesk", sans-serif; }
.thumbnav a.active, .thumbnav a:hover { color: var(--crimson); }
.thumbnav a.cta { color: var(--bone); background: var(--action-primary); }
.thumbnav a.cta:hover { color: var(--bone); background: var(--action-primary-hover); }
@media (max-width: 820px) {
  .thumbnav { display: grid; }
  body { padding-bottom: 64px; }
}

/* ---- Responsive ------------------------------------------------------------- */
@media (max-width: 960px) {
  .grid.c3, .grid.c4 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 40px; }
  .row { grid-template-columns: 56px 1fr; }
  .row p { grid-column: 2; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  .hero { padding: 120px 20px 80px; }
  .frame { padding: 48px 24px; }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
  .nav { padding: 12px 20px; }
  .nav .links { display: none; }
  .nav .links.open { display: flex; position: fixed; inset: 57px 0 auto 0; flex-direction: column; align-items: flex-start; gap: 0; background: var(--carbon); border-bottom: 1px solid var(--border); }
  .nav .links.open a { padding: 16px 20px; width: 100%; box-sizing: border-box; border-top: 1px solid var(--border-light); }
  .nav .links.open .sep { display: none; }
  .nav-burger { display: block; background: none; border: 1px solid var(--border); color: var(--bone); font-family: "IBM Plex Mono", monospace; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 8px 12px; cursor: pointer; }
  .statusbar { left: 20px; right: 20px; }
  details .a { padding-left: 0; }
}
