/* ==========================================================================
   Happy Traffic — happy-traffic.com
   Tech-editorial magazine theme. Light, warm, precise. No images: gradients
   and CSS-drawn charts only (see _photo-manifest.json).
   ========================================================================== */

:root {
  --paper: #fbfaf7;
  --paper-raised: #ffffff;
  --paper-sunk: #f4f2ec;
  --ink: #1a1c22;
  --ink-soft: #3d414b;
  --muted: #6a6f7a;
  --hairline: #e7e4da;
  --hairline-soft: #eeecE4;

  --brand: #4f46e5;
  --brand-deep: #3730a3;
  --cyan: #0891b2;
  --amber: #b4530a;
  --link: #2e46d8;
  --link-hover: #1d2f9e;

  --grad: linear-gradient(120deg, #7c3aed 0%, #4f46e5 38%, #0891b2 100%);
  --grad-soft: linear-gradient(120deg, rgba(124, 58, 237, .12), rgba(8, 145, 178, .12));

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 68rem;
  --measure: 42rem;
  --radius: 14px;
  --shadow-card: 0 1px 2px rgba(26, 28, 34, .05), 0 8px 24px -12px rgba(26, 28, 34, .18);
  --shadow-lift: 0 2px 4px rgba(26, 28, 34, .06), 0 18px 40px -16px rgba(26, 28, 34, .28);
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink-soft);
  background: var(--paper);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2.5rem); }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }

:focus-visible { outline: 3px solid rgba(79, 70, 229, .45); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

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

.masthead {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 250, 247, .88);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.masthead-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: .8rem;
}

.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name {
  font-family: var(--sans); font-weight: 700; font-size: 1.02rem;
  letter-spacing: .14em; text-transform: uppercase;
}
.brand-name b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav { display: flex; align-items: center; gap: 1.35rem; flex-wrap: wrap; }
.nav a {
  font-size: .8rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none; padding: .25rem 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }
.nav-cta {
  border: 1px solid transparent; border-radius: 999px; padding: .42rem .95rem !important;
  background: var(--grad); color: #fff !important;
}
.nav-cta:hover { filter: brightness(1.08); color: #fff; }

/* --------------------------------------------------------------------------
   Hero (CSS gradient only — no photography)
   -------------------------------------------------------------------------- */

.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--hairline); }
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(52rem 30rem at 10% -10%, rgba(124, 58, 237, .16), transparent 62%),
    radial-gradient(42rem 26rem at 92% 0%, rgba(8, 145, 178, .15), transparent 62%),
    radial-gradient(36rem 22rem at 55% 115%, rgba(245, 158, 11, .12), transparent 60%),
    linear-gradient(180deg, #f8f6ff 0%, #fbfaf7 82%);
}
.hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(26, 28, 34, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 28, 34, .05) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(70% 80% at 50% 0%, #000 25%, transparent 78%);
  mask-image: radial-gradient(70% 80% at 50% 0%, #000 25%, transparent 78%);
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; padding-block: clamp(3.2rem, 8vw, 6rem) clamp(3rem, 7vw, 5.2rem); }

.hero h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.35rem, 5.2vw, 3.9rem);
  line-height: 1.08; letter-spacing: -.015em;
  color: var(--ink); margin: .9rem 0 1.1rem;
  text-wrap: balance;
}
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); line-height: 1.65; max-width: 34rem; margin: 0 0 1.8rem; color: var(--ink-soft); }

.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 650; font-size: .95rem; text-decoration: none;
  border-radius: 999px; padding: .72rem 1.5rem;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 26px -12px rgba(79, 70, 229, .65); }
