/* ==========================================================================
   RVThere Labs — components
   ========================================================================== */

/* --- Masthead ----------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(8, 8, 10, .78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 78px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 0;
}

/* The full horizontal lockup, recoloured for the dark ground: the navy is
   lifted to near-white and the V's gradient is remapped onto a brighter ramp,
   because deep blue on near-black reads as dark however good its contrast
   ratio looks. Height-constrained; the image carries the site name, so no
   text sits beside it. */
.wordmark__logo {
  height: 40px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.wordmark__logo--foot { height: 34px; }

/* Step down rather than wrap — the lockup is 6.4:1, so it eats width fast. */
@media (max-width: 860px) {
  .wordmark__logo { height: 34px; }
}

@media (max-width: 480px) {
  .wordmark__logo { height: 27px; }
}

/* Context label for the course area, set against the lockup baseline. */
.wordmark__suffix {
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  font-weight: 400;
  color: var(--text-muted);
  padding-left: 12px;
  margin-left: 2px;
  border-left: 1px solid var(--rule-mid);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .wordmark__suffix { display: none; }
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-sm);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  color: var(--text-muted);
  padding: 7px 11px;
  border-radius: 7px;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  white-space: nowrap;
}

.nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .05);
}

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

.nav a[aria-current="page"]::after {
  content: '';
  display: block;
  height: 1.5px;
  margin-top: 4px;
  background: var(--accent);
  border-radius: 2px;
}

.nav__cta {
  margin-left: 8px;
  background: var(--text);
  color: var(--ink) !important;
  font-weight: 600;
  border-radius: 999px !important;
  padding: 8px 18px !important;
}

.nav__cta:hover {
  background: var(--accent) !important;
  color: #fff !important;
}

/* Search affordance + mobile menu toggle */
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--rule-mid);
  background: transparent;
  color: var(--text-dim);
  font-size: var(--text-meta);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.icon-btn:hover {
  border-color: var(--accent-line);
  color: var(--text);
}

.icon-btn kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  border: 1px solid var(--rule-mid);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text-dim);
}

.nav-toggle { display: none; }

@media (max-width: 1080px) {
  .nav__links { display: none; }
  .nav-toggle { display: inline-flex; }

  .masthead.is-open .nav__links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    position: absolute;
    left: 0;
    right: 0;
    top: 78px;
    padding: 12px var(--gutter) 22px;
    background: rgba(8, 8, 10, .97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--rule);
    max-height: calc(100vh - 78px);
    overflow-y: auto;
  }

  .masthead.is-open .nav__links a {
    padding: 12px 10px;
    font-size: var(--text-base);
  }

  .masthead.is-open .nav__cta {
    margin: 10px 0 0;
    text-align: center;
  }

  .nav a[aria-current="page"]::after { display: none; }

  .nav a[aria-current="page"] {
    background: var(--accent-wash);
    color: var(--accent-bright);
  }
}

@media (max-width: 560px) {
  .icon-btn span,
  .icon-btn kbd { display: none; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  transition:
    background var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--text); color: var(--ink); }
.btn--primary:hover { background: var(--accent); color: #fff; }

.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-bright); }

.btn--ghost { border-color: var(--rule-mid); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-bright); }

/* Inline text link with a travelling arrow */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-weight: 500;
  font-size: 14px;
}

.link-arrow::after {
  content: '\2192';
  transition: transform var(--dur) var(--ease);
}

.link-arrow:hover::after { transform: translateX(4px); }

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

.hero { padding-block: clamp(48px, 3rem + 3.5vw, 96px) clamp(44px, 2.6rem + 2.6vw, 80px); }

.hero__grid {
  display: grid;
  gap: clamp(40px, 5vw, 72px);
  align-items: end;
}

@media (min-width: 1000px) {
  .hero__grid { grid-template-columns: minmax(0, 1.35fr) minmax(320px, .85fr); }
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  color: var(--accent);
  border: 1px solid var(--accent-line);
  background: var(--accent-wash);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 28px;
}

.hero__badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 163, 255, .18);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}

.hero__title {
  font-size: var(--text-display);
  margin-bottom: 26px;
}

.hero__title em {
  font-style: normal;
  background: linear-gradient(96deg, var(--accent), var(--accent-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 38px;
}

/* Spec panel — the hero's counterweight. Reads like a datasheet. */
.spec {
  border: 1px solid var(--rule-mid);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--ink-raised), var(--ink-sunken));
  overflow: hidden;
}

.spec__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.spec__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--mint);
}

.spec__status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint);
}

.spec__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--rule);
}

.spec__row:last-child { border-bottom: 0; }

.spec__val {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.spec__label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.45;
  text-align: right;
}

/* --- Page header (interior pages) --------------------------------------- */

.page-head { padding-block: clamp(52px, 3.5rem + 4vw, 104px) clamp(32px, 2rem + 2vw, 56px); }

