/* ==========================================================================
   Rekarta — rekarta.com
   The palette is the suite's own: the cool blue-leaning slate the app ships
   with, coral reserved for time and evaluation, and one accent per app that
   never borrows another's. The canvas is the only bright thing; the shell
   stays quiet.
   ========================================================================== */

:root {
  --bg:        #0D1220;
  --panel:     #131B2D;
  --raised:    #1B2740;
  --sunken:    #080C16;
  --hairline:  #253550;
  --stroke:    #3A5273;

  --ink:       #E7EDF7;
  --dim:       #8EA4C7;
  --faint:     #7B91B6;

  --coral:     #FF4D2D;
  --coral-lit: #FF7A59;

  --amber:     #FF9F0A;
  --cyan:      #00C7FF;
  --magenta:   #FF1744;
  --violet:    #7C4DFF;
  /* Text-safe variants: full-saturation magenta and violet sit below 4.5:1 on
     the panel, so accent text uses these lighter tints while fills/borders
     keep the saturated originals. */
  --magenta-lit: #FF5A7A;
  --violet-lit:  #9E7BFF;

  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1080px;
  --gutter: 168px;
  --track-h: 24px;
  --ruler-h: 28px;
  --radius: 4px;
}

.connection-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}
.connection-flow > div { border-top: 2px solid var(--stroke); padding-top: 1.25rem; }
.connection-flow h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.connection-flow p { color: var(--dim); max-width: 32ch; }
@media (max-width: 700px) {
  .connection-flow { grid-template-columns: 1fr; gap: 1.25rem; }
  .connection-flow p { max-width: none; }
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-stretch: 100%;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, dl, dd, dt, pre, figure { margin: 0; }
dl { }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2.25rem);
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ---- focus + skip ---- */
:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
  border-radius: 2px;
}
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  padding: 0.6rem 0.9rem;
  background: var(--raised);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; }

/* ==========================================================================
   Top bar
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(13, 18, 32, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.topbar__inner {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 3vw, 2rem);
  min-height: 58px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-stretch: 118%;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
  margin-right: auto;
}
.brand__mark { width: 26px; height: 26px; }
.topnav {
  display: flex;
  gap: clamp(0.9rem, 2.5vw, 1.8rem);
  font-size: 0.9rem;
  color: var(--dim);
}
.topnav a {
  text-decoration: none;
  padding-block: 0.5rem;
  border-bottom: 1px solid transparent;
}
.topnav a:hover { color: var(--ink); border-bottom-color: var(--stroke); }

.lang { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--mono); font-size: 0.72rem; }
.lang__opt { color: var(--faint); letter-spacing: 0.02em; padding: 0.35rem 0.15rem; }
.lang__opt[aria-pressed="true"] { color: var(--coral); }
.lang__sep { color: var(--hairline); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding-top: clamp(2.4rem, 5.5vw, 4.2rem); padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--coral-lit);
  letter-spacing: 0.02em;
  margin-bottom: clamp(1rem, 2.2vw, 1.5rem);
}
.hero__tag::before {
  content: "//";
  color: var(--faint);
}
.hero__title {
  font-stretch: 125%;
  font-weight: 600;
  font-size: clamp(2.3rem, 6.6vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.028em;
  max-width: 20ch;
  text-wrap: balance;
}
.hero__sub {
  margin-top: clamp(1.1rem, 2.5vw, 1.6rem);
  max-width: 62ch;
  color: var(--dim);
  font-size: clamp(1rem, 1.5vw, 1.16rem);
}
.hero__sub strong { color: var(--ink); font-weight: 600; }

.hero__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: clamp(1.4rem, 3.2vw, 2.2rem);
}
.hero__micro {
  color: var(--faint);
  font-size: 0.82rem;
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 550;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background-color 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn--primary {
  background: var(--coral);
  color: #fff;
  border: 1px solid var(--coral);
  padding: 0.65rem 1.35rem;
}
.btn--primary:hover {
  background: var(--coral-lit);
  border-color: var(--coral-lit);
}

/* ---- stage: the composition ---- */
.showreel { margin-top: clamp(1.8rem, 4vw, 3rem); scroll-margin-top: 80px; }
.showreel video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--sunken); border: 1px solid var(--hairline); border-radius: var(--radius); }
.showreel figcaption { padding-top: 1.4rem; }
.showreel h2 { font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.25; margin-bottom: .65rem; }
.showreel p { max-width: 70ch; color: var(--dim); }
.showreel .showreel__usage { margin-top: .6rem; font-size: .9rem; }
.motion-study { margin-top: 1.5rem; }
.motion-study summary { cursor: pointer; color: var(--dim); padding-block: .6rem; }
.stage { margin-top: clamp(1.8rem, 4vw, 3rem); }
.stage__bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
}
.stage__time {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--coral);
  font-size: clamp(1.5rem, 4.4vw, 2.35rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stage__meta { color: var(--faint); font-size: 0.7rem; letter-spacing: 0.01em; }

.viewport {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--sunken);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.viewport__grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.055) 1.4px, transparent 0);
  background-size: 32px 32px;
  background-position: center;
}
.comp-layer {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13%;
  height: auto;
  opacity: 0;
  will-change: transform, opacity;
  transform: translate(-50%, -50%);
}
.comp-layer[data-app="suite"] { width: 17%; }

