/* Nyval Hub — "Premium" direction (calm, typography-led, light/dark).
   Source: design_handoff_nyval_hub/README.md + nyval-hub.html.

   Sizing: widths, heights and side padding are expressed in vw (and the
   page itself is width: 100vw, no max-width cap) so the hub always fills
   exactly the current viewport instead of sitting in a fixed column.
   Font sizes are clamp()ed around their vw value so text stays legible at
   the extremes (a plain vw font-size goes unreadably small on a phone and
   oversized on an ultrawide) — the brief's own responsive fallback already
   suggests this same clamp for the H1. */

[data-theme] {
  --h-bg: #fbfbfd;
  --h-panel: #ffffff;
  --h-plate: #f0f1f4;
  --h-ink: #1d1d1f;
  --h-ink-2: #6e6e73;
  --h-ink-3: #86868b;
  --h-rule: rgba(0, 0, 0, 0.08);
  --h-accent: #5980a6;
  --h-accent-soft: #eef4fa;
  --h-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --h-shadow-hi: 0 12px 40px rgba(0, 0, 0, 0.11);
}
[data-theme="dark"] {
  --h-bg: #000000;
  --h-panel: #1c1c1e;
  --h-plate: #2c2c2e;
  --h-ink: #f5f5f7;
  --h-ink-2: #a1a1a6;
  --h-ink-3: #86868b;
  --h-rule: rgba(255, 255, 255, 0.12);
  --h-accent: #94bce3;
  --h-accent-soft: rgba(148, 188, 227, 0.14);
  --h-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --h-shadow-hi: 0 14px 44px rgba(0, 0, 0, 0.62);
}

body {
  margin: 0;
}

.sf {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  width: 100vw;
  overflow-x: hidden;
}
.sf h1, .sf h2 {
  font-family: inherit;
}