.btn-primary:hover { color: #fff; transform: translateY(-1px); filter: brightness(1.06); }
.btn-ghost { border: 1px solid var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

.hero-facts { display: flex; gap: 1.8rem; margin-top: 2.2rem; flex-wrap: wrap; }
.fact { border-left: 2px solid var(--hairline); padding-left: .8rem; }
.fact dt { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 .15rem; }
.fact dd { margin: 0; font-family: var(--serif); font-size: 1.25rem; color: var(--ink); }

/* CSS-drawn chart (no image) */
.chart {
  margin: 0; padding: 1.4rem 1.4rem 1.1rem;
  background: var(--paper-raised); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.chart-title { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 1rem; }
.chart-bars { display: flex; align-items: flex-end; gap: clamp(.3rem, 1vw, .55rem); height: 11rem; }
.chart-bars i {
  flex: 1; display: block; height: var(--h); border-radius: 6px 6px 3px 3px;
  background: var(--grad); opacity: .88;
  transform-origin: bottom; animation: rise .8s cubic-bezier(.2, .7, .2, 1) backwards;
}
.chart-bars i:nth-child(odd) { opacity: .68; }
.chart-bars i:nth-child(1) { animation-delay: .05s } .chart-bars i:nth-child(2) { animation-delay: .1s }
.chart-bars i:nth-child(3) { animation-delay: .15s } .chart-bars i:nth-child(4) { animation-delay: .2s }
.chart-bars i:nth-child(5) { animation-delay: .25s } .chart-bars i:nth-child(6) { animation-delay: .3s }
.chart-bars i:nth-child(7) { animation-delay: .35s } .chart-bars i:nth-child(8) { animation-delay: .4s }
.chart-bars i:nth-child(9) { animation-delay: .45s } .chart-bars i:nth-child(10) { animation-delay: .5s }
.chart-bars i:nth-child(11) { animation-delay: .55s } .chart-bars i:nth-child(12) { animation-delay: .6s }
@keyframes rise { from { transform: scaleY(0); } }
.chart figcaption { font-size: .8rem; color: var(--muted); margin-top: .9rem; line-height: 1.5; }
.chart figcaption b { color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   Sections, cards
   -------------------------------------------------------------------------- */

.section { padding-block: clamp(2.6rem, 6vw, 4.4rem); }
.section + .section { border-top: 1px solid var(--hairline-soft); }
.section-alt { background: var(--paper-sunk); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.section-title { font-family: var(--serif); font-weight: 600; font-size: clamp(1.45rem, 2.6vw, 1.9rem); color: var(--ink); margin: 0; letter-spacing: -.01em; }
.section-more { font-size: .85rem; font-weight: 600; }

.kicker {
  font-size: .74rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--amber); margin: 0 0 .5rem;
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1.1rem; }

.card {
  display: flex; flex-direction: column; gap: .55rem;
  background: var(--paper-raised); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 1.35rem 1.35rem 1.2rem;
  text-decoration: none; color: var(--ink-soft); position: relative; overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad); opacity: 0; transition: opacity .16s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: #dcd8cb; color: var(--ink-soft); }
.card:hover::before { opacity: 1; }
.card .kicker { margin: 0; }
.card h3 { font-family: var(--serif); font-weight: 600; font-size: 1.22rem; line-height: 1.3; color: var(--ink); margin: 0; }
.card p { margin: 0; font-size: .93rem; line-height: 1.6; }
.card-meta { margin-top: auto; padding-top: .5rem; font-size: .78rem; color: var(--muted); letter-spacing: .04em; }

.list-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.list-plain li { border-left: 3px solid transparent; padding-left: .9rem; }
.list-plain a { font-weight: 650; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--hairline); }
.list-plain a:hover { color: var(--link); border-bottom-color: var(--link); }

/* --------------------------------------------------------------------------
   Page (article) layout
   -------------------------------------------------------------------------- */

.page-head { padding-block: clamp(2.4rem, 5vw, 4rem) 1.6rem; border-bottom: 1px solid var(--hairline); }
.page-head h1 {
  font-family: var(--serif); font-weight: 600; color: var(--ink);
  font-size: clamp(1.95rem, 4vw, 2.9rem); line-height: 1.12; letter-spacing: -.015em;
  margin: .35rem 0 .9rem; max-width: 24ch; text-wrap: balance;
}
.lede { font-size: clamp(1.08rem, 1.6vw, 1.25rem); line-height: 1.6; color: var(--muted); max-width: 38rem; margin: 0 0 1rem; }
.meta { font-size: .82rem; color: var(--muted); margin: 0; letter-spacing: .03em; }
.meta a { color: inherit; }

.crumbs { font-size: .82rem; color: var(--muted); padding-top: 1.1rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: .45rem; color: var(--hairline); -webkit-text-stroke: 1px var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--link); text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--ink-soft); font-style: normal; }

.article { padding-block: clamp(1.8rem, 4vw, 3rem); }
.article-body { max-width: var(--measure); }
.article-body > * + * { margin-top: 1.15rem; }

.article-body h2 {
  font-family: var(--serif); font-weight: 600; color: var(--ink);
  font-size: clamp(1.4rem, 2.4vw, 1.75rem); line-height: 1.25; letter-spacing: -.01em;
  margin: 2.6rem 0 .2rem; padding-top: 1.4rem; position: relative;
}
.article-body h2::before {
  content: ""; position: absolute; top: 0; left: 0; width: 3rem; height: 3px;
  border-radius: 3px; background: var(--grad);
}
.article-body h3 { font-family: var(--sans); font-weight: 700; color: var(--ink); font-size: 1.12rem; margin: 2rem 0 .2rem; }

.article-body p { margin: 0; }
.article-body ul, .article-body ol { padding-left: 1.4rem; margin: 0; }
.article-body li + li { margin-top: .45rem; }
.article-body strong { color: var(--ink); font-weight: 650; }

.article-body blockquote {
  margin: 1.8rem 0; padding: .2rem 0 .2rem 1.5rem;
  border-left: 3px solid; border-image: var(--grad) 1;
  font-family: var(--serif); font-size: 1.18rem; line-height: 1.55; color: var(--ink);
}

.note {
  background: linear-gradient(90deg, rgba(124, 58, 237, .07), rgba(8, 145, 178, .06));
  border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 1rem 1.25rem; font-size: .95rem;
}
.note b { color: var(--ink); }

.table-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--paper-raised); }
table.data { border-collapse: collapse; width: 100%; font-size: .92rem; min-width: 34rem; }
table.data caption { text-align: left; font-size: .78rem; color: var(--muted); padding: .8rem 1rem .2rem; letter-spacing: .04em; }
table.data th, table.data td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--hairline-soft); vertical-align: top; }
table.data thead th { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--paper-sunk); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td:first-child { font-weight: 650; color: var(--ink); white-space: nowrap; }

