/* ==========================================================================
   Huely — shared chrome and layout for the pages either side of the builder.
   Loaded after main.css, which supplies the variables, buttons, chips and
   badges these pages reuse.
   ========================================================================== */

/* ------------------------------------------------------------- site nav */
/* Every page carries the same link row. Internal links are how a crawler
   finds the other five pages at all — nothing here is linked from a sitemap
   alone. */

.site-nav {
  display: flex;
  gap: 2px;
  align-items: center;
  overflow-x: auto;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-raised);
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  flex: 0 0 auto;
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--ink-dim);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* The brand lockup is a link back to the builder on every page except the
   builder itself, where it stays an h1. */
.brand-link { text-decoration: none; color: inherit; }

/* --------------------------------------------------------------- header */

.page-head {
  max-width: 860px;
  padding: 32px 16px 4px;
}
.page-head h1 {
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
}
/* Section headings on the gallery reuse the header's measure and padding so
   the groups line up with the page title above them. */
.page-head h2, h2.page-head {
  font-size: 19px;
  margin: 38px 0 -6px;
  scroll-margin-top: 80px;
}
h2.page-head { padding-bottom: 0; }
.page-head .lede {
  margin: 0;
  color: var(--ink-dim);
  font-size: 15.5px;
  max-width: 68ch;
}

.crumbs {
  font-size: 12.5px;
  color: var(--ink-dim);
  padding: 12px 16px 0;
  max-width: 860px;
}
.crumbs a { color: var(--ink-dim); }
.crumbs a:hover { color: var(--ink); }
/* Dimmer than the links either side of it, but still 4.67:1 on the page
   background — a separator is still text, and this site would be a poor place
   to ship a 2.7:1 one. */
.crumbs span { color: #7b7b92; padding: 0 4px; }

/* ------------------------------------------------------------ tool card */

.tool-wrap { padding: 22px 16px 0; max-width: 1000px; }
.tool-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  padding: 18px;
}
.tool-card + .tool-card { margin-top: 14px; }
.tool-card h2 { font-size: 15px; margin-bottom: 12px; }

.field-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.field {
  display: grid;
  gap: 5px;
  flex: 1 1 200px;
  min-width: 0;
}
.field > span { font-size: 12.5px; color: var(--ink-dim); }
.field-input { display: flex; gap: 6px; align-items: center; }
.field-input input[type="text"] { flex: 1 1 auto; min-width: 0; }
/* A native color input keeps the OS picker, which is the one users know. */
.field-input input[type="color"] {
  width: 40px;
  height: 34px;
  padding: 2px;
  flex: 0 0 auto;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.field input[type="range"] { width: 100%; accent-color: var(--accent); }

.swap-btn { flex: 0 0 auto; align-self: flex-end; margin-bottom: 1px; }

/* ------------------------------------------------------------- readouts */

.readout {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.verdict-big {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-input);
}
.verdict-big .ratio {
  font: 700 34px/1 var(--mono);
  letter-spacing: -0.03em;
}
.verdict-big .grades { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }

/* The pass/fail table is the answer people came for, so it reads as a table
   rather than as prose. */
.checks { display: grid; gap: 6px; }
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--bg-input);
  border-left: 3px solid var(--line);
  font-size: 13.5px;
}
.check-row.ok { border-left-color: var(--ok); }
.check-row.bad { border-left-color: var(--bad); }
.check-row .what { flex: 1 1 220px; }
.check-row .need { font: 500 12.5px/1 var(--mono); color: var(--ink-dim); }

.sample {
  padding: 20px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.sample .lg { font-size: 24px; font-weight: 650; margin: 0 0 6px; letter-spacing: -0.02em; }
.sample .sm { font-size: 15px; margin: 0; }
.sample .xs { font-size: 12.5px; margin: 8px 0 0; opacity: .85; }

/* -------------------------------------------------------- converter grid */

.formats { display: grid; gap: 7px; }
.format-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--bg-input);
}
.format-row dt {
  flex: 0 0 74px;
  font-size: 12px;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.format-row dd {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font: 500 13.5px/1.4 var(--mono);
  overflow-wrap: anywhere;
}
.format-row button { flex: 0 0 auto; }

.preview-block {
  height: 96px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font: 600 14px/1 var(--mono);
}

/* ------------------------------------------------------------- gallery */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
  padding: 22px 16px 0;
  max-width: 1400px;
}
.gal-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg-raised);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.gal-strip { display: flex; height: 92px; }
.gal-strip i { flex: 1; display: block; }
.gal-meta { padding: 12px 14px 14px; display: grid; gap: 6px; }
.gal-meta h2, .gal-meta h3 { font-size: 14.5px; }
.gal-meta p { margin: 0; font-size: 12.5px; color: var(--ink-dim); }
.gal-hexes {
  font: 500 11px/1.5 var(--mono);
  color: var(--ink-dim);
  overflow-wrap: anywhere;
}
.gal-actions { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }

/* ------------------------------------------------------------ long copy */
/* The reference page. Measure is capped because this is meant to be read,
   not scanned like the workspace. */

