/* MiSpace: the site reads as a conversation. Left-aligned type,
   speech-bubble shapes reserved for the moments where someone is talking. */
@font-face { font-family: "Hanken Grotesk"; src: url("../fonts/hanken-grotesk.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Unbounded"; src: url("../fonts/unbounded.woff2") format("woff2"); font-weight: 500 700; font-style: normal; font-display: swap; }

:root {
  --sky: #05b7fa;        /* the "Mi" blue */
  --sky-deep: #0086c2;   /* sky for text on white */
  --navy: #22303f;       /* the "SPACE" navy */
  --ink: #141d27;        /* deepest navy, footer and bands */
  --mist: #edf6fb;       /* blue-biased neutral surface */
  --line: #d5e3ec;
  --paper: #ffffff;
  --muted: #566676;
  --on-dark: #e8f1f7;
  --on-dark-muted: #9fb2c2;
  --online: #2fbf71;
  --error: #c0392b;
  --display: "Unbounded", "Trebuchet MS", "Segoe UI", sans-serif;
  --body: "Hanken Grotesk", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bubble-in: 24px 24px 24px 6px;   /* tail bottom-left, as in the logo */
  --bubble-out: 24px 24px 6px 24px;
  --max: 1160px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--navy);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
img { height: auto; }
[hidden] { display: none !important; }
a { color: var(--sky-deep); }
h1, h2, h3 { font-family: var(--display); color: var(--navy); line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.5rem); font-weight: 600; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 600; }
h3 { font-size: 1.0625rem; font-weight: 500; line-height: 1.35; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 4px; }

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.band { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.band-mist { background: var(--mist); }
.band-ink { background: var(--ink); color: var(--on-dark); }
.band-ink h2, .band-ink h3 { color: #fff; }
.lead { font-size: clamp(1.0625rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 58ch; }
.band-ink .lead { color: var(--on-dark-muted); }
.stack { display: flex; flex-direction: column; gap: 1.25rem; }
.section-head { display: flex; flex-direction: column; gap: 1rem; margin-bottom: clamp(2rem, 4vw, 3.25rem); max-width: 720px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--paper); padding: .5rem 1rem; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 600 1rem/1 var(--body); text-decoration: none; cursor: pointer;
  padding: .95rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--sky); color: var(--ink); }
.btn-primary:hover { background: var(--navy); color: #fff; }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-ghost { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-ghost:hover { background: var(--navy); color: #fff; }
.band-ink .btn-ghost { border-color: var(--on-dark); color: var(--on-dark); }
.band-ink .btn-ghost:hover { background: #fff; color: var(--ink); border-color: #fff; }
.band-ink .btn-primary:hover { background: #fff; color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.brand img { height: 38px; width: auto; }
.nav { display: flex; align-items: center; gap: 1.75rem; }
.nav a:not(.btn) { color: var(--navy); text-decoration: none; font-weight: 500; font-size: 1rem; padding-block: .4rem; border-bottom: 2px solid transparent; }
.nav a:not(.btn):hover { border-color: var(--line); }
.nav a[aria-current="page"] { border-color: var(--sky); }
.nav .btn { padding: .7rem 1.15rem; font-size: .9375rem; }
.nav-toggle { display: none; background: none; border: 0; padding: .6rem; cursor: pointer; color: var(--navy); }
.nav-toggle span { display: block; width: 24px; height: 2px; background: currentColor; margin: 5px 0; border-radius: 2px; }
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; gap: 0; padding: .5rem max(20px, env(safe-area-inset-right, 0px)) 1.25rem max(20px, env(safe-area-inset-left, 0px)); }
  .nav.is-open { display: flex; }
  .nav a:not(.btn) { padding-block: .85rem; border-bottom: 1px solid var(--line); }
  .nav a[aria-current="page"] { color: var(--sky-deep); border-color: var(--line); }
  .nav .btn { margin-top: 1rem; }
}

/* hero */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 1.5rem; }
.tagline { font-weight: 600; letter-spacing: .22em; text-transform: uppercase; font-size: .8125rem; color: var(--navy); display: flex; flex-wrap: wrap; gap: .5rem .9rem; }
.tagline span + span::before { content: "|"; margin-right: .9rem; color: var(--sky); }
.thread { background: var(--mist); border-radius: 32px; padding: clamp(1.25rem, 3vw, 2rem); display: flex; flex-direction: column; gap: .8rem; }
.thread-top { display: flex; align-items: center; gap: .6rem; font-size: .875rem; font-weight: 600; color: var(--muted); padding-bottom: .5rem; }
.dot-online { width: 10px; height: 10px; border-radius: 50%; background: var(--online); flex: none; }
.msg { max-width: 86%; padding: .85rem 1.1rem; font-size: 1rem; line-height: 1.45; }
.msg-them { align-self: flex-end; background: var(--paper); border-radius: var(--bubble-out); color: var(--navy); }
.msg-us { align-self: flex-start; background: var(--sky); border-radius: var(--bubble-in); color: var(--ink); font-weight: 500; }
.msg-us.is-navy { background: var(--navy); color: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .thread .msg { animation: pop .45s cubic-bezier(.2, .8, .3, 1.2) both; }
  .thread .msg:nth-of-type(1) { animation-delay: .2s; }
  .thread .msg:nth-of-type(2) { animation-delay: 1.1s; }
  .thread .msg:nth-of-type(3) { animation-delay: 2s; }
  .thread .msg:nth-of-type(4) { animation-delay: 2.9s; }
  .thread .msg:nth-of-type(5) { animation-delay: 3.7s; }
  @keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.96); } }
}
@media (max-width: 860px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }

