/* RianStudio website. Colours come only from themes.css roles (sys-color-*);
   type, radius and spacing follow rianstudio-ui references/tokens.md. */

:root {
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Roboto Flex", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --font-brand: "Roboto Flex", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --radius-control: 10px;
  --radius-card: 26px;
  --page-max: 1120px;
  --gutter: 16px;

  /* expressive spring approximations: defaultSpatial 0.8 / 380 */
  --ease-spatial: cubic-bezier(0.22, 1.2, 0.36, 1);
}

@media (min-width: 600px) { :root { --gutter: 24px; } }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--sys-color-surface);
  color: var(--sys-color-on-surface);
  font: 400 17px/1.45 var(--font-text);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

:focus-visible { outline: 2px solid var(--sys-color-primary); outline-offset: 3px; border-radius: 6px; }

.wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.icon { width: 20px; height: 20px; flex: none; }

.mono { font-family: var(--font-mono); font-size: 13px; line-height: 18px; font-variant-numeric: tabular-nums; }

.label {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sys-color-on-surface-variant);
}

/* ---------- buttons: capsule, ink ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  font: 600 17px/22px var(--font-text);
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: background-color 160ms linear, transform 200ms var(--ease-spatial);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--sys-color-primary); color: var(--sys-color-on-primary); }
.btn-quiet { background: var(--sys-color-surface-container-high); color: var(--sys-color-on-surface); }
.btn-small { min-height: 44px; padding: 0 18px; font-size: 15px; }

/* ---------- header ---------- */

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--sys-color-surface);
}

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  background: color-mix(in srgb, var(--sys-color-surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  backdrop-filter: saturate(1.4) blur(18px);
  border-bottom: 0.5px solid var(--sys-color-separator);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }

.lockup { display: inline-flex; color: var(--sys-color-on-surface); }
.lockup svg { height: 30px; width: auto; }

.nav { display: flex; gap: 4px; }
.nav a {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 14px;
  border-radius: 999px;
  font-size: 15px; font-weight: 500;
  text-decoration: none;
  color: var(--sys-color-on-surface-variant);
}
.nav a:hover { background: var(--sys-color-surface-container); color: var(--sys-color-on-surface); }
@media (max-width: 460px) { .nav a.nav-about { display: none; } .nav a { padding: 0 10px; } }

/* ---------- hero ---------- */

.hero { padding-block: 72px 56px; }
@media (min-width: 900px) { .hero { padding-block: 112px 80px; } }

.display {
  margin: 0;
  font-family: var(--font-brand);
  font-weight: 800;
  font-stretch: 112%;
  font-variation-settings: "wdth" 112, "opsz" 72;
  letter-spacing: -0.035em;
  font-size: clamp(44px, 9vw, 104px);
  line-height: 0.98;
  text-wrap: balance;
  max-width: 11ch;
}

.hero-lede {
  margin: 28px 0 0;
  max-width: 34em;
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.5;
  color: var(--sys-color-on-surface-variant);
}

.app-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.app-chip {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 8px 20px 8px 8px;
  border-radius: 999px;
  background: var(--sys-color-surface-container);
  text-decoration: none;
  transition: background-color 160ms linear;
}
.app-chip:hover { background: var(--sys-color-surface-container-high); }
.app-chip .app-icon { width: 44px; height: 44px; }
.app-chip strong { font-size: 17px; font-weight: 600; }
.app-chip span { color: var(--sys-color-on-surface-variant); font-size: 15px; }

/* app icons swap with the theme */
.app-icon { border-radius: 22.37%; }
.app-icon.on-dark { display: none; }
[data-theme="dark"] .app-icon.on-light { display: none; }
[data-theme="dark"] .app-icon.on-dark { display: block; }
.app-icon.on-light { box-shadow: inset 0 0 0 0.6px var(--sys-color-outline-variant); }

/* ---------- product sections ---------- */

.product { padding-block: 24px; }
.product-panel {
  display: grid;
  gap: 40px;
  padding: 32px 24px;
  grid-template-columns: minmax(0, 1fr);
  border-radius: var(--radius-card);
  background: var(--sys-color-surface-container);
}
@media (min-width: 900px) {
  .product-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); align-items: center; gap: 56px; padding: 56px; }
}

.product-copy { min-width: 0; }
.product-name { display: flex; align-items: center; gap: 16px; }
.product-name .app-icon { width: 64px; height: 64px; }
.product-name h2 {
  margin: 0;
  font-family: var(--font-brand);
  font-weight: 700;
  font-variation-settings: "opsz" 48;
  letter-spacing: -0.025em;
  font-size: 40px;
  line-height: 1;
}
.product-name p { margin: 4px 0 0; color: var(--sys-color-on-surface-variant); font-size: 15px; }