.doc { max-width: 780px; padding: 24px 16px 0; }
.doc h2 {
  font-size: 21px;
  margin: 40px 0 12px;
  scroll-margin-top: 96px;
  padding-top: 4px;
}
.doc h2:first-child { margin-top: 8px; }
.doc h3 { font-size: 15px; margin: 22px 0 6px; scroll-margin-top: 96px; }
.doc p, .doc li {
  color: var(--ink-dim);
  font-size: 14.5px;
  margin: 0 0 14px;
}
.doc li { margin-bottom: 7px; }
.doc ul, .doc ol { padding-left: 20px; margin: 0 0 16px; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc a { color: #8fc2ff; }
.doc code {
  font: 500 13px/1.4 var(--mono);
  background: var(--bg-input);
  padding: 1px 5px;
  border-radius: 5px;
  color: var(--ink);
}
.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 18px;
  font-size: 13.5px;
}
.doc th, .doc td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-dim);
}
.doc th { color: var(--ink); font-weight: 600; }

.toc {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg-raised);
  padding: 14px 18px;
  margin-bottom: 8px;
}
.toc p { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
.toc ul { columns: 2; column-gap: 24px; margin: 0; padding-left: 18px; }
.toc li { margin-bottom: 4px; font-size: 13.5px; }

/* ------------------------------------------------------------ next steps */
/* Contextual internal links at the foot of each page. They exist for readers,
   but they are also what spreads authority past the home page. */

.next-up {
  max-width: 1400px;
  padding: 34px 16px 0;
  border-top: 1px solid var(--line-soft);
  margin-top: 40px;
}
.next-up h2 { font-size: 15px; margin-bottom: 12px; }
.next-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}
.next-grid a {
  display: block;
  padding: 13px 15px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg-raised);
  text-decoration: none;
}
.next-grid a:hover { border-color: #3a3a48; }
.next-grid strong { display: block; font-size: 13.5px; color: var(--ink); margin-bottom: 3px; }
.next-grid span { font-size: 12.5px; color: var(--ink-dim); }

/* ----------------------------------------------------- image extractor */

.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg-input);
  padding: 34px 18px;
  text-align: center;
  display: grid;
  gap: 6px;
  justify-items: center;
  transition: border-color .12s, background .12s;
}
.dropzone.is-over { border-color: var(--accent); background: #23232e; }
.dropzone p { margin: 0; }
.dropzone .note { margin: 0; }
/* A styled label standing in for the file input, which cannot be styled. */
.file-btn { cursor: pointer; margin: 6px 0 2px; }

.ex-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  margin-top: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  cursor: crosshair;
  /* Preserve the source pixels: this canvas is a sampling surface, and the
     browser's smoothing would hand back colors that are not in the image. */
  image-rendering: pixelated;
}

.ex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.ex-swatch {
  border: 0;
  border-radius: var(--radius);
  padding: 18px 12px 12px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  display: grid;
  gap: 3px;
}
.ex-swatch:hover { filter: brightness(1.06); }
.ex-hex { font: 600 14px/1.2 var(--mono); }
.ex-share { font-size: 11.5px; opacity: .8; }

/* ------------------------------------------------------------ gradients */

.grad-preview {
  height: 190px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-top: 14px;
}

.stop-list { display: grid; gap: 8px; }
.stop-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--bg-input);
}
.stop-row input[type="color"] {
  width: 38px;
  height: 32px;
  padding: 2px;
  flex: 0 0 auto;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.stop-row input[type="text"] { width: 92px; flex: 0 0 auto; }
.stop-row input[type="range"] { flex: 1 1 130px; min-width: 100px; accent-color: var(--accent); }
.stop-row .need { flex: 0 0 42px; text-align: right; }

/* ----------------------------------------------------------------- ads */
/* Placeholders are removed outright when ads are off, so this only ever
   applies to a slot that is actually going to be filled. */

.ad-slot {
  max-width: 1000px;
  margin: 22px 16px 0;
  min-height: 90px;
}

/* ------------------------------------------------------------- consent */
/* Appended to <body> by consent.js, and only for a visitor who has not
   answered yet. Pinned to the bottom rather than centred over the page: the
   tools stay usable while the question is open, which is the point of asking
   with a bar instead of a modal. */

.consent {
  position: fixed;
  z-index: 90;
  left: 12px;
  right: 12px;
  bottom: 12px;
  margin: 0 auto;
  max-width: 720px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  box-shadow: 0 12px 34px rgb(0 0 0 / .45);
}

.consent-copy {
  flex: 1 1 320px;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-dim);
}
.consent-copy a { color: var(--ink); }

.consent-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  margin-left: auto;
}

@media (prefers-reduced-motion: no-preference) {
  .consent { animation: consent-in .22s ease-out; }
  @keyframes consent-in {
    from { opacity: 0; transform: translateY(8px); }
  }
}

/* ----------------------------------------------------------------- 404 */

.oops { max-width: 620px; padding: 72px 16px 0; }
.oops h1 { font-size: 34px; letter-spacing: -0.03em; margin-bottom: 10px; }
.oops p { color: var(--ink-dim); margin: 0 0 22px; }

/* ---------------------------------------------------------- responsive */

@media (max-width: 700px) {
  .page-head { padding: 24px 12px 4px; }
  .page-head h1 { font-size: 25px; }
  .crumbs, .site-nav { padding-left: 12px; padding-right: 12px; }
  .tool-wrap, .doc, .gallery, .next-up { padding-left: 12px; padding-right: 12px; }
  .toc ul { columns: 1; }
  .verdict-big .grades { margin-left: 0; }
  .format-row dt { flex-basis: 100%; }
}