/* ---- timeline ---- */
.timeline {
  display: grid;
  grid-template-columns: var(--gutter) 1fr;
  margin-top: 1px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: ew-resize;
  user-select: none;
  outline-offset: 3px;
}
.timeline:focus-visible { outline: 2px solid var(--coral); }
.timeline__gutter { border-right: 1px solid var(--hairline); background: var(--panel); }
.timeline__lanes { position: relative; touch-action: none; }

.tl-gutter-head, .tl-ruler {
  height: var(--ruler-h);
  border-bottom: 1px solid var(--hairline);
  background: var(--raised);
}
.tl-ruler { position: relative; overflow: hidden; }

.tl-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: var(--track-h);
  padding-inline: 0.7rem;
  border-bottom: 1px solid rgba(37, 53, 80, 0.55);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  color: var(--dim);
}
.tl-name:last-child { border-bottom: 0; }
.tl-name__dot {
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  background: var(--app);
}

.tl-lane {
  position: relative;
  height: var(--track-h);
  border-bottom: 1px solid rgba(37, 53, 80, 0.55);
}
.tl-lane:nth-child(even) { background: rgba(255, 255, 255, 0.012); }

.tl-kf {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  transform: translateY(-50%) rotate(45deg);
  background: var(--app);
  box-shadow: 0 0 0 1px rgba(8, 12, 22, 0.9);
}

.tl-tick { position: absolute; bottom: 0; width: 1px; height: 7px; background: var(--stroke); }
.tl-tick--major { height: 13px; background: var(--faint); }
.tl-tick__label {
  position: absolute;
  top: 4px;
  margin-left: 4px;
  font-family: var(--mono);
  font-size: 0.56rem;
  color: var(--faint);
}

.tl-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--coral);
  pointer-events: none;
  z-index: 5;
}
.tl-playhead__grip {
  position: absolute;
  top: 3px;
  left: 50%;
  width: 11px;
  height: 11px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--coral);
}

.transport {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.7rem;
  font-size: 0.68rem;
  color: var(--faint);
}
.transport__play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--dim);
  flex: none;
}
.transport__play:hover { background: var(--raised); color: var(--ink); border-color: var(--stroke); }
.transport__play svg { width: 11px; height: 11px; fill: currentColor; }
.transport__play svg[data-state="playing"] { display: none; }
.transport__frame { color: var(--dim); font-size: 0.66rem; }
.transport__hint { color: var(--faint); }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding-block: clamp(3.2rem, 8vw, 6rem); border-top: 1px solid var(--hairline); }
.section h2 {
  font-stretch: 125%;
  font-weight: 600;
  font-size: clamp(1.7rem, 3.8vw, 2.7rem);
  line-height: 1.02;
  letter-spacing: -0.022em;
  max-width: 20ch;
}
.lede {
  margin-top: clamp(0.9rem, 2vw, 1.3rem);
  max-width: 66ch;
  color: var(--dim);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
}