.product-copy h3 {
  margin: 28px 0 0;
  font-size: clamp(24px, 3vw, 28px);
  line-height: 1.2;
  font-weight: 600;
  text-wrap: balance;
  max-width: 22ch;
}

.features {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  border-radius: var(--radius-card);
  background: var(--sys-color-grouped-cell);
  overflow: hidden;
}
.features li {
  display: flex; align-items: center; gap: 12px;
  min-height: 60px;
  padding: 10px 16px;
  position: relative;
}
.features li + li::before {
  content: "";
  position: absolute; top: 0; right: 0; left: 64px;
  border-top: 0.5px solid var(--sys-color-separator);
}
.feature-icon {
  display: grid; place-items: center;
  width: 36px; height: 36px; flex: none;
  border-radius: 8px;
  background: var(--sys-color-surface-container);
  color: var(--sys-color-on-surface);
}
.feature-icon .icon { width: 18px; height: 18px; }
.features .text { min-width: 0; flex: 1; }
.features strong { display: block; font-size: 17px; font-weight: 400; line-height: 22px; }
.features .text span { display: block; color: var(--sys-color-on-surface-variant); font-size: 15px; line-height: 20px; }

.store { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- UI fragments (real screens, not mockup chrome) ---------- */

.screen {
  min-width: 0;
  border-radius: var(--radius-card);
  background: var(--sys-color-grouped-background);
  padding: 20px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.screen-title { margin: 4px 4px 4px; font-size: 22px; line-height: 28px; font-weight: 600; }
.cell { background: var(--sys-color-grouped-cell); border-radius: var(--radius-card); padding: 16px; }
.cell-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-row .text { min-width: 0; flex: 1; }
.cell-row strong { display: block; font-size: 17px; line-height: 22px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-row .mono { color: var(--sys-color-on-surface-variant); }
.thumb {
  width: 40px; height: 52px; flex: none;
  border-radius: 8px;
  background: var(--sys-color-tertiary-container);
  display: grid; place-items: center;
}
.thumb svg { width: 30px; height: auto; }

.readout { padding: 20px 20px 18px; }
.readout .label { display: block; }
.readout .metric {
  margin: 8px 0 0;
  color: var(--sys-color-on-surface);
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.metric small { font-size: 22px; letter-spacing: 0; color: var(--sys-color-on-surface-variant); margin-left: 6px; }
.meter { margin-top: 18px; display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; }
.meter i { height: 10px; border-radius: 3px; background: var(--sys-color-surface-container-high); }
.meter i.on { background: var(--sys-color-signal); }
.readout p { margin: 14px 0 0; font-size: 15px; line-height: 20px; color: var(--sys-color-on-surface-variant); }

.meter i.on { animation: tick-in 420ms var(--ease-spatial) both; animation-delay: calc(var(--n) * 28ms + 200ms); }
@keyframes tick-in { from { transform: scaleY(0.2); opacity: 0.35; } to { transform: none; opacity: 1; } }

.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; line-height: 20px;
  color: var(--sys-color-on-surface-variant);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sys-color-signal); flex: none; }

.scan-value {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--sys-color-surface-container-low);
  overflow-x: auto;
  white-space: nowrap;
}
.kv { display: grid; grid-template-columns: auto 1fr; margin: 6px 0 0; }
.kv dt, .kv dd { margin: 0; padding: 11px 0; border-top: 0.5px solid var(--sys-color-separator); font-size: 17px; line-height: 22px; }
.kv dt { color: var(--sys-color-on-surface-variant); padding-right: 16px; }
.kv dd { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.kv dd.mono { font-size: 15px; line-height: 22px; }
.screen .btn { width: 100%; justify-content: center; }

/* ---------- principles ---------- */

.principles { padding-block: 72px 24px; }
.section-title {
  margin: 0;
  font-size: clamp(28px, 4vw, 34px);
  line-height: 1.2;
  font-weight: 700;
  text-wrap: balance;
}
.principle-list {
  display: grid;
  gap: 1px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--sys-color-separator);
}
@media (min-width: 760px) { .principle-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.principle-list li { background: var(--sys-color-grouped-cell); padding: 24px; }
.principle-list h3 { margin: 0; font-size: 17px; line-height: 22px; font-weight: 600; }
.principle-list p { margin: 8px 0 0; color: var(--sys-color-on-surface-variant); font-size: 15px; line-height: 21px; max-width: 42ch; }
.principle-list .mono { color: var(--sys-color-on-surface); }

/* ---------- footer ---------- */

.site-footer { padding-block: 72px 40px; }
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding-top: 32px;
  border-top: 0.5px solid var(--sys-color-separator);
}
.site-footer .lockup svg { height: 26px; }
.site-footer p { margin: 12px 0 0; color: var(--sys-color-on-surface-variant); font-size: 15px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 15px; color: var(--sys-color-on-surface-variant); }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--sys-color-on-surface); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
