/* Shinylabs — site styles.
   Design tokens are taken from the ShinyTableau / shnyVault design system
   (src/newui/tokens.ts in the product repo): the same palettes, the 13/18px
   corner language, the 8px spacing scale, the OS system font stack and the
   coral-to-purple brand gradient from the wordmark. */

:root {
  color-scheme: light dark;

  /* Brand */
  --brand: #9b7fe8;
  --brand-soft: #b8a2ef;
  --brand-tint: rgba(155, 127, 232, 0.12);
  --brand-outline: rgba(155, 127, 232, 0.45);
  --grad-from: #ff5757;
  --grad-to: #8c52ff;
  --gradient: linear-gradient(100deg, var(--grad-from), var(--grad-to));

  /* Surfaces (light register) */
  --bg: #eef1f5;
  --surface: #ffffff;
  --soft: #f5f7fa;
  --line: #d8dee6;
  --line-soft: #e7ebf0;

  /* Ink */
  --ink: #141a22;
  --ink2: #5a6573;
  --ink3: #8b95a3;

  /* Dark rail — the cart rail, reused here for the footer */
  --rail: #11161d;
  --rail-2: #1a212b;
  --rail-line: #2a3340;
  --rail-ink: #e8edf3;
  --rail-ink2: #aab4c2;

  /* Status */
  --sell: #2fb695;
  --trade: #7c3aed;

  /* Corners — one corner language: 13 for chips/tiles/cards, 18 for heroes */
  --r-xs: 4px;
  --r-sm: 13px;
  --r-md: 13px;
  --r-lg: 18px;
  --r-pill: 999px;

  /* 8px base spacing scale */
  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 12px;
  --s-lg: 16px;
  --s-xl: 20px;
  --s-xxl: 24px;

  --shadow-sm: 0 1px 2px rgba(20, 26, 34, 0.06);
  --shadow-md: 0 10px 30px rgba(20, 26, 34, 0.08);

  --maxw: 1100px;
  --gutter: 20px;

  /* OS system font on purpose — the product uses the same stack so web matches
     the iOS app. */
  --font: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0e13;
    --surface: #151b24;
    --soft: #1c2430;
    --line: #2b3442;
    --line-soft: #222b37;
    --ink: #e8edf3;
    --ink2: #9aa6b5;
    --ink3: #6b7787;
    --rail: #0d1117;
    --rail-2: #161d27;
    --rail-line: #2b3442;
    --brand-tint: rgba(155, 127, 232, 0.16);
    --brand-outline: rgba(155, 127, 232, 0.5);
    --sell: #8ceed2;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-md);
  font-weight: 800;
}

h1 { font-size: clamp(2rem, 5.2vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.125rem; font-weight: 700; }

p { margin: 0 0 var(--s-lg); }

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

img, svg { max-width: 100%; }

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xs);
  padding: 0.1em 0.35em;
}

/* Layout ------------------------------------------------------------------ */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: var(--s-md) var(--s-lg);
  border-radius: 0 0 var(--r-sm) 0;
  z-index: 100;
}

.skip-link:focus { left: 0; }

section { padding-block: clamp(48px, 7vw, 88px); }

.section-surface {
  background: var(--surface);
  border-block: 1px solid var(--line-soft);
}

.section-head {
  max-width: 44rem;
  margin-bottom: var(--s-xxl);
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: var(--s-sm);
}

.lede {
  font-size: 1.0625rem;
  color: var(--ink2);
}

/* Brand mark -------------------------------------------------------------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand:hover { text-decoration: none; }

.brand-mark {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
}

/* The wordmark carries the logo gradient, like the ShinyTableau lockup. */
.brand-word {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Header ------------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-lg);
  min-height: 60px;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--s-xxl);
}

.nav a {
  color: var(--ink2);
  font-size: 0.9375rem;
  font-weight: 500;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink);
  padding: var(--s-sm) var(--s-md);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: var(--s-sm) var(--gutter) var(--s-lg);
  }

  .nav[data-open="true"] { display: flex; }

  .nav a {
    padding: var(--s-md) 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .nav a:last-child { border-bottom: 0; }
}