/* ---- suite: dock + detail ---- */
.suite { margin-top: clamp(1.8rem, 4vw, 2.8rem); display: grid; gap: 0.9rem; }
.dock {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.dock__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.75rem 0.6rem;
  min-width: 84px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  color: var(--dim);
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.dock__item img { width: 40px; height: 40px; border-radius: 8px; }
.dock__name { font-size: 0.72rem; letter-spacing: 0.01em; }
.dock__item:hover { background: var(--raised); color: var(--ink); }
.dock__item[aria-selected="true"] {
  background: var(--raised);
  border-color: var(--app-accent, var(--coral));
  color: var(--ink);
}

.app-detail {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--app-accent, var(--coral));
  border-radius: var(--radius);
  padding: clamp(1.1rem, 3vw, 1.7rem);
}
.app-detail__head { display: flex; align-items: center; gap: 0.9rem; }
.app-detail__logo { width: 52px; height: 52px; border-radius: 11px; flex: none; }
.app-detail__titles h3 {
  font-stretch: 120%;
  font-weight: 600;
  font-size: 1.4rem;
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.app-detail__kind { color: var(--app-accent-text, var(--app-accent, var(--coral))); font-size: 0.8rem; margin-top: 0.15rem; }
.app-detail__role { margin-top: 1.1rem; max-width: 60ch; color: var(--ink); }

.facts { margin-top: 1.2rem; border-top: 1px solid var(--hairline); }
.facts__row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(37, 53, 80, 0.55);
  font-size: 0.86rem;
}
.facts__row dt { color: var(--faint); }
.facts__row dd { color: var(--dim); }
.app-detail__note { margin-top: 1rem; max-width: 66ch; color: var(--faint); font-size: 0.86rem; }

/* ---- agentic ---- */
.agentic { margin-top: clamp(1.8rem, 4vw, 2.8rem); }
.tabs { display: inline-flex; gap: 0.35rem; }
.tabs__tab {
  padding: 0.45rem 1.1rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--faint);
  border: 1px solid var(--hairline);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom-color: transparent;
  background: transparent;
}
.tabs__tab:hover { color: var(--dim); }
.tabs__tab[aria-selected="true"] {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--stroke);
  border-bottom-color: transparent;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: clamp(1.1rem, 3vw, 1.6rem);
}
.panel__caption { max-width: 68ch; color: var(--dim); font-size: 0.92rem; margin-bottom: 1.1rem; }

.prop-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  background: var(--raised);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  font-size: 0.82rem;
  max-width: 420px;
}
.prop-row__stopwatch { display: inline-flex; width: 15px; height: 15px; color: var(--coral); flex: none; }
.prop-row__stopwatch svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; }
.prop-row__label { color: var(--dim); min-width: 4.5rem; }
.prop-row__field {
  margin-left: auto;
  padding: 0.18rem 0.5rem;
  background: var(--sunken);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  color: var(--ink);
  font-size: 0.72rem;
}
.prop-row__key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  background: var(--panel);
  flex: none;
}
.prop-row__key:hover { border-color: var(--stroke); background: var(--raised); }
.kf-diamond {
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
  border: 1.4px solid var(--faint);
}
.prop-row__key[aria-pressed="true"] .kf-diamond { background: var(--coral); border-color: var(--coral); }

.code {
  margin-top: 1.1rem;
  padding: 1rem 1.1rem;
  background: var(--sunken);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.75;
  color: var(--dim);
  white-space: pre;
  tab-size: 2;
}
.code--emit { color: var(--coral-lit); margin-top: 0.85rem; }
.agentic__note {
  margin-top: 1.2rem;
  max-width: 66ch;
  color: var(--faint);
  font-size: 0.9rem;
}

