/* ==========================================================================
   Vela — guides and blog (the pages website-src/build.py writes)
   Builds on vela.css; article pages also load page-legal.css for the contents
   menu and the reading column. Every colour here is a vela.css theme token.
   ========================================================================== */

/* ---- Breadcrumb ------------------------------------------------------------ */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 18px;
  font: 600 11.5px/1.5 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3);
}
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { opacity: 0.5; }

/* ---- Article hero ---------------------------------------------------------- */
.article-main { --toc-w: 228px; --toc-gap: clamp(40px, 5vw, 76px); }
.article-hero { padding-bottom: clamp(26px, 4vw, 46px); }
.article-hero .glow { top: -140px; }
.article-hero .wrap { position: relative; }
.article-hero h1 {
  font-size: clamp(34px, 5.6vw, 62px); line-height: 1.03; letter-spacing: -0.035em;
  margin: 0 0 18px; max-width: 15.5em; text-wrap: balance;
}
.article-hero .lead { max-width: 36em; text-wrap: pretty; }
.article-hero .page-meta { margin-top: 24px; }
.article-hero .chip .icon { width: 13px; height: 13px; color: var(--text-3); }
.chip-plat { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.34); background: rgba(var(--accent-rgb), 0.07); }
a.chip-link { text-decoration: none; transition: color 0.2s, border-color 0.2s; }
a.chip-link:hover { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.5); }

/* The topic's icon on a glass tile, with two slow rings (wide screens only) */
.article-art { display: none; }
@media (min-width: 1200px) {
  .article-hero h1, .article-hero .lead { max-width: min(15.5em, calc(100% - 320px)); }
  .article-hero .lead { max-width: min(36em, calc(100% - 320px)); }
  .article-art {
    display: grid; place-items: center; position: absolute; right: calc(var(--gutter) + 1%); top: 50%;
    width: clamp(210px, 17vw, 250px); aspect-ratio: 1; transform: translateY(-50%);
  }
  .article-art::before {
    content: ""; position: absolute; inset: 14%; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(var(--accent-rgb), 0.2), transparent 76%);
  }
  .article-art i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--line-2); }
  .article-art i + i { inset: 15%; border: 1px dashed rgba(var(--accent-rgb), 0.5); }
  .article-art span {
    position: relative; display: grid; place-items: center; width: 44%; aspect-ratio: 1; border-radius: 28%;
    color: var(--accent); border: 1px solid rgba(var(--accent-rgb), 0.3);
    background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.2), rgba(var(--accent-rgb), 0.05) 70%), var(--bg-2);
    box-shadow: 0 24px 60px -18px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }
  .article-art .icon { width: 46%; height: 46%; stroke-width: 1.5; }
}
@media (min-width: 1200px) and (prefers-reduced-motion: no-preference) {
  .article-art i + i { animation: article-ring 70s linear infinite; }
}
@keyframes article-ring { to { transform: rotate(360deg); } }

/* ---- The text ---------------------------------------------------------------- */
.article-docs { padding-bottom: clamp(56px, 8vw, 96px); }
.article-prose { font-size: 17.5px; line-height: 1.72; }
.article-prose > p:first-child { font-size: 1.08em; color: var(--text); }
.article-prose h2 {
  margin-top: 2.1em; padding-top: 1.5em; border-top: 1px solid var(--line);
  font-size: clamp(25px, 3vw, 31px); line-height: 1.14; letter-spacing: -0.028em; text-wrap: balance;
}
.article-prose h2 + * { margin-top: 0.85em; }
.article-prose h3 { margin-top: 1.9em; font-size: 20.5px; line-height: 1.3; letter-spacing: -0.015em; }
.article-prose h3 + * { margin-top: 0.6em; }
.article-prose ol:not(.steps) { padding-left: 1.4em; }
.article-prose ol:not(.steps) > li::marker { color: var(--accent); font: 600 0.86em var(--font-mono); }
.article-prose li > ul, .article-prose li > ol { margin-top: 0.5em; }
.article-prose img { max-width: 100%; height: auto; border-radius: 16px; }

/* Numbered steps, each on its own card */
.article-prose ol.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 10px; }
.article-prose ol.steps > li {
  counter-increment: step; position: relative; margin: 0; padding: 15px 18px 15px 62px; min-height: 60px;
  border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
}
.article-prose ol.steps > li::before {
  content: counter(step); position: absolute; left: 15px; top: 13px; width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; font: 600 13px/1 var(--font-mono); color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12); border: 1px solid rgba(var(--accent-rgb), 0.22);
}
.article-prose ol.steps > li > * + * { margin-top: 0.5em; }

