/* ── Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  background: var(--void);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scrollbar-color: rgba(232, 233, 237, 0.12) transparent;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--steel-200);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  overflow: hidden;
  font-feature-settings: 'cv11', 'ss01';
}

[hidden] { display: none !important; }
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: not-allowed; }
ul, ol { list-style: none; }
table { border-collapse: collapse; }
::selection { background: rgba(168, 184, 224, 0.3); color: var(--steel-50); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--steel-100);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.15;
  text-wrap: balance;
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-base); }
p { text-wrap: pretty; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 6px; }
:focus:not(:focus-visible) { outline: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(232, 233, 237, 0.1); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(232, 233, 237, 0.2); }

/* ── Utilities ────────────────────────────────────────────────────────── */
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.muted { color: var(--steel-400); }
.faint { color: var(--steel-500); }
.strong { color: var(--steel-100); font-weight: 500; }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.danger-text { color: var(--danger); }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stack { display: grid; gap: 12px; }
.stack-sm { display: grid; gap: 6px; }
.stack-lg { display: grid; gap: 20px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.center { display: grid; place-items: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.nowrap { white-space: nowrap; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.w-full { width: 100%; }
.eyebrow {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--signal);
}

.chrome-text {
  background-image: linear-gradient(100deg,
    #6e7184 0%,
    #c4c7d2 calc(var(--lx) - 24%),
    #f6f7fb calc(var(--lx) - 5%),
    #b9c7ea var(--lx),
    #e9ebf1 calc(var(--lx) + 7%),
    #9093a4 calc(var(--lx) + 28%),
    #5a5d70 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.skip-link {
  position: fixed;
  top: calc(var(--inset) + 10px);
  left: calc(var(--inset) + 10px);
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--steel-100);
  color: var(--void);
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform var(--t) var(--ease);
}
.skip-link:focus { transform: none; }

/* ── Backdrop: liquid metal (WebGL canvas over a static fallback) + frame ── */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: var(--void);
  background-image: url('../assets/background-2000.jpg');
  background-image: image-set(url('../assets/background-2000.webp') type('image/webp'), url('../assets/background-2000.jpg') type('image/jpeg'));
  background-size: cover;
  background-position: 50% 40%;
}
@media (max-width: 900px) {
  .backdrop {
    background-image: url('../assets/background-1100.jpg');
    background-image: image-set(url('../assets/background-1100.webp') type('image/webp'), url('../assets/background-1100.jpg') type('image/jpeg'));
  }
}
.backdrop canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.4s var(--ease);
}
.backdrop canvas.is-live { opacity: 1; }
.backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(7, 7, 13, 0.25) 30%, rgba(7, 7, 13, 0.78) 100%),
    linear-gradient(180deg, rgba(7, 7, 13, 0.35), rgba(7, 7, 13, 0.62));
  transition: background var(--t-slow) var(--ease);
}
body.is-app .backdrop::after {
  background:
    radial-gradient(130% 100% at 50% 0%, rgba(7, 7, 13, 0.52) 25%, rgba(7, 7, 13, 0.9) 100%),
    linear-gradient(180deg, rgba(7, 7, 13, 0.55), rgba(7, 7, 13, 0.82));
}

.frame {
  position: fixed;
  inset: var(--inset);
  border: 1px solid var(--hair);
  border-radius: var(--radius-frame);
  box-shadow: 0 0 0 100vmax var(--void), inset 0 0 70px rgba(139, 156, 198, 0.035);
  pointer-events: none;
  z-index: var(--z-frame);
}

/* ── Boot splash ──────────────────────────────────────────────────────── */
.boot {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  background: transparent;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.boot.is-done { opacity: 0; visibility: hidden; }
.boot-mark { width: min(340px, 64vw); position: relative; }
.boot-mark img { width: 100%; filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.6)); }
.boot-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 0%, transparent 42%, rgba(255, 255, 255, 0.9) 50%, transparent 58%, transparent 100%) no-repeat;
  background-size: 250% 100%;
  -webkit-mask: url('../assets/silva-tender-wordmark-520.png') center / 100% 100% no-repeat;
  mask: url('../assets/silva-tender-wordmark-520.png') center / 100% 100% no-repeat;
  mix-blend-mode: soft-light;
  animation: sweep 1.6s var(--ease-io) 0.2s infinite;
}
@keyframes sweep { 0% { background-position: 150% 0; } 100% { background-position: -60% 0; } }
.boot-bar { width: 140px; height: 2px; margin: 28px auto 0; border-radius: 2px; background: var(--hair); overflow: hidden; }
.boot-bar::after { content: ''; display: block; width: 40%; height: 100%; background: var(--signal); animation: bootbar 1.2s var(--ease-io) infinite; }
@keyframes sheen { to { transform: translateX(120%); } }
@keyframes bootbar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ── Motion: entrances ────────────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { opacity: 0; transform: scale(0.92); } 60% { opacity: 1; transform: scale(1.03); } 100% { transform: scale(1); } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(168, 184, 224, 0.5); } 100% { box-shadow: 0 0 0 12px rgba(168, 184, 224, 0); } }
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }

.stagger > * { animation: rise var(--t-slow) var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.rise { animation: rise var(--t-slow) var(--ease) both; }
.fade-in { animation: fade var(--t) var(--ease) both; }
.shake { animation: shake 0.5s var(--ease-io); }

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

/* view transitions between pages */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 260ms; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
::view-transition-old(main-view) { animation: 180ms var(--ease) both vt-out; }
::view-transition-new(main-view) { animation: 360ms var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
