/* ---------------------------------------------------------------------------
   orenbj.com — component layer
   ---------------------------------------------------------------------------
   Built on the tokens in brand.css, which this file requires:

       <link rel="stylesheet" href="/brand.css">
       <link rel="stylesheet" href="/ui.css">

   brand.css is injected on every branded page and stays small. This file is
   opt-in, because a map application needs none of it and should not pay for it.

   Adopt it when rebuilding a page rather than restyling by hand: a page built
   from these classes matches the home page by construction, and inherits the
   contrast results rather than re-earning them.

   Not every page should adopt it. Metric Equinox is deliberately exempt — its
   own palette and type are the substance of that project.
   --------------------------------------------------------------------------- */

/* --- base ---------------------------------------------------------------- */

.ob-page {
  background-color: var(--ob-bg);
  background-image:
    radial-gradient(circle at 10% 0%,   rgba(251, 146, 60, 0.10) 0%, transparent 40%),
    radial-gradient(circle at 90% 20%,  rgba(192, 132, 252, 0.10) 0%, transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(96, 165, 250, 0.10) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--ob-fg);
  font-family: var(--ob-font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.ob-container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

/* --- type ---------------------------------------------------------------- */

/* The gradient wordmark. Reserved for a page's own title — using it on
   section headings spends the one bold move the palette has. */
.ob-display {
  font-size: clamp(2.5rem, 10vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: var(--ob-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-wrap: balance;
}

.ob-h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  text-wrap: balance;
}

.ob-h3 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ob-lead   { font-size: 1.1rem; }
.ob-muted  { color: var(--ob-muted); }
.ob-small  { font-size: 0.9rem; }

/* Digits that line up in a column — tables, timers, readouts. */
.ob-nums { font-variant-numeric: tabular-nums; }

/* --- surfaces ------------------------------------------------------------ */

.ob-card {
  background-color: var(--ob-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--ob-border);
  border-radius: var(--ob-radius);
  padding: clamp(1.25rem, 4vw, 1.75rem);
  box-shadow: var(--ob-shadow);
}

/* Only for a card that is itself a link or button. A static card should not
   animate on hover — it promises an interaction it does not have. */
a.ob-card,
button.ob-card {
  display: block;
  text-align: left;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s ease, box-shadow 0.3s ease;
}

a.ob-card:hover,
a.ob-card:focus-visible,
button.ob-card:hover,
button.ob-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--ob-purple);
  box-shadow: var(--ob-shadow-hover);
}

.ob-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1rem, 3vw, 1.5rem);
}

/* --- controls ------------------------------------------------------------ */

.ob-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--ob-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ob-fg);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.ob-btn:hover,
.ob-btn:focus-visible {
  color: var(--ob-purple);
  border-color: var(--ob-purple);
  background: rgba(192, 132, 252, 0.10);
}

.ob-btn--primary {
  background: var(--ob-purple);
  border-color: var(--ob-purple);
  color: #1a0b2e;
  font-weight: 600;
}

.ob-btn--primary:hover,
.ob-btn--primary:focus-visible {
  color: #1a0b2e;
  background: #d4a5fd;
  border-color: #d4a5fd;
}

.ob-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* One visible focus treatment for everything that takes focus. */
.ob-page :focus-visible,
.ob-btn:focus-visible,
.ob-input:focus-visible {
  outline: 2px solid var(--ob-purple);
  outline-offset: 2px;
}

.ob-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ob-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ob-muted);
  letter-spacing: 0.01em;
}

.ob-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--ob-border);
  border-radius: var(--ob-radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ob-fg);
  font: inherit;
  font-size: 0.95rem;
}

.ob-input::placeholder { color: var(--ob-muted); opacity: 1; }
.ob-input:focus { border-color: var(--ob-purple); outline-offset: 0; }

select.ob-input {
  appearance: none;
  padding-right: 2rem;
  /* Caret drawn as a gradient pair so it needs no image request. */
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ob-muted) 50%),
    linear-gradient(135deg, var(--ob-muted) 50%, transparent 50%);
  background-position: right 1.1rem center, right 0.85rem center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* --- data ---------------------------------------------------------------- */

/* Wrap a table in this so a wide table scrolls on its own instead of
   pushing the page sideways. */
.ob-table-scroll { overflow-x: auto; }

.ob-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.ob-table th,
.ob-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--ob-border);
}

.ob-table th {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ob-muted);
  white-space: nowrap;
}

.ob-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.ob-table td.ob-num,
.ob-table th.ob-num { text-align: right; }

.ob-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ob-muted);
}

.ob-badge--orange { background: rgba(251, 146, 60, 0.14); color: var(--ob-orange); }
.ob-badge--purple { background: rgba(192, 132, 252, 0.14); color: var(--ob-purple); }
.ob-badge--blue   { background: rgba(96, 165, 250, 0.14);  color: var(--ob-blue); }

.ob-rule {
  border: 0;
  border-top: 1px solid var(--ob-border);
  margin-block: clamp(2rem, 5vw, 3rem);
}

@media (prefers-reduced-motion: reduce) {
  .ob-btn,
  a.ob-card,
  button.ob-card { transition: none; }

  a.ob-card:hover,
  a.ob-card:focus-visible,
  button.ob-card:hover,
  button.ob-card:focus-visible { transform: none; }
}