/* Notes: a tip, or a warning */
.article-prose .note {
  position: relative; padding: 16px 20px 16px 52px; border-radius: 18px; color: var(--text);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.1), rgba(var(--accent-rgb), 0.03) 70%);
}
.article-prose .note::before {
  content: ""; position: absolute; left: 19px; top: 21px; width: 18px; height: 18px; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 2.3 6.2L20.5 11.5l-6.2 2.3L12 20l-2.3-6.2-6.2-2.3 6.2-2.3L12 3Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 2.3 6.2L20.5 11.5l-6.2 2.3L12 20l-2.3-6.2-6.2-2.3 6.2-2.3L12 3Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.article-prose .note.warn { border-color: color-mix(in srgb, var(--warn) 42%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--warn) 12%, transparent), color-mix(in srgb, var(--warn) 3%, transparent) 70%); }
.article-prose .note.warn::before {
  background: var(--warn);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5h.01'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5h.01'/%3E%3C/svg%3E");
}
.article-prose .note > * + * { margin-top: 0.5em; }

/* "Mac" / "iPhone" tags in front of a step that differs by device */
.plat {
  display: inline-block; margin-right: 6px; padding: 3px 8px; border-radius: 7px; vertical-align: 0.12em;
  font: 600 10.5px/1.2 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); background: rgba(var(--accent-rgb), 0.1); border: 1px solid rgba(var(--accent-rgb), 0.24);
}

/* Keyboard shortcuts as a list */
.article-prose ul.keys {
  list-style: none; margin-left: 0; padding: 0 clamp(16px, 3vw, 24px); display: grid;
  border-radius: 18px; border: 1px solid var(--line); background: var(--surface);
}
.article-prose ul.keys > li {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; margin: 0; padding: 8px 0;
  color: var(--text);
}
.article-prose ul.keys > li + li { border-top: 1px solid var(--line); }
.article-prose ul.keys > li::before { content: none; }
.article-prose ul.keys > li > span:last-child { display: inline-flex; gap: 5px; flex: none; }
@media (min-width: 720px) { .article-prose ul.keys.two { grid-template-columns: 1fr 1fr; column-gap: clamp(24px, 4vw, 44px); } .article-prose ul.keys.two > li:nth-child(2) { border-top: 0; } }

/* Tables: scroll sideways on phones instead of squeezing */
.article-prose .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 16px; }
.article-prose table, .article-prose .table-wrap table { display: table; width: 100%; min-width: 0; border-collapse: collapse; }
.article-prose th { background: var(--surface); font-size: 14px; }
@media (min-width: 720px) { .article-prose th { white-space: nowrap; } }
@media (max-width: 559px) {
  .article-prose table { font-size: 14px; }
  .article-prose th, .article-prose td { padding: 9px 10px; }
  .article-prose th { font-size: 13px; }
}
.article-prose tr:last-child td { border-bottom: 0; }
.article-prose td:first-child { color: var(--text); font-weight: 500; }

/* Code */
.article-prose pre {
  margin: 1.3em 0; padding: 16px 18px; border-radius: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: 14px; line-height: 1.6; tab-size: 2;
}
.article-prose pre code { padding: 0; background: none; font-size: inherit; }

/* ---- Questions ------------------------------------------------------------- */
.article-faq, .article-cta, .article-more { max-width: 720px; }
.article-faq { margin-top: clamp(48px, 7vw, 72px); padding-top: clamp(36px, 5vw, 48px); border-top: 1px solid var(--line); }
.article-faq .h-sub { margin-bottom: 20px; }
.article-faq .faq summary { font-size: 17px; }

/* ---- Get Vela -------------------------------------------------------------- */
.article-cta {
  margin-top: clamp(44px, 6vw, 64px); padding: clamp(24px, 4vw, 34px); border-radius: var(--radius);
  display: grid; gap: 22px; align-items: center; position: relative; overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  background: radial-gradient(120% 140% at 100% 0%, rgba(var(--accent-rgb), 0.16), transparent 60%), var(--surface);
}
.article-cta .eyebrow { margin-bottom: 12px; }
.article-cta .h-sub { margin-bottom: 8px; }
.article-cta p:not(.eyebrow) { color: var(--text-2); }
.article-cta .icon-apple { width: 17px; height: 17px; }
@media (min-width: 760px) { .article-cta { grid-template-columns: minmax(0, 1fr) auto; } .article-cta .btn-row { flex-direction: column; align-items: stretch; } }

/* ---- Keep reading ---------------------------------------------------------- */
.article-more { margin-top: clamp(52px, 7vw, 80px); padding-top: clamp(36px, 5vw, 48px); border-top: 1px solid var(--line); }
.more-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 18px; margin-bottom: 20px; }
.article-more .post-grid { grid-template-columns: 1fr; }
.more-links { margin-top: 22px; font-size: 15px; color: var(--text-3); }
.more-links a { color: var(--text-2); }
.more-links a:hover { color: var(--accent); }
@media (min-width: 1000px) { .article-faq, .article-cta, .article-more { max-width: 760px; } }

