/* PickleUp Tools Hub – styles. Brand constants come from CLAUDE.md §2. */

:root {
  --ink: #151515;
  --cream: #fffbf8;
  --amber: #F0A420;

  --surface: #1e1e1e;
  --surface-hover: #252525;
  --line: rgba(255, 251, 248, 0.14);
  --muted: rgba(255, 251, 248, 0.72);
  --error: #ff6b5e;

  --font-display: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  --font-ui: 'Quantico', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --lean: -10deg;            /* forward lean for buttons, chips, badges */
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1120px;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
}

main { flex: 1; }

a { color: var(--amber); }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--amber);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border-radius: 6px;
}
.skip-link:focus { top: 12px; }

/* --- Header -------------------------------------------------------------- */

.site-header {
  border-bottom: 3px solid var(--amber);
  padding-block: 28px 24px;
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
}

.site-header__brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-inline: 4px;
}

/* Leaning button (CLAUDE.md §2 motif). Works on <button> and <a>; the inner
   <span> is counter-skewed so the label stays upright. */
.lean-btn {
  display: inline-block;
  transform: skewX(var(--lean));
  padding: 9px 18px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: var(--amber);
  border: 2px solid var(--amber);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.lean-btn > span { display: inline-block; transform: skewX(calc(var(--lean) * -1)); }
.lean-btn:hover { background: #f5b84a; border-color: #f5b84a; }
.lean-btn--ghost { color: var(--cream); background: transparent; border-color: var(--line); }
.lean-btn--ghost:hover { background: transparent; border-color: var(--amber); }
.lean-btn--small { padding: 5px 12px; font-size: 0.8rem; }

/* Page tabs (Tools · Drive · Manage tools): the current page is filled. */
.site-tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.lean-btn--tab { color: var(--cream); background: transparent; border-color: var(--line); }
.lean-btn--tab:hover { background: transparent; border-color: var(--amber); }
.lean-btn--tab[aria-current="page"] { color: var(--ink); background: var(--amber); border-color: var(--amber); }
.lean-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.lean-btn--ghost:disabled:hover { border-color: var(--line); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
  color: var(--cream);
  border-radius: 4px;
}

/* The real logo file, unchanged (public/assets/logo.svg). */
.brand__logo {
  display: block;
  width: auto;
  height: clamp(56px, 12vw, 80px);
}

.brand__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 3.5rem);
  letter-spacing: 0.02em;
  line-height: 0.9;
}

.site-header__tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* --- Search and filters -------------------------------------------------- */

.controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-block: 28px 8px;
}

.search {
  width: 100%;
  max-width: 520px;
  padding: 12px 16px;
  font: inherit;
  color: var(--cream);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.search::placeholder { color: var(--muted); opacity: 1; }
.search:focus-visible { outline-offset: 0; border-color: var(--amber); }
.search:disabled { opacity: 0.6; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  /* room so the leaning edges never clip */
  padding-inline: 4px;
}

/* The chip leans forward; its label is counter-skewed so text stays upright. */
.chip {
  transform: skewX(var(--lean));
  padding: 7px 16px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--cream);
  background: transparent;
  border: 2px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.chip > span { display: inline-block; transform: skewX(calc(var(--lean) * -1)); }
.chip:hover { border-color: var(--amber); }
.chip[aria-pressed="true"] {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink);
}

.status {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* --- Tool cards ---------------------------------------------------------- */

.results { padding-block: 8px 48px; }
.results:focus { outline: none; }

.group { margin-top: 28px; }

.group__title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.6rem;
  letter-spacing: 0.04em;
  color: var(--amber);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.grid > li { display: flex; }

.card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  color: var(--cream);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
}
.card:hover {
  border-color: var(--amber);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.card__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.card__name {
  flex: 1;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.9rem;
  letter-spacing: 0.02em;
  line-height: 1;
}

.card__external {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 4px;
  color: var(--amber);
}

.card__folder {
  flex: none;
  width: 26px;
  height: 26px;
  color: var(--amber);
}

.grid--first { margin-top: 28px; }

.badge {
  flex: none;
  align-self: center;
  transform: skewX(var(--lean));
  padding: 2px 9px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--amber);
  border-radius: 3px;
}
.badge > span { display: inline-block; transform: skewX(calc(var(--lean) * -1)); }

.card__desc {
  margin: 0;
  color: var(--muted);
}

.card__browser {
  margin: 0;
  font-size: 0.85rem;
  color: var(--amber);
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: auto 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}

/* --- Empty and error states --------------------------------------------- */

.notice {
  max-width: 560px;
  margin-top: 28px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
}
.notice__title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}
.notice p { margin: 0; color: var(--muted); }
.notice p + p { margin-top: 8px; }
.notice__detail { font-size: 0.8rem; }

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

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 20px;
  font-size: 0.85rem;
  color: var(--muted);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
}
.site-footer p { margin: 0; }
.site-footer code { font-family: inherit; color: var(--cream); }

/* --- Guided tour (assets/tour.js) --------------------------------------- */

.tour {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none; /* the page underneath stays usable */
}

/* The highlight: a clear window with everything around it dimmed. */
.tour__spot {
  position: fixed;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.68);
  outline: 3px solid var(--amber);
  outline-offset: 2px;
  transition: top 0.25s, left 0.25s, width 0.25s, height 0.25s;
}
.tour__spot--none { outline: none; }

.tour__pop {
  position: fixed;
  width: min(360px, calc(100vw - 32px));
  padding: 18px 20px;
  pointer-events: auto;
  color: var(--cream);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--amber);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.tour__pop:focus { outline: none; }
.tour__pop--centre { top: 50%; left: 50%; transform: translate(-50%, -50%); }

.tour__count {
  margin: 0 0 4px;
  color: var(--amber);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tour__title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.7rem;
  letter-spacing: 0.02em;
  line-height: 1.05;
}

.tour__text { margin: 0; color: var(--muted); font-size: 0.95rem; }

.tour__try { margin-top: 12px; }

.tour__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.tour__skip {
  margin-right: auto;
  padding: 4px 0;
  font: inherit;
  font-size: 0.85rem;
  color: var(--muted);
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}
.tour__skip:hover { color: var(--cream); }

/* Phones: the explanation sits at the bottom of the screen. */
@media (max-width: 599px) {
  .tour__pop:not(.tour__pop--centre) { left: 16px !important; right: 16px; top: auto !important; bottom: 16px; width: auto; }
}

/* First-visit offer */
.tour-offer {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 900;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--amber);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.tour-offer p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .card, .chip, .lean-btn { transition: none; }
  .card:hover { transform: none; }
  .tour__spot { transition: none; }
}