/* page hero (inner pages) */
.page-hero { background: var(--mist); padding-block: clamp(3rem, 7vw, 5.5rem); }
.page-hero .wrap { display: flex; flex-direction: column; gap: 1.25rem; }
.page-hero h1 { max-width: 20ch; }

/* connect / support / grow rows */
.csg { border-top: 2px solid var(--navy); }
.csg-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1rem 3rem; padding-block: clamp(1.75rem, 4vw, 2.75rem); border-bottom: 1px solid var(--line); align-items: baseline; }
.csg-word { font-family: var(--display); font-weight: 700; font-size: clamp(2.25rem, 7vw, 4.75rem); line-height: 1; letter-spacing: -0.03em; color: var(--navy); }
.csg-row:nth-child(2) .csg-word { color: var(--sky); }
.csg-row p { color: var(--muted); max-width: 52ch; }
.csg-row .stack { gap: .75rem; }
.csg-row strong { color: var(--navy); font-size: 1.1875rem; }
@media (max-width: 720px) { .csg-row { grid-template-columns: minmax(0, 1fr); } }

/* two disciplines */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.duo-side { padding: clamp(1.5rem, 3.5vw, 2.5rem); display: flex; flex-direction: column; gap: 1.25rem; }
.duo-side.is-support { background: var(--sky); color: var(--ink); border-radius: 32px 32px 32px 8px; }
.duo-side.is-software { background: var(--navy); color: var(--on-dark); border-radius: 32px 32px 8px 32px; }
.duo-side h3 { font-size: clamp(1.25rem, 2.2vw, 1.625rem); font-weight: 600; color: inherit; }
.duo-side.is-software h3 { color: #fff; }
.duo-side li { padding-block: .7rem; border-top: 1px solid rgb(20 29 39 / .18); font-weight: 500; }
.duo-side.is-software li { border-color: rgb(255 255 255 / .16); }
.duo-side a { color: inherit; font-weight: 600; margin-top: auto; }
@media (max-width: 760px) { .duo { grid-template-columns: minmax(0, 1fr); } }

/* service lists (services page) */
.svc { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 2rem 4rem; }
.svc-intro { display: flex; flex-direction: column; gap: 1rem; align-self: start; position: sticky; top: 120px; }
.svc-intro p { color: var(--muted); }
.svc-list > li { display: grid; grid-template-columns: minmax(0, 1fr); gap: .4rem; padding-block: 1.4rem; border-top: 1px solid var(--line); }
.svc-list > li:last-child { border-bottom: 1px solid var(--line); }
.svc-list p { color: var(--muted); max-width: 60ch; }
.band-mist .svc-list > li { border-color: #c9dbe6; }
@media (max-width: 820px) { .svc { grid-template-columns: minmax(0, 1fr); } .svc-intro { position: static; } }

/* process steps: a real sequence */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; counter-reset: step; }
.steps li { counter-increment: step; display: flex; flex-direction: column; gap: .6rem; padding-top: 1.25rem; border-top: 2px solid var(--sky); }
.steps li::before { content: "Step " counter(step); font-size: .875rem; font-weight: 600; color: var(--on-dark-muted); }
.steps p { color: var(--on-dark-muted); }
@media (max-width: 760px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* loop: support feeds software */
.loop { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.loop li { background: var(--paper); padding: 1.25rem 1.4rem; border-radius: var(--bubble-in); display: flex; flex-direction: column; gap: .4rem; }
.loop li:nth-child(2) { border-radius: var(--bubble-out); background: var(--navy); color: var(--on-dark); }
.loop li:nth-child(2) h3 { color: #fff; }
.loop p { font-size: 1rem; }
@media (max-width: 760px) { .loop { grid-template-columns: minmax(0, 1fr); } }

/* work */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.filters button { font: 600 .9375rem/1 var(--body); padding: .7rem 1.1rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); color: var(--navy); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.25rem 1.75rem; }
.work-item { display: flex; flex-direction: column; gap: .7rem; min-width: 0; }
.work-item .shot { border-radius: 18px; overflow: hidden; background: var(--mist); aspect-ratio: 4 / 3; }
.work-item .shot svg { width: 100%; height: 100%; }
.work-item .shot img { width: 100%; height: 100%; object-fit: cover; }
.work-meta { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .8125rem; font-weight: 600; }
.work-meta span { padding: .25rem .65rem; border-radius: 999px; background: var(--mist); color: var(--navy); }
.band-mist .work-meta span { background: var(--paper); }
.work-meta .is-example, .band-mist .work-meta .is-example { background: transparent; border: 1px dashed var(--muted); color: var(--muted); }
.work-item p { color: var(--muted); font-size: 1rem; }
@media (max-width: 900px) { .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 580px) { .work-grid { grid-template-columns: minmax(0, 1fr); } }

/* about */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 2rem 4rem; align-items: start; }
.split .prose { display: flex; flex-direction: column; gap: 1.1rem; color: var(--muted); }
.split .prose p { max-width: 62ch; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.facts div { border-top: 2px solid var(--navy); padding-top: 1rem; display: flex; flex-direction: column; gap: .25rem; }
.facts dt { font-size: .9375rem; color: var(--muted); }
.facts dd { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(1.125rem, 2vw, 1.5rem); color: var(--navy); }
.values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.values li { display: flex; flex-direction: column; gap: .5rem; }
.values p { color: var(--muted); }
@media (max-width: 820px) { .split, .facts, .values { grid-template-columns: minmax(0, 1fr); } }

/* contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); gap: 2.5rem 4rem; align-items: start; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field.is-wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .9375rem; }
.field input, .field select, .field textarea {
  font: inherit; color: var(--navy); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: 12px; padding: .8rem .95rem; width: 100%;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgb(5 183 250 / .25); }
.form-note { grid-column: 1 / -1; font-size: .9375rem; color: var(--muted); }
.form-note.is-error { color: var(--error); font-weight: 600; }
.contact-card { background: var(--mist); border-radius: 32px 32px 32px 8px; padding: clamp(1.5rem, 3vw, 2.25rem); display: flex; flex-direction: column; gap: 1.5rem; }
.contact-card dl { margin: 0; display: flex; flex-direction: column; gap: 1.1rem; }
.contact-card dt { font-size: .875rem; color: var(--muted); font-weight: 600; }
.contact-card dd { margin: 0; font-weight: 600; font-size: 1.0625rem; overflow-wrap: anywhere; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .form { grid-template-columns: minmax(0, 1fr); } }

.faq { max-width: 780px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding-block: 1.15rem; font-weight: 600; font-size: 1.0625rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--sky-deep); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding-bottom: 1.25rem; color: var(--muted); max-width: 64ch; }

/* text pages (privacy policy and any other standard page) */
.legal { max-width: 720px; display: flex; flex-direction: column; gap: 1rem; color: var(--muted); }
.legal h2 { font-size: 1.25rem; margin-top: 1.25rem; }
.legal h3 { margin-top: .75rem; }
.legal ul { list-style: disc; padding-left: 1.25rem; }
.post-list li { padding-block: 1rem; border-top: 1px solid var(--line); }
.post-list a { font-weight: 600; text-decoration: none; }

/* closing call */
.closing .wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 1.75rem; }
.closing-bubble { background: var(--sky); color: var(--ink); border-radius: 40px 40px 40px 10px; padding: clamp(1.5rem, 4vw, 2.75rem) clamp(1.5rem, 5vw, 3.5rem); font-family: var(--display); font-weight: 600; font-size: clamp(1.75rem, 5vw, 3.5rem); line-height: 1.1; letter-spacing: -0.02em; }

/* footer */
.site-footer { background: var(--ink); color: var(--on-dark-muted); padding-block: 3.5rem 2rem; font-size: 1rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
.footer-grid img { width: 210px; }
.footer-grid h3 { color: #fff; font-family: var(--body); font-weight: 600; font-size: 1rem; margin-bottom: .9rem; }
.footer-grid li { margin-bottom: .55rem; overflow-wrap: anywhere; }
.site-footer a { color: var(--on-dark); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-base { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgb(255 255 255 / .1); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; font-size: .9375rem; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* chat assistant */
.chat-launch {
  position: fixed; z-index: 80;
  right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: 64px; height: 60px; border: 0; cursor: pointer;
  background: var(--sky); border-radius: 22px 22px 22px 6px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 10px 28px rgb(20 29 39 / .28);
}
.chat-launch i { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.chat-launch:hover { background: var(--navy); }
.chat-launch[aria-expanded="true"] i { display: none; }
.chat-launch[aria-expanded="true"]::before { content: "\00d7"; color: #fff; font-size: 2rem; line-height: 1; }
.chat-teaser {
  position: fixed; z-index: 79;
  right: calc(96px + env(safe-area-inset-right, 0px)); bottom: calc(26px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: .25rem;
  background: var(--paper); color: var(--navy); border-radius: var(--bubble-out);
  box-shadow: 0 10px 28px rgb(20 29 39 / .2); padding: .3rem .4rem .3rem 0; max-width: calc(100vw - 130px);
}
.chat-teaser button { background: none; border: 0; cursor: pointer; font: 600 1rem/1.3 var(--body); color: inherit; padding: .6rem .5rem .6rem 1.1rem; text-align: left; }
.chat-teaser .x { padding: .4rem .6rem; font-size: 1.2rem; color: var(--muted); }
.chat-panel {
  position: fixed; z-index: 80;
  right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px));
  background: var(--paper); border-radius: 24px; overflow: hidden;
  box-shadow: 0 24px 60px rgb(20 29 39 / .35); display: flex; flex-direction: column;
}
.chat-head { background: var(--navy); color: #fff; padding: 1rem 1.2rem; display: flex; align-items: center; gap: .75rem; }
.chat-head strong { display: block; font-family: var(--display); font-weight: 500; font-size: .9375rem; }
.chat-head small { color: var(--on-dark-muted); font-size: .8125rem; }
.chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; background: var(--mist); }
.chat-log .msg { font-size: .9375rem; padding: .7rem .95rem; white-space: pre-line; overflow-wrap: anywhere; }
.chat-log .msg-us { background: var(--paper); color: var(--navy); font-weight: 400; }
.chat-log .msg-them { background: var(--sky); color: var(--ink); }
.chat-opts { display: flex; flex-wrap: wrap; gap: .4rem; }
.chat-opts button, .chat-opts a { font: 600 .875rem/1.2 var(--body); padding: .55rem .85rem; border-radius: 999px; border: 1.5px solid var(--navy); background: var(--paper); color: var(--navy); cursor: pointer; text-decoration: none; }
.chat-opts button:hover, .chat-opts a:hover { background: var(--navy); color: #fff; }
.typing { align-self: flex-start; background: var(--paper); border-radius: var(--bubble-in); padding: .8rem 1rem; display: flex; gap: 5px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--sky); }
@media (prefers-reduced-motion: no-preference) {
  .typing i { animation: blink 1s infinite; }
  .typing i:nth-child(2) { animation-delay: .15s; }
  .typing i:nth-child(3) { animation-delay: .3s; }
  @keyframes blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
}
.chat-form { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--line); background: var(--paper); }
.chat-form input { flex: 1; min-width: 0; font: inherit; font-size: 1rem; border: 1.5px solid var(--line); border-radius: 999px; padding: .65rem 1rem; color: var(--navy); background: var(--paper); }
.chat-form input:focus { outline: none; border-color: var(--sky); }
.chat-form button { font: 600 .9375rem/1 var(--body); border: 0; border-radius: 999px; background: var(--sky); color: var(--ink); padding: 0 1.1rem; cursor: pointer; }
.chat-form button:hover { background: var(--navy); color: #fff; }

/* WordPress admin bar */
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { body.admin-bar .site-header { top: 0; } }
