/* Page CSS for the landing page: only what sits inside a visual and the kit lacks
   (taste-skill references/system.md). The kit itself is in /assets and stays unedited. */

/* Tailwind also makes `start-*` utilities (inset-inline-start); on kit pages they are grid columns. */
html[data-type] :is(.start-5, .start-7, .start-9, .start-10) {
  inset-inline-start: auto;
}

/* shadcn's token blocks (packages/ui globals.css, :root and .dark) also define --muted, --accent and --card,
   and it can load after the kit. On the landing page the kit's palette keeps them. */
html[data-type] {
  --muted: var(--p-muted);
  --muted-foreground: var(--p-muted);
  --accent: var(--p-accent);
  --card: var(--p-surface);
}

/* The brand's orange rule (packages/ui globals.css): a filled button darkens on hover, never lightens
   (the kit mixes toward the ink, which on a dark page drops white labels to about 3.5:1), and orange
   text is --p-link, which reads on both palettes (#d93a12 on near-black is only Lc 31). */
html[data-type] .btn--primary:hover {
  background: var(--p-action-hover);
}
html[data-type] :is(.footer ul a, .footer__nav a, .menu-col a):hover {
  color: var(--p-link);
}

/* The logo in the nav and the footer: the full mark at 28px, its smallest size with the sleepers
   (brand/README.md), over the kit's 24px. Under 390px wide the bar fits only the kit's 20px mark, so
   the nav swaps to the small drawing, made for 16-24px. */
.nav__logo > svg {
  width: 28px;
  height: 28px;
}
.nav__logo > .nav__mark--small {
  display: none;
}
@media (max-width: 389px) {
  .nav .nav__logo > .nav__mark {
    display: none;
  }
  .nav .nav__logo > .nav__mark--small {
    display: block;
    width: 20px;
    height: 20px;
  }
}

/* The theme switch (components/mode-toggle.tsx): an icon button on the bar's line, 36px like the
   words beside it. On a tablet and a phone it stays in the bar next to the main button, 44px with
   the menu button's border; under 390px wide the bar has no room, so it waits in the open sheet,
   under Sign in. */
.theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease);
}
.theme-switch:hover,
.theme-switch[data-popup-open] {
  background: color-mix(in oklab, var(--ink) 8%, transparent);
}
@media (max-width: 1023px) {
  .nav .nav__actions > .theme-switch {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-btn);
  }
  .nav:not(.is-open) .nav__actions > .theme-switch {
    display: inline-flex;
  }
  .nav.is-open .nav__actions > .theme-switch {
    order: 3;
    justify-self: center;
  }
}
@media (max-width: 639px) {
  .nav:not(.is-open) .nav__actions {
    gap: var(--s-2);
  }
}
@media (max-width: 389px) {
  .nav:not(.is-open) .nav__actions > .theme-switch {
    display: none;
  }
}
/* Its menu is shadcn's, in a portal: the kit's ground, radius and face. The page's --accent is the
   brand orange (above), so the highlighted row takes a quiet step of the ink instead. */
html[data-type] .theme-menu {
  --popover: var(--p-bg);
  --popover-foreground: var(--p-ink);
  --accent: color-mix(in oklab, var(--p-ink) 8%, var(--p-bg));
  --accent-foreground: var(--p-ink);
  border-radius: var(--r-md);
  font-family: var(--font-text);
}
html[data-type] .theme-menu [data-slot="dropdown-menu-radio-item"] {
  border-radius: var(--r-sm);
}

/* The Import window's page avatars: initials in the window's ink, so they read (the kit's mixed
   tone was about 2.4:1); the tone stays in the fill. */
.ui-win .ui-avatar {
  color: var(--u-ink);
}

/* Focus rings follow the orange rule (docs/brand-colours.md): --brand-mark, #d93a12 on light and
   #ff4a1f on dark. The kit's --action (#d93a12) is only 4.1:1 on the dark page. The URL field keeps
   the kit's outline only, without shadcn's ring on top. */
html[data-type] :focus-visible {
  outline-color: var(--brand-mark);
}
.import-form .field input:focus-visible {
  box-shadow: none;
}

/* The Import window's search box on the light page: the kit's --u-soft is 4.4:1 on its fill;
   #6b6b6c is 4.9:1 (5.3:1 on white). */
html[data-type]:not(.dark) .ui-win__search {
  color: #6b6b6c;
}