/* — header — */
.hub-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 3vw;
  padding: 0 4vw;
  height: 7vw;
  min-height: 44px;
  max-height: 64px;
  background: color-mix(in srgb, var(--h-bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--h-rule);
}
.hub-wordmark {
  font-size: clamp(13px, 1.2vw, 15px);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.hub-header-tag {
  font-size: clamp(10px, 1vw, 12px);
  color: var(--h-ink-3);
  justify-self: center;
  white-space: nowrap;
}
.hub-theme-wrap {
  display: flex;
  justify-content: flex-end;
}
.hub-seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--h-plate);
  border-radius: 980px;
}
.seg-btn {
  border: 0;
  background: transparent;
  border-radius: 980px;
  color: var(--h-ink-2);
  cursor: pointer;
  font-family: inherit;
  font-size: clamp(11px, 1vw, 12px);
  letter-spacing: 0.01em;
  padding: 6px 1.2vw;
  transition: background-color 200ms ease, color 200ms ease;
}
.seg-btn[data-on="1"] {
  background: var(--h-panel);
  color: var(--h-ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}
.seg-btn:focus-visible {
  outline: 2px solid var(--h-accent);
  outline-offset: 2px;
}

/* — hero — full width, no content max-width: side padding alone keeps the
   headline and search field off the edges on every screen size. */
.hub-hero {
  width: 100%;
  margin: 0 auto;
  padding: 10vw 4vw 7vw;
  text-align: center;
  box-sizing: border-box;
}
.hub-h1 {
  font-size: clamp(34px, 7.2vw, 72px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
  text-wrap: balance;
}
.hub-sub {
  font-size: clamp(16px, 2.1vw, 21px);
  line-height: 1.45;
  color: var(--h-ink-2);
  margin: 0 auto;
  max-width: 34ch;
}
.hub-search-wrap {
  width: 100%;
  max-width: 380px;
  margin: 4.4vw auto 0;
}
.srch {
  width: 100%;
  background: var(--h-panel);
  border: 1px solid var(--h-rule);
  border-radius: 980px;
  color: var(--h-ink);
  font-family: inherit;
  font-size: 15px;
  padding: 11px 20px;
  outline: none;
  box-shadow: var(--h-shadow);
  box-sizing: border-box;
  transition: border-color 200ms ease;
}
.srch::placeholder {
  color: var(--h-ink-3);
}
.srch:focus-visible {
  border-color: var(--h-accent);
}

/* — card grid — auto-fit so it naturally scales to more apps and folds to
   one column on narrow screens without a manual breakpoint. */
.hub-grid {
  width: 100%;
  margin: 0 auto;
  padding: 0 4vw;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 2.2vw;
}

.card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  background: var(--h-panel);
  border-radius: 28px;
  box-shadow: var(--h-shadow);
  overflow: hidden;
  transition: transform 260ms cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 260ms ease;
}
.card:hover,
.card:focus-visible {
  transform: translateY(-6px);
  box-shadow: var(--h-shadow-hi);
}
.card:hover .cta,
.card:focus-visible .cta {
  background: var(--h-accent);
  color: var(--h-panel);
  border-color: var(--h-accent);
}
.card-inner {
  padding: 4vw 4vw 4.4vw;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.card-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--h-accent);
}
.card-dot {
  font-size: 11px;
  color: var(--h-ink-3);
}
.card-status {
  font-size: 12px;
  color: var(--h-ink-3);
}
.card-status-pill {
  font-size: 12px;
  font-weight: 500;
  color: var(--h-ink);
  background: var(--h-accent-soft);
  padding: 2px 9px;
  border-radius: 980px;
}
.card-title {
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.card-body {
  font-size: 17px;
  line-height: 1.55;
  color: var(--h-ink-2);
  margin: 0 0 26px;
  max-width: 34ch;
}
.cta {
  display: inline-block;
  font-size: 15px;
  font-weight: 500;
  padding: 9px 22px;
  border-radius: 980px;
  border: 1px solid var(--h-accent);
  color: var(--h-accent);
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

.hub-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 17px;
  color: var(--h-ink-3);
  padding: 60px 0;
  margin: 0;
}

/* — add slot — */
.hub-add-wrap {
  width: 100%;
  margin: 2.2vw auto 0;
  padding: 0 4vw;
  box-sizing: border-box;
}
.add {
  display: grid;
  place-items: center;
  width: 100%;
  height: 9vw;
  min-height: 72px;
  max-height: 140px;
  border: 1px dashed var(--h-rule);
  border-radius: 28px;
  color: var(--h-ink-3);
  font-size: 15px;
  text-decoration: none;
  box-sizing: border-box;
  transition: border-color 200ms ease, color 200ms ease;
}
.add:hover,
.add:focus-visible {
  border-color: var(--h-accent);
  color: var(--h-accent);
}
.add:focus-visible {
  outline: 2px solid var(--h-accent);
  outline-offset: 2px;
}

.card:focus-visible {
  outline: 2px solid var(--h-accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .card-inner {
    padding: 32px 28px 34px;
  }
}

/* — access gate (/login) — shares every token and most components above
   (.hub-header, .hub-hero, .card-meta, .srch…) with the hub itself; only
   the password card and its form are new. */
.gate-section {
  width: 100%;
  margin: 0 auto;
  padding: 0 4vw;
  box-sizing: border-box;
}
.gate-card {
  max-width: 548px;
  margin: 0 auto;
  background: var(--h-panel);
  border-radius: 28px;
  box-shadow: var(--h-shadow);
  padding: 4vw 4vw 4.4vw;
  box-sizing: border-box;
}
.gate-form {
  display: flex;
  align-items: center;
  gap: 12px;
}
.gate-form .srch {
  flex: 1;
}
.gate-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.unlock {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 11px 24px;
  border-radius: 980px;
  border: 1px solid var(--h-accent);
  background: transparent;
  color: var(--h-accent);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 200ms ease, color 200ms ease, opacity 200ms ease;
}
.unlock:hover {
  background: var(--h-accent);
  color: var(--h-panel);
}
.unlock:disabled {
  opacity: 0.6;
  cursor: default;
}
.unlock:focus-visible {
  outline: 2px solid var(--h-accent);
  outline-offset: 2px;
}
.gate-error {
  font-size: 14px;
  color: #c8553d;
  margin: 16px 0 0;
}
.gate-footer {
  text-align: center;
  font-size: 12px;
  color: var(--h-ink-3);
  margin: 24px 0 0;
}

@media (max-width: 700px) {
  .gate-card {
    padding: 32px 28px 34px;
  }
  .gate-form {
    flex-direction: column;
    align-items: stretch;
  }
  .unlock {
    width: 100%;
  }
}
