@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/ibm-plex-sans-latin.woff2) format("woff2");
}

/* Tokens. Colours come from the Royal Dusk logo. Violet is the one accent; the dusk gradient is for hairlines only. */
:root {
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --bg: #F6F4FB;
  --band: #FDFCFF;
  --card: #FFFFFF;
  --raise: #ECE7F7;
  --text: #1A1033;
  --muted: #4A4068;
  --rule: #D5CDE8;
  --border-strong: #8A7DB3;
  --accent: #7A24C9;
  --accent-hover: #6519AE;
  --accent-active: #55139A;
  --night: #120A24;
  --dusk: linear-gradient(90deg, #F7971E, #D9497A 55%, #8E2DE2);
  --radius: 12px;
  --btn-radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 4.6vw, 3.75rem); line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.875rem, 3.2vw, 2.5rem); line-height: 1.1; letter-spacing: -0.015em; }
h3 { font-size: 1.25rem; line-height: 1.3; letter-spacing: -0.005em; }
.lede { font-size: 1.25rem; line-height: 1.5; color: var(--muted); }
.small { font-size: .875rem; line-height: 1.45; font-weight: 500; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--btn-radius); }

.wrap { max-width: 1168px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.skip { position: absolute; left: 16px; top: -64px; background: var(--text); color: #fff; padding: 10px 16px; border-radius: var(--btn-radius); z-index: 30; }
.skip:focus { top: 12px; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 22px; border-radius: var(--btn-radius);
  font: 500 1rem/1 var(--font); letter-spacing: 0; white-space: nowrap; text-decoration: none;
  color: #fff; background: var(--accent); border: 1px solid transparent; cursor: pointer;
  box-shadow: 0 1px 2px rgba(26, 16, 51, .18);
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.button:hover { background: var(--accent-hover); box-shadow: 0 2px 6px rgba(26, 16, 51, .22); }
.button:active { background: var(--accent-active); box-shadow: none; transform: translateY(1px); }
.button.quiet { color: var(--text); background: var(--card); border-color: var(--border-strong); box-shadow: none; }
.button.quiet:hover { background: var(--raise); border-color: var(--text); }
.button.quiet:active { background: #E2DAF3; }
.button.on-dark { background: #fff; color: var(--night); }
.button.on-dark:hover { background: #E7E0F7; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: rgba(246, 244, 251, .86); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid transparent; padding-top: env(safe-area-inset-top); transition: border-color .2s ease; }
.top.scrolled { border-bottom-color: var(--rule); }
.nav { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav .logo { flex: none; }
.nav .logo img { height: 38px; width: auto; max-width: none; }
.nav ul { display: flex; align-items: center; gap: 30px; }
.nav li a:not(.button) { text-decoration: none; font-size: .9375rem; font-weight: 500; color: var(--muted); transition: color .15s ease; }
.nav li a:not(.button):hover, .nav li a:not(.button)[aria-current="page"] { color: var(--text); }
.nav li.link a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 8px; }
.nav .button { height: 40px; padding: 0 16px; font-size: .9375rem; }
.nav .menu { display: none; position: relative; }
.nav .menu summary { list-style: none; cursor: pointer; width: 40px; height: 40px; border-radius: var(--btn-radius); border: 1px solid var(--border-strong); background: var(--card); display: grid; place-content: center; gap: 5px; }
.nav .menu summary::-webkit-details-marker { display: none; }
.nav .menu summary span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text); }
.nav .menu .sheet { position: fixed; left: 16px; right: 16px; top: calc(72px + env(safe-area-inset-top)); background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 24px 48px -20px rgba(26, 16, 51, .35); padding: 8px; display: grid; }
.nav .menu .sheet a { padding: 14px; border-radius: 8px; font-weight: 500; text-decoration: none; }
.nav .menu .sheet a:hover, .nav .menu .sheet a:focus-visible, .nav .menu .sheet a[aria-current="page"] { background: var(--raise); }
.sentinel { position: absolute; top: 0; height: 8px; width: 1px; }

/* Home hero */
.hero { padding-top: 72px; padding-bottom: 8px; text-align: center; }
.hero h1 { max-width: 18ch; margin: 0 auto; }
.hero .lede { max-width: 50ch; margin: 22px auto 0; }
.hero .actions { margin-top: 34px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.flow {
  margin-top: 64px; text-align: left;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--card); border: 1px solid var(--rule); border-radius: 20px;
  box-shadow: 0 24px 56px -32px rgba(26, 16, 51, .35);
  position: relative; overflow: hidden;
}
.flow::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--dusk); }
.flow li { padding: 40px 36px 38px; position: relative; }
.flow li + li { border-left: 1px solid var(--rule); }
.flow li + li::before {
  content: ""; position: absolute; left: -9px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  background: var(--card); border-top: 2px solid var(--accent); border-right: 2px solid var(--accent);
  transform: rotate(45deg); border-radius: 0 3px 0 0;
}
.flow .k { color: var(--accent); }
.flow h3 { margin-top: 8px; font-size: 1.625rem; line-height: 1.15; letter-spacing: -0.012em; }
.flow p { margin-top: 8px; color: var(--muted); }

/* Inner page header */
.page-head { padding-top: 88px; padding-bottom: 64px; }
.page-head h1 { max-width: 20ch; }
.page-head .lede { margin-top: 20px; max-width: 58ch; }
.page-head .actions { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.page-head .note { color: var(--muted); }

/* Sections */
.section { padding-top: 104px; padding-bottom: 104px; }
.page-head + .section, .page-head + .product, .product + .section { padding-top: 0; }
.band { background: var(--band); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section .lede { margin-top: 14px; max-width: 52ch; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 48px; }
.section-head .button { height: 44px; padding: 0 20px; font-size: .9375rem; }
.label { color: var(--accent); margin-bottom: 12px; }

/* Product: one dark panel */
.product { padding-bottom: 104px; padding-top: 104px; }
.panel { background: var(--night); color: #F3EFFC; border-radius: 24px; padding: 64px; position: relative; overflow: hidden; }
.panel::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--dusk); }
.panel .label { color: #C29BFA; }
.panel .lede { color: #D9D1EC; max-width: 52ch; margin-top: 16px; }
.panel .head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 28px 48px; }
.pipeline { margin-top: 28px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: relative; }
.pipeline::before { content: ""; position: absolute; left: 14px; right: 25%; top: 13px; height: 2px; background: #3A2C5E; }
.pipeline li { position: relative; padding: 0 24px 0 0; }
.pipeline .node { width: 28px; height: 28px; border-radius: 50%; background: var(--night); border: 2px solid #C29BFA; display: grid; place-items: center; font-size: .8125rem; font-weight: 600; color: #C29BFA; position: relative; }
.pipeline h3 { margin-top: 20px; font-size: 1.375rem; }
.pipeline p { margin-top: 8px; color: #C9C0DE; font-size: 1rem; line-height: 1.5; max-width: 24ch; }
.panel .block { margin-top: 52px; }
.panel > .block:first-child { margin-top: 0; }
.panel .sub { font-size: .875rem; font-weight: 500; letter-spacing: 0; color: #C29BFA; }
.uses { margin-top: 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.uses li { background: #1D1336; border: 1px solid #33275A; border-radius: 12px; padding: 18px 20px; font-size: 1.125rem; font-weight: 500; line-height: 1.3; }
.spec { margin-top: 52px; padding-top: 28px; border-top: 1px solid #33275A; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 32px; }
.spec dt { font-size: .875rem; font-weight: 500; color: #C29BFA; }
.spec dd { margin-top: 4px; color: #F3EFFC; font-size: 1rem; line-height: 1.45; }

/* Cards */
.cards { margin-top: 48px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.page-head + .section > .cards:first-child { margin-top: 0; }
.cards li { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px 24px 26px; }
.cards p { margin-top: 6px; color: var(--muted); font-size: 1rem; line-height: 1.5; }
.models { margin-top: 32px; padding: 28px 28px 30px; background: var(--band); border: 1px solid var(--rule); border-radius: var(--radius); display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 10px 40px; align-items: start; }
.models h2 { font-size: 1.25rem; line-height: 1.3; letter-spacing: -0.005em; }
.models p { color: var(--muted); max-width: 66ch; }
.work .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.work .cards li { background: var(--card); padding: 28px 28px 30px; display: flex; flex-direction: column; }
.work .cards h3 { margin-top: 10px; font-size: 1.375rem; }
.work .sector { color: var(--accent); }
.work .tags { margin-top: auto; padding-top: 18px; }
.work .tags span { display: block; padding-top: 14px; border-top: 1px solid var(--rule); color: var(--muted); }

/* Home page summaries: names and titles only, the detail lives on each page */
.names { margin-top: 40px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 40px; border-bottom: 1px solid var(--rule); }
.names li { padding: 18px 0; border-top: 1px solid var(--rule); font-size: 1.125rem; font-weight: 500; letter-spacing: -0.005em; }
.rows { margin-top: 40px; border-bottom: 1px solid var(--rule); }
.rows li { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 4px 40px; align-items: baseline; padding: 22px 0; border-top: 1px solid var(--rule); }
.rows p { color: var(--muted); }

/* Project steps on a light ground; the content is a real sequence */
.steps { margin-top: 48px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.steps li { border-top: 2px solid var(--accent); padding-top: 20px; }
.steps .n { color: var(--accent); }
.steps h3 { margin-top: 6px; }
.steps p { margin-top: 6px; color: var(--muted); font-size: 1rem; line-height: 1.5; }

/* Three points */
.why ul { margin-top: 48px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.why li::before { content: ""; display: block; width: 56px; height: 3px; border-radius: 2px; background: var(--dusk); margin-bottom: 20px; }
.why p { margin-top: 6px; color: var(--muted); }

/* About */
.about .pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.about article { background: var(--card); border: 1px solid var(--rule); border-radius: 16px; padding: 32px 32px 34px; position: relative; overflow: hidden; }
.about article::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--dusk); }
.about article h2 { color: var(--accent); font-size: 1rem; letter-spacing: 0; }
.about article p { margin-top: 12px; font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.3; letter-spacing: -0.01em; font-weight: 500; }
.about .founder { margin-top: 32px; background: var(--card); border: 1px solid var(--rule); border-radius: 16px; padding: 40px; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 28px 56px; align-items: start; }
.about .founder .who { padding-right: 40px; border-right: 1px solid var(--rule); }
.about .founder .mono { width: 88px; height: 88px; border-radius: 50%; background: var(--raise); border: 1px solid var(--rule); color: var(--accent); display: grid; place-items: center; font-size: 1.75rem; font-weight: 600; letter-spacing: -0.012em; margin-bottom: 22px; }
.about .founder h3 { font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.012em; }
.about .founder .role { margin-top: 6px; color: var(--accent); font-size: .9375rem; font-weight: 500; }
.about .founder .bio p + p { margin-top: 16px; }
.about .founder .bio p { color: var(--text); line-height: 1.7; max-width: 64ch; }
.about .founder .button { margin-top: 24px; height: 44px; }

/* Contact */
.section.contact { padding-top: 88px; }
.contact .inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px 72px; align-items: start; }
.contact .lede { margin-top: 20px; }
.next { margin-top: 28px; display: grid; gap: 14px; }
.next li { display: grid; grid-template-columns: 28px 1fr; gap: 14px; align-items: center; }
.next span { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); display: grid; place-items: center; font-size: .8125rem; font-weight: 600; }
.contact .direct { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--rule); display: grid; gap: 16px; }
.contact .direct dt { font-size: .875rem; font-weight: 500; color: var(--muted); }
.contact .direct dd { margin-top: 2px; }
.contact .direct a { color: var(--accent); font-weight: 500; text-underline-offset: 4px; overflow-wrap: anywhere; }
.form { background: var(--card); border: 1px solid var(--rule); border-radius: 16px; padding: 28px; display: grid; gap: 18px; box-shadow: 0 16px 40px -28px rgba(26, 16, 51, .35); }
.field { display: grid; gap: 8px; }
.field label { font-size: .9375rem; font-weight: 500; }
.field input, .field textarea, .field select {
  width: 100%; font: 400 1rem/1.5 var(--font); color: var(--text);
  background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--btn-radius);
  padding: 11px 14px;
}
.field textarea { min-height: 128px; resize: vertical; }
.field select { height: 48px; padding-top: 0; padding-bottom: 0; }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field .hint { font-size: .875rem; color: var(--muted); }
.hp { position: absolute; left: -9999px; }
.form .button { width: 100%; }
.form .button[disabled] { opacity: .6; cursor: default; }
.form .consent { font-size: .875rem; color: var(--muted); }
.form .consent a { color: var(--accent); text-underline-offset: 3px; }
.form .status { font-size: .9375rem; min-height: 1.4em; }
.form .status.ok { color: #1B6B3A; font-weight: 500; }
.form .status.bad { color: #A3261F; font-weight: 500; }

/* Closing call to action, on every page but Contact */
.cta-wrap { padding-bottom: 104px; }
.band + .cta-wrap { padding-top: 104px; }
.cta { background: var(--card); border: 1px solid var(--rule); border-radius: 20px; padding: 48px 56px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px; position: relative; overflow: hidden; }
.cta::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--dusk); }
.cta .lede { margin-top: 10px; max-width: 52ch; }

/* Privacy and other long text */
.prose { max-width: 808px; padding-top: 88px; padding-bottom: 104px; }
.prose h1 { font-size: clamp(2.25rem, 4vw, 3rem); line-height: 1.08; }
.prose .updated { margin-top: 12px; color: var(--muted); font-size: .9375rem; }
.prose .intro { margin-top: 28px; font-size: 1.1875rem; line-height: 1.55; }
.prose h2 { margin-top: 44px; font-size: 1.375rem; line-height: 1.25; letter-spacing: -0.01em; }
.prose h2 + p, .prose h2 + ul { margin-top: 10px; }
.prose p + p, .prose ul + p, .prose p + ul { margin-top: 12px; }
.prose ul { padding-left: 22px; list-style: disc; }
.prose li + li { margin-top: 6px; }
.prose a { color: var(--accent); text-underline-offset: 4px; }
.prose a:hover { color: var(--accent-hover); }

/* Footer */
.site-foot { background: var(--band); border-top: 1px solid var(--rule); }
.foot-grid { padding-top: 56px; padding-bottom: 44px; display: grid; grid-template-columns: minmax(0, 5fr) repeat(3, minmax(0, 3fr)); gap: 32px 40px; }
.foot-grid .brand img { height: 34px; width: auto; }
.foot-grid .brand p { margin-top: 16px; color: var(--muted); font-size: .9375rem; max-width: 34ch; }
.foot-grid h2 { font-size: .875rem; line-height: 1.4; font-weight: 600; letter-spacing: 0; }
.foot-grid ul { margin-top: 14px; display: grid; gap: 10px; font-size: .9375rem; color: var(--muted); }
.foot-grid ul a { text-decoration: none; overflow-wrap: anywhere; }
.foot-grid ul a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.foot-base { position: relative; padding-top: 20px; padding-bottom: calc(28px + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: .875rem; color: var(--muted); }
.foot-base::before { content: ""; position: absolute; top: 0; left: 24px; right: 24px; height: 1px; background: var(--rule); }
.foot-base a { text-decoration: none; }
.foot-base a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .hero h1, .hero .lede, .hero .actions, .flow { animation: rise .7s cubic-bezier(.16, 1, .3, 1) both; }
  .hero .lede { animation-delay: .06s; }
  .hero .actions { animation-delay: .12s; }
  .flow { animation-delay: .2s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
}
@media (prefers-reduced-motion: reduce) { .button { transition: none; } .button:active { transform: none; } }

@media (max-width: 900px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .nav li.link { display: none; }
  .nav .menu { display: block; }
  .nav ul { gap: 10px; }
  .nav .logo img { height: 32px; }
  .hero { padding-top: 40px; }
  .hero .actions .button, .page-head .actions .button { flex: 1 1 150px; }
  .flow { margin-top: 44px; grid-template-columns: 1fr; border-radius: 16px; }
  .flow li { padding: 26px 22px 24px; }
  .flow li + li { border-left: 0; border-top: 1px solid var(--rule); }
  .flow li + li::before { left: 28px; top: -9px; margin-top: 0; transform: rotate(135deg); }
  .page-head, .section.contact, .prose { padding-top: 48px; }
  .page-head { padding-bottom: 40px; }
  .section, .product { padding-top: 64px; padding-bottom: 64px; }
  .cta-wrap, .prose { padding-bottom: 64px; }
  .band + .cta-wrap { padding-top: 64px; }
  .panel { padding: 40px 24px; border-radius: 18px; }
  .panel .head .button { width: 100%; }
  .pipeline { grid-template-columns: 1fr; gap: 26px; }
  .uses { grid-template-columns: 1fr; }
  .spec { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel .block, .spec { margin-top: 40px; }
  .pipeline::before { left: 13px; right: auto; top: 14px; bottom: 40px; width: 2px; height: auto; }
  .pipeline li { display: grid; grid-template-columns: 28px 1fr; gap: 0 18px; padding: 0; }
  .pipeline .node { grid-row: 1 / 3; }
  .pipeline h3 { margin-top: 0; }
  .pipeline p { max-width: none; }
  .cards, .work .cards { grid-template-columns: 1fr; gap: 12px; }
  .models { grid-template-columns: 1fr; padding: 22px; }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .why ul { grid-template-columns: 1fr; gap: 32px; }
  .about .pair, .about .founder { grid-template-columns: 1fr; }
  .about .founder { padding: 24px; }
  .about .founder .who { padding-right: 0; border-right: 0; padding-bottom: 24px; border-bottom: 1px solid var(--rule); }
  .names { grid-template-columns: 1fr; }
  .section-head .button { width: 100%; }
  .rows li { grid-template-columns: 1fr; }
  .about .founder .button { width: 100%; }
  .contact .inner { grid-template-columns: 1fr; }
  .form { padding: 20px; }
  .cta { padding: 32px 22px; }
  .cta .button { width: 100%; }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 40px; }
  .foot-grid .brand, .foot-grid > div:last-child { grid-column: 1 / -1; }
  .foot-base::before { left: 16px; right: 16px; }
}
@media (min-width: 620px) and (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