/* The hero's picture is the Import window on the lit panel. */
.hero__media--ui {
  display: block;
}
.hero__media--ui > .stage {
  position: absolute;
  inset: 0;
}
.hero__media--ui .at-corner.fit {
  --ax: 32px;
  --ay: 32px;
  --fit-max: 600px;
}

/* The URL box in the hero */
.import-form {
  /* .import-form isn't a kit .form, which is where the kit sets --error (the "!" badge and the reason) */
  --error: var(--p-error);
  display: grid;
  gap: var(--s-4);
  margin-top: var(--s-6);
  max-width: 460px;
}
.import-form .field input {
  height: 48px;
  font-size: 16px;
}
/* the kit's --line-strong is about 1.5:1; a field's edge needs 3:1 (an invalid one keeps --error) */
.import-form .field input:not([aria-invalid="true"]) {
  border-color: var(--p-field);
}
.import-form .btn-row {
  margin-top: 0;
}
.import-form__note,
.import-form__done {
  margin: 0;
  color: var(--ink);
}

.import-form .form__status:empty {
  display: none;
}
@media (max-width: 639px) {
  .import-form {
    margin-top: var(--s-5);
  }
}

/* app-frame (sections-library.md, the whole recipe) */
.app.ui {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  margin-top: var(--s-7);
  background: var(--u-bg);
  border: 1px solid var(--u-border);
  border-radius: var(--u-r);
  box-shadow: var(--u-shadow);
}
.app > .app__pane {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.app > .app__pane + .app__pane {
  border-left: 1px solid var(--u-line);
}
.app > .app__pane > .ui-panel {
  width: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.app > .app__pane::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 64px;
  background: linear-gradient(transparent, var(--u-bg));
  pointer-events: none;
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .app.ui {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  }
}
@media (max-width: 1023px) {
  .app.ui {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .app > .app__pane--list {
    max-height: 252px;
  }
  .app > .app__pane--list::after {
    display: none;
  }
  .app .ui-win__side {
    display: none;
  }
  .app .ui-win__body {
    grid-template-columns: minmax(0, 1fr);
  }
  .app > .app__pane + .app__pane {
    border-left: 0;
    border-top: 1px solid var(--u-line);
  }
}
@media (max-width: 639px) {
  .app.ui {
    grid-template-rows: minmax(0, 1fr);
  }
  .app > .app__pane--list {
    display: none;
  }
  .app > .app__pane + .app__pane {
    border-top: 0;
  }
}

/* comparison-table: 48px rows, each closed by a 1px rule; on a phone each plan is its own block */
.compare {
  margin-top: var(--s-7);
}
.compare__row {
  align-items: center;
  min-height: 48px;
}
.compare__row:not(.compare__row--head) {
  border-bottom: 1px solid var(--line);
}
.compare__row--head {
  min-height: 56px;
  font-weight: 500;
}
.compare__plan {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.compare__source {
  margin-top: var(--s-5);
}
.compare-blocks {
  display: none;
}
@media (max-width: 639px) {
  .compare {
    display: none;
  }
  .compare-blocks {
    display: grid;
    align-content: start;
    gap: var(--s-6);
    margin-top: var(--s-6);
  }
  .compare-blocks h3 {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin: 0 0 var(--s-2);
    font: 500 var(--t-lead) / 1.4 var(--font-text);
  }
  .compare-blocks dl {
    margin: 0;
  }
  .compare-blocks dl > div {
    display: flex;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-2) 0;
    border-bottom: 1px solid var(--line);
  }
  .compare-blocks dd {
    margin: 0;
    text-align: right;
  }
}

/* Questions: the platforms the Import reads, as their real marks */
.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.platforms .ic-chip > .ic {
  --ic-s: 24px;
}

/* close-word: Geist's ascenders run above a .86 line box, so give the name the box it needs. */
.close__word {
  line-height: 1.12;
}

/* The open item fills its pane; the note sits in the right margin so it never covers the page. */
.app__pane--open > .ui-doc {
  width: auto;
  height: 100%;
  padding: 40px 248px 0 40px;
}
.app__pane--open .ui-doc__note {
  right: 24px;
}
@media (max-width: 1279px) {
  .app__pane--open > .ui-doc {
    padding: 32px 224px 0 32px;
  }
}
@media (max-width: 639px) {
  .app__pane--open > .ui-doc {
    padding: 16px 16px 0;
  }
  .app__pane--open .ui-doc__note {
    display: none;
  }
}