/* Buttons ----------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-sm);
  padding: var(--s-md) var(--s-xl);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--gradient);
  color: #fff;
}

.btn-primary:hover { filter: brightness(1.07); }

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.btn-secondary:hover { border-color: var(--brand-outline); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-md);
  margin-top: var(--s-xxl);
}

/* Hero -------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(56px, 9vw, 104px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -50% 25% 35% -25%;
  background: radial-gradient(closest-side, var(--brand-tint), transparent 70%);
  pointer-events: none;
}

.hero .wrap { position: relative; }

.hero-copy { max-width: 46rem; }

.hero h1 .grad {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lede {
  font-size: clamp(1.0625rem, 2.1vw, 1.25rem);
  max-width: 36rem;
}

/* Cards ------------------------------------------------------------------- */

.grid {
  display: grid;
  gap: var(--s-lg);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: var(--s-xxl);
  box-shadow: var(--shadow-sm);
}

.section-surface .card {
  background: var(--soft);
  border-color: var(--line-soft);
  box-shadow: none;
}

.card h3 { margin-bottom: var(--s-sm); }

.card p:last-child { margin-bottom: 0; }

.card-muted {
  color: var(--ink2);
  font-size: 0.9375rem;
}

/* Project cards with a screenshot ----------------------------------------- */

/* A project card renders its screenshot edge to edge, so the card padding
   moves onto the body. Cards without a .shot are unaffected. */
.card-project {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-project .card-body {
  padding: var(--s-xxl);
}

.card-project .card-body > *:last-child { margin-bottom: 0; }

.shot {
  margin: 0;
  background: var(--soft);
  border-bottom: 1px solid var(--line-soft);
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* A screenshot that links to the product: the image darkens and a label
   surfaces on hover and on keyboard focus. */
.shot-link {
  position: relative;
  display: block;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}

.shot-link .shot {
  border-bottom: 0;
}

.shot-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(12, 16, 22, 0.45);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.shot-link .shot-cue {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s ease;
}

/* The "opens in a new tab" glyph, on a frosted disc so it reads over any
   screenshot. */
.shot-link .shot-cue svg {
  width: 26px;
  height: 26px;
  padding: 13px;
  box-sizing: content-box;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--r-pill);
  transform: scale(0.94);
  transition: transform 0.18s ease;
}

.shot-link:hover .shot-cue svg,
.shot-link:focus-visible .shot-cue svg {
  transform: scale(1);
}

.shot-link:hover::after,
.shot-link:focus-visible::after {
  opacity: 1;
}

.shot-link:hover .shot-cue,
.shot-link:focus-visible .shot-cue {
  opacity: 1;
}

.shot-link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

/* Facts ------------------------------------------------------------------- */

.facts {
  display: grid;
  gap: 0 var(--s-xxl);
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin: 0;
  padding: 0;
}

.facts div {
  padding: var(--s-lg) 0;
  border-bottom: 1px solid var(--line-soft);
}

.facts dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink3);
  margin-bottom: var(--s-xs);
}

.facts dd {
  margin: 0;
  font-size: 0.9375rem;
}

/* Prose (legal pages) ----------------------------------------------------- */

.prose { max-width: 44rem; }

.prose h2 {
  margin-top: var(--s-xxl);
  font-size: 1.3125rem;
}

.prose h3 {
  margin-top: var(--s-xl);
  font-size: 1rem;
}

.prose ul,
.prose ol {
  margin: 0 0 var(--s-lg);
  padding-left: var(--s-xl);
}

.prose li { margin-bottom: var(--s-sm); }

.prose .meta {
  color: var(--ink3);
  font-size: 0.875rem;
}

.page-head { padding-block: clamp(40px, 6vw, 64px) 0; }

/* Contact ----------------------------------------------------------------- */

.contact-grid {
  display: grid;
  gap: var(--s-lg);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: start;
}

.contact-grid a { font-weight: 700; }

/* Footer — the dark rail ------------------------------------------------- */

.site-footer {
  background: var(--rail);
  color: var(--rail-ink2);
  border-top: 1px solid var(--rail-line);
  padding-block: 40px 32px;
  font-size: 0.9375rem;
}

.site-footer .brand { color: var(--rail-ink); }

.site-footer a { color: var(--rail-ink2); }

.site-footer a:hover { color: var(--rail-ink); }

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-xxl);
  justify-content: space-between;
  margin-bottom: var(--s-xxl);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-xl);
}

.footer-legal {
  border-top: 1px solid var(--rail-line);
  padding-top: var(--s-xl);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-sm) var(--s-xxl);
  justify-content: space-between;
  color: var(--ink3);
}

.footer-legal p { margin: 0; }

.made-in {
  margin: var(--s-md) 0 0;
}

.heart {
  color: var(--grad-from);
}

/* Utilities --------------------------------------------------------------- */

.muted { color: var(--ink2); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