.page-head h1 {
  font-size: var(--text-h1);
  margin: 16px 0 22px;
}

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

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--ink-raised);
  text-align: left;
  transition:
    border-color var(--dur) var(--ease),
    background var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.card:hover {
  border-color: var(--accent-line);
  background: var(--ink-raised-2);
  transform: translateY(-3px);
}

/* Corner tick: appears on hover, a small drafting mark. */
.card::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 9px;
  height: 9px;
  border-top: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.card:hover::after { opacity: 1; }

.card__tag {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--accent);
  letter-spacing: .06em;
}

.card__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.card__body {
  font-size: 14px;
  line-height: 1.62;
  color: var(--text-muted);
  flex: 1;
  margin: 0;
}

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); }

/* Columns of prose separated by hairlines, not gaps. */
.rule-cols {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
}

.rule-cols > * {
  padding: 26px 0;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 820px) {
  .rule-cols { grid-template-columns: repeat(var(--cols, 3), 1fr); }

  .rule-cols > * {
    padding: 30px 30px 34px;
    border-right: 1px solid var(--rule);
    border-bottom: 0;
  }

  .rule-cols > *:first-child { padding-left: 0; }
  .rule-cols > *:last-child { border-right: 0; }
}

.rule-cols h3 {
  font-size: 15.5px;
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: 0;
  margin-bottom: 11px;
}

.rule-cols p {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-muted);
}

/* --- Statement (oversized editorial pull) ------------------------------- */

.statement {
  text-align: center;
  padding-block: clamp(72px, 5rem + 5vw, 148px);
  background: radial-gradient(ellipse 60% 100% at 50% 50%, var(--accent-wash), transparent 70%);
}

.statement__text {
  font-family: var(--font-display);
  font-size: clamp(36px, 1.6rem + 4.6vw, 76px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.04;
}

.statement__text span { color: #43474F; }

/* --- Data list (roles, repos, timeline) --------------------------------- */

.list { border-top: 1px solid var(--rule); }

.list__row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 22px 4px;
  border-bottom: 1px solid var(--rule);
  transition: background var(--dur) var(--ease), padding-left var(--dur) var(--ease);
}

.list__row:hover {
  background: rgba(255, 255, 255, .022);
  padding-left: 14px;
}

.list__title { font-size: 16px; font-weight: 600; flex: 1 1 260px; }
.list__aside { font-size: var(--text-sm); color: var(--text-muted); flex-shrink: 0; }
.list__arrow { color: var(--accent); transition: transform var(--dur) var(--ease); }
.list__row:hover .list__arrow { transform: translateX(5px); }

/* --- Filter bar --------------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 34px;
}

.filter {
  padding: 8px 17px;
  border-radius: 999px;
  border: 1px solid var(--rule-mid);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--text-sm);
  cursor: pointer;
  transition:
    border-color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease);
}

.filter:hover { border-color: var(--rule-strong); color: var(--text); }

.filter[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent-bright);
}

/* --- Entry (paper / post) ----------------------------------------------- */

.entry {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 28px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--ink-raised);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.entry:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}

.entry__meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.entry__cat {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 3px 10px;
}

.entry__title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.25;
}

.entry__abstract {
  font-size: 14px;
  line-height: 1.62;
  color: var(--text-muted);
  flex: 1;
  margin: 0;
}

.entry__foot {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--text-dim);
}

.is-hidden { display: none !important; }

/* --- Footer ------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--rule);
  padding-block: 64px 40px;
  position: relative;
  z-index: 1;
}

.footer__grid {
  display: grid;
  gap: 40px;
  margin-bottom: 52px;
}

@media (min-width: 760px) {
  .footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: var(--text-sm);
}

.footer__col h2 {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  font-weight: 400;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.footer__col a { color: var(--text-muted); width: fit-content; }
.footer__col a:hover { color: var(--accent); }

.footer__bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-size: var(--text-meta);
  color: var(--text-dim);
  border-top: 1px solid var(--rule);
  padding-top: 22px;
}

.footer__links { display: flex; gap: 20px; }

.footer__bar a { color: var(--text-dim); }
.footer__bar a:hover { color: var(--text-muted); }

/* --- Command palette ---------------------------------------------------- */

.palette[hidden] { display: none; }

.palette {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(4, 4, 6, .62);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  padding: clamp(60px, 14vh, 150px) 20px 20px;
}

.palette__panel {
  width: min(580px, 100%);
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  background: var(--ink-raised);
  border: 1px solid var(--rule-mid);
  border-radius: 16px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .7);
  overflow: hidden;
}

.palette__input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 17px 20px;
  font-size: 15px;
  outline: none;
}

.palette__input::placeholder { color: var(--text-dim); }

.palette__list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
}

.palette__list li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 11px 14px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
}

.palette__list li[aria-selected="true"] {
  background: var(--accent-wash);
  color: var(--accent-bright);
}

.palette__list li span:last-child {
  margin-left: auto;
  font-size: var(--text-meta);
  color: var(--text-dim);
}

.palette__empty {
  padding: 18px 14px;
  color: var(--text-dim);
  font-size: var(--text-sm);
}