/* ---- native: package panel ---- */
.pkg {
  margin-top: clamp(1.8rem, 4vw, 2.6rem);
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  max-width: 720px;
  font-size: 0.82rem;
}
.pkg__row {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 1rem;
  padding: 0.5rem clamp(0.8rem, 2.5vw, 1.2rem);
  border-bottom: 1px solid rgba(37, 53, 80, 0.55);
}
.pkg__row:last-child { border-bottom: 0; }
.pkg__row dt { color: var(--faint); }
.pkg__row dd { color: var(--dim); font-size: 0.76rem; }
.native__portable {
  margin-top: clamp(1.2rem, 3vw, 1.8rem);
  max-width: 62ch;
  color: var(--dim);
}

/* ---- waitlist: dispatch console ---- */
.waitlist-section {
  border-top: 1px solid var(--hairline);
  background: var(--bg);
}
.dispatch {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.dispatch__guarantees {
  padding: clamp(1.6rem, 4vw, 2.5rem);
  border-right: 1px solid var(--hairline);
}
.dispatch__eyebrow {
  font-size: 0.72rem;
  color: var(--coral-lit);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}
.dispatch__items {
  display: flex;
  flex-direction: column;
}
.dispatch__item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 1rem;
  align-items: baseline;
  padding-block: 0.95rem;
  border-bottom: 1px solid rgba(37, 53, 80, 0.55);
}
.dispatch__item:first-child { padding-top: 0; }
.dispatch__item:last-child { border-bottom: 0; padding-bottom: 0; }
.dispatch__num {
  color: var(--coral);
  font-size: 0.78rem;
}
.dispatch__title {
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}
.dispatch__desc {
  color: var(--dim);
  font-size: 0.83rem;
  line-height: 1.5;
}
.dispatch__form-wrap {
  padding: clamp(1.6rem, 4vw, 2.5rem);
  background: var(--sunken);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dispatch__h2 {
  font-stretch: 120%;
  font-weight: 600;
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.dispatch__sub {
  color: var(--dim);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-top: 0.65rem;
  margin-bottom: 1.5rem;
}
.btn--submit {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  font-size: 0.84rem;
  white-space: nowrap;
}
.waitlist-form__note {
  margin-top: 0.75rem;
  font-size: 0.72rem;
  color: var(--faint);
}

/* ---- footer ---- */
.footer { border-top: 1px solid var(--hairline); padding-block: clamp(2.4rem, 6vw, 4rem); }
.footer__inner { display: flex; gap: clamp(1.2rem, 4vw, 2.4rem); align-items: flex-start; }
.footer__mark { width: 46px; height: 46px; flex: none; }
.footer__text { max-width: 68ch; }
.footer__etym { color: var(--dim); }
.footer__etym strong { color: var(--ink); font-weight: 600; }
.footer__etym em { color: var(--ink); font-style: italic; }
.footer__colophon { margin-top: 0.9rem; color: var(--faint); font-size: 0.86rem; }
.footer__rights { margin-top: 1.4rem; color: var(--faint); font-size: 0.78rem; font-family: var(--mono); }

.noscript { padding-block: 1rem; color: var(--dim); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 820px) {
  :root { --gutter: 118px; }
  .dispatch { grid-template-columns: 1fr; }
  .dispatch__guarantees { border-right: 0; border-bottom: 1px solid var(--hairline); }
  .facts__row { grid-template-columns: 84px 1fr; }
  .pkg__row { grid-template-columns: 118px 1fr; }
}

@media (max-width: 620px) {
  :root { --gutter: 92px; }
  .topnav { display: none; }
  .stage__meta { display: none; }
  .transport__hint { display: none; }
  .dock__item { flex: 1 1 0; min-width: 0; }
  .dock__name { font-size: 0.66rem; }
  .dock__item img { width: 34px; height: 34px; }
  .footer__inner { flex-direction: column; }
}

/* ==========================================================================
   Reduced motion — the composition holds a composed frame; scrubbing, which
   the person drives, still works.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .comp-layer { transition: none; }
}