.article-body code { font-family: var(--mono); font-size: .88em; background: var(--paper-sunk); border: 1px solid var(--hairline-soft); border-radius: 5px; padding: .1em .35em; }

.article-body .chart { margin: 1.9rem 0; }

/* --------------------------------------------------------------------------
   Related / cross-links
   -------------------------------------------------------------------------- */

.related { border-top: 1px solid var(--hairline); padding-block: clamp(2rem, 5vw, 3.2rem); }

.uk-band {
  border-top: 1px solid var(--hairline);
  background:
    radial-gradient(40rem 20rem at 85% 0%, rgba(8, 145, 178, .09), transparent 60%),
    var(--paper);
}

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

.footer { background: #14161b; color: #b9bcc4; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.2rem; padding-block: 3rem 2.2rem; }
.footer .brand { color: #fff; }
.footer-blurb { font-size: .92rem; line-height: 1.65; color: #9a9ea8; max-width: 26rem; margin: .9rem 0 0; }
.footer h2 { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: #7f8490; margin: 0 0 .9rem; font-family: var(--sans); font-weight: 700; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer a { color: #cfd2d9; text-decoration: none; font-size: .9rem; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { border-top: 1px solid #262932; padding-block: 1.2rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: #7f8490; }
.footer-bottom a { color: #9a9ea8; }
.footer-rule { height: 3px; background: var(--grad); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 56rem) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 2.6rem; }
  .hero-facts { margin-top: 1.6rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 40rem) {
  .masthead-inner { flex-direction: column; align-items: flex-start; gap: .6rem; padding-block: .7rem; }
  .nav { gap: .9rem 1.1rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .section-head { flex-direction: column; align-items: flex-start; }
  table.data { min-width: 30rem; }
}

@media print {
  .masthead, .nav, .hero-actions, .related, .footer, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
}