/* ---- Cards ----------------------------------------------------------------- */
.post-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
.post-card {
  display: grid; grid-template-rows: auto auto 1fr auto; gap: 10px; align-content: start; text-decoration: none; color: var(--text);
  transition: border-color 0.25s, background-color 0.25s, transform 0.35s var(--spring);
}
.post-card:hover { color: var(--text); border-color: rgba(var(--accent-rgb), 0.45); background: var(--surface-2); }
.post-card:active { transform: scale(0.985); }
.post-card[hidden] { display: none; }
.post-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.post-card .card-icon { margin-bottom: 0; }
.post-card h3 { font-size: clamp(19px, 2vw, 21.5px); line-height: 1.2; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
.post-card p { font-size: 15px; line-height: 1.5; color: var(--text-2); }
.post-foot {
  display: flex; align-items: center; gap: 10px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line);
  font: 600 11px/1.3 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3);
}
.post-foot span { white-space: nowrap; }
.post-foot span + span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.post-foot span + span::before { content: "·"; margin-right: 10px; opacity: 0.6; }
.post-foot .go { margin-left: auto; width: 16px; height: 16px; color: var(--accent); transition: transform 0.25s var(--ease); }
.post-card:hover .go { transform: translateX(3px); }

/* ---- Hubs (/guides/, /blog/) ---------------------------------------------- */
.hub-hero { padding-bottom: clamp(22px, 4vw, 40px); }
.hub-hero h1 { font-size: clamp(42px, 8vw, 84px); margin: 0 0 18px; }
.hub-search {
  display: flex; align-items: center; gap: 12px; margin-top: 26px; padding: 0 18px; height: 56px; max-width: 560px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.hub-search:focus-within { border-color: rgba(var(--accent-rgb), 0.6); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.14); }
.hub-search .icon { width: 19px; height: 19px; color: var(--text-3); }
.hub-search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text);
  font: inherit; font-size: 16.5px; -webkit-appearance: none; appearance: none;
}
.hub-search input::placeholder { color: var(--text-3); }
.hub-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
html:not(.js) .hub-search, html:not(.js) .filter-bar { display: none; }

.hub-body { padding-bottom: clamp(64px, 10vw, 120px); }
.filter-bar {
  display: flex; gap: 8px; padding: 4px var(--gutter) 14px; margin: 0 calc(var(--gutter) * -1) 6px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.filter-bar::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .filter-bar { flex-wrap: wrap; overflow: visible; } }
.filter {
  flex: none; min-height: 38px; padding: 0 14px; cursor: pointer; font-size: 11.5px; -webkit-tap-highlight-color: transparent;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.filter b { font-weight: 600; opacity: 0.6; margin-left: 2px; }
.filter:hover { color: var(--text); border-color: var(--line-2); }
.filter.is-on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); box-shadow: 0 8px 22px -10px var(--glow); }
.filter.is-on b { opacity: 0.75; }

.hub-group { margin-top: clamp(30px, 5vw, 46px); }
.hub-group[hidden] { display: none; }
.hub-title {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  font: 600 12px/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-2);
}
.hub-title .icon { width: 16px; height: 16px; color: var(--accent); }
.hub-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.hub-empty { margin-top: 34px; font-size: 17px; color: var(--text-2); }
.hub-empty a { color: var(--accent); }

.hub-also { margin-top: clamp(64px, 9vw, 104px); padding-top: clamp(40px, 6vw, 56px); border-top: 1px solid var(--line); }
.hub-links { display: grid; gap: 12px; margin-top: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .hub-links { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hub-link { display: grid; gap: 4px; align-content: start; text-decoration: none; color: var(--text); transition: border-color 0.25s, background-color 0.25s; }
.hub-link:hover { color: var(--text); border-color: rgba(var(--accent-rgb), 0.45); background: var(--surface-2); }
.hub-link .card-icon { margin-bottom: 10px; }
.hub-link b { font: 650 17px/1.2 var(--font-display); letter-spacing: -0.015em; }
.hub-link small { font-size: 14px; color: var(--text-2); }

/* ---- The home page's "learn" block ---------------------------------------- */
.learn .post-grid { margin-top: 4px; }
.learn-more { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ---- Print: just the text -------------------------------------------------- */
@media print {
  .article-art, .article-cta, .article-more, .crumbs, .hub-search, .filter-bar { display: none !important; }
  .article-prose h2 { border: 0; padding-top: 0; }
  .article-prose ol.steps > li, .article-prose .note { background: none; border-color: #999; break-inside: avoid; }
}
