/*
Theme Name: Data Wrangler
Description: An editorial theme for practical data engineering guides.
Version: 1.0.1
Requires at least: 6.8
License: GPL-2.0-or-later
Text Domain: data-wrangler
*/
:root {
    color-scheme: dark;
    --body: #0b111a;
    --panel: #0e1723;
    --border: #2b3b4b;
    --ink: #f2f6fa;
    --muted: #adbccc;
    --mint: #80f1cb;
    --violet: #c0b8fb;
    --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
    --sans: Inter, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box }
html { scroll-behavior: smooth }
body { margin: 0; background: var(--body); color: var(--ink); font: 1rem/1.6 var(--sans) }
a { color: inherit }
button { font: inherit }
img { display: block; max-width: 100%; height: auto }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px }
.skip { position: absolute; z-index: 10; top: .5rem; left: .75rem; transform: translateY(-150%); padding: .65rem 1rem; background: var(--mint); color: #10211c }
.skip:focus { transform: none }

.shell { width: min(1260px, calc(100% - 112px)); margin-inline: auto }
.top { border-bottom: 1px solid #263341; background: #0c131c }
.top-inner, .footer-inner { display: flex; align-items: center; gap: 1.75rem; min-height: 74px }
.brand { display: inline-flex; align-items: center; gap: .78rem; text-decoration: none; white-space: nowrap; font-weight: 450; letter-spacing: -.035em; font-size: 1.13rem }
.brand strong { font-weight: 750 }
.brand-mark { width: 32px; height: 32px; display: grid; place-content: center; gap: 3px; border-radius: 8px; background: #a1f4da; color: #123429; transform: rotate(-6deg) }
.brand-mark i { display: block; height: 3px; width: 15px; border-radius: 3px; background: currentColor; transform: skewX(-20deg) }
.brand-mark i:nth-child(2) { width: 11px; margin-left: 3px }
.top nav { margin-left: auto; display: flex; gap: clamp(1rem, 4vw, 2.6rem); align-items: center }
.top nav a, .footer a:not(.brand) { color: var(--muted); text-decoration: none; font-weight: 550 }
.top nav a:hover, .footer a:hover { color: var(--mint) }

.hero { display: grid; grid-template-columns: .85fr 1.24fr; align-items: center; column-gap: clamp(1.5rem, 3.7vw, 3.6rem); padding-block: clamp(3.6rem, 5.6vw, 6rem) clamp(3.7rem, 5.8vw, 6.2rem) }
.hero-copy { max-width: 500px }
.kicker { display: flex; align-items: center; gap: .6rem; margin: 0 0 1.2rem; color: var(--mint); font: 650 .79rem/1.45 var(--mono); letter-spacing: .11em; text-transform: uppercase }
.kicker span { height: 7px; width: 7px; background: var(--mint); border-radius: 2px; box-shadow: 0 0 13px #89ffad77 }
.hero h1 { margin: 0; font-size: clamp(3.1rem, 5.1vw, 5.1rem); line-height: .99; font-weight: 770; letter-spacing: -.086em }
.hero i { font-style: normal }
.hero h1 em { font-style: normal; color: var(--mint) }
.hero-text { max-width: 34ch; margin: 1.65rem 0 1.85rem; color: var(--muted); font-size: clamp(1.075rem, 1.4vw, 1.25rem); line-height: 1.57 }
.primary { display: inline-flex; align-items: center; min-height: 48px; padding: .65rem 1.1rem; border-radius: 8px; background: var(--mint); color: #0d211a; text-decoration: none; font-weight: 750 }
.primary:hover { background: #aaffdf }

.flow { min-width: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 17px; box-shadow: 0 22px 100px #0005, 0 0 90px #47699613; overflow: clip; position: relative }
.flow-top { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: .6rem 1.15rem; border-bottom: 1px solid var(--border) }
.flow-top strong { letter-spacing: -.02em; font-size: .94rem }
.flow-top > span { color: var(--muted); font-family: var(--mono); font-size: .79rem }
.flow-stage { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 4vw, 4rem); padding: 1.25rem clamp(.7rem, 1.7vw, 1.35rem) 1.4rem; background: radial-gradient(circle at 53% 58%, #2c345b68, transparent 60%), radial-gradient(#324358 1px, transparent 1px) 0 0/15px 15px, #101b29 }
.flow-stage canvas { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; pointer-events: none }
.flow-column { position: relative; display: grid; z-index: 1; gap: .85rem; min-width: 0 }
.flow-label { color: #c0ccda; font: 600 .79rem/1.3 var(--mono); margin-bottom: .15rem }
.flow-node { background: #101a27; color: #dbe6f1; border: 1px solid #475a70; border-radius: 9px; display: flex; align-items: center; justify-content: flex-start; min-width: 0; min-height: 49px; gap: .47rem; padding: .47rem .55rem; font-weight: 650; font-size: .9rem; text-align: left; cursor: pointer; transition: background .16s ease, border-color .16s ease, box-shadow .16s ease }
.flow-node:hover, .flow-node.is-linked { border-color: #629e9a; color: #f9fffc }
.flow-node[aria-pressed=true] { border-color: var(--mint); background: #19372f; color: #e0fff3; box-shadow: 0 0 20px #80f1cb22 }
.node-icon { align-self: center; flex: 0 0 auto; width: 23px; height: 23px; display: grid; place-items: center; background: #26384d; border-radius: 5px; color: var(--mint); font: 650 1rem/1 var(--mono) }
.flow-column:last-child .node-icon { background: #322d50; color: var(--violet) }
.flow-guide { display: flex; gap: 1rem; align-items: center; justify-content: space-between; min-height: 94px; padding: .95rem 1.15rem; border-top: 1px solid var(--border) }
.flow-guide strong { font-size: .96rem }
.flow-guide p { margin: .21rem 0 0; max-width: 45ch; color: var(--muted); font-size: .875rem; line-height: 1.38 }
.flow-guide a { font-size: .875rem; font-weight: 700; color: var(--mint); text-decoration-thickness: .07em; text-underline-offset: .25em; flex-shrink: 0 }

.guides { border-top: 1px solid #2a3746; padding: 2.8rem 0 4.65rem; scroll-margin-top: 1rem }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.7rem }
.section-heading h2 { margin: 0; line-height: 1.05; font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.065em }
.section-heading .kicker { margin-bottom: .65rem }
.section-heading > p { margin: 0; max-width: 31ch; color: var(--muted) }
.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem }
.story { min-width: 0 }
.story-link { display: flex; flex-direction: column; height: 100%; border-radius: 13px; border: 1px solid var(--border); background: #111b27; overflow: clip; text-decoration: none; transition: border-color .2s, background .2s }
.story-link:hover { border-color: #719d9f; background: #162331 }
.story-art { aspect-ratio: 2.16; overflow: clip; border-bottom: 1px solid #2b3b4b }
.story-art img { width: 100%; height: 100%; object-fit: cover }
.story-body { padding: 1.2rem 1.3rem 1.45rem }
.story-body h3 { font-size: 1.36rem; letter-spacing: -.038em; line-height: 1.17; margin: .45rem 0 .6rem }
.story-body p { margin: 0; color: var(--muted); line-height: 1.43 }
.story-body .story-topic { font: 650 .81rem/1.25 var(--mono); color: var(--violet) }
.story-body .story-topic.node-js { color: var(--mint) }

.footer { border-top: 1px solid #293b48; background: #0d151e }
.footer-inner { min-height: 105px }
.footer-inner .brand { margin-right: auto }
.footer-inner a:not(.brand) { font-size: .9rem }

.reading { max-width: 850px; padding-block: clamp(2.2rem, 6vw, 5rem) 5rem }
.article-head { margin-bottom: 1.9rem }
.article-head h1, .reading > h1 { font-size: clamp(2.65rem, 5.8vw, 4.65rem); letter-spacing: -.075em; line-height: 1; margin: .5rem 0 0 }
.article-head .intro { color: var(--muted); font-size: clamp(1.11rem, 2.4vw, 1.32rem); max-width: 53ch; margin: 1.05rem 0 0 }
.back { color: var(--mint); text-underline-offset: .22em; font-size: .92rem; font-weight: 650 }
.cover { margin: 0 0 2rem }
.cover img { width: 100%; border-radius: 12px; border: 1px solid var(--border) }
.entry { max-width: 720px; color: #e0e8f0; font-size: 1.06rem; line-height: 1.73 }
.entry h2, .entry h3 { color: var(--ink); line-height: 1.18; letter-spacing: -.04em; margin: 2rem 0 .65rem; overflow-wrap: anywhere }
.entry h2 { font-size: clamp(1.55rem, 4vw, 2.15rem) }
.entry p, .entry ul, .entry ol { margin: .8rem 0 1.25rem }
.entry a, .reading > p a { color: var(--mint); text-underline-offset: .25em; overflow-wrap: anywhere }
.entry pre { overflow-x: auto; padding: 1rem; border: 1px solid var(--border); border-radius: 8px; background: #141e2a }
.entry code { color: #c1f8e4; font: .9em var(--mono); overflow-wrap: anywhere }
.entry table { border-collapse: collapse; font-size: .93rem }
.entry td, .entry th { padding: .5rem .75rem; border: 1px solid var(--border); text-align: left }
.entry figure.wp-block-table { margin-inline: 0; overflow: auto }

@media (max-width: 1090px) {
    .shell { width: min(100% - 64px, 980px) }
    .hero { grid-template-columns: minmax(0, .81fr) minmax(0, 1.25fr); gap: 1.5rem }
    .flow-stage { gap: 1.15rem }
    .flow-node { font-size: .85rem }
}
@media (max-width: 800px) {
    .hero { grid-template-columns: minmax(0, 1fr); gap: 2.6rem; padding-block: 3.1rem 3.65rem }
    .hero h1 { font-size: clamp(3.8rem, 9.9vw, 6rem) }
    .flow-stage { gap: clamp(1.15rem, 5vw, 3rem) }
    .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}
@media (max-width: 540px) {
    .shell { width: calc(100% - 36px) }
    .top-inner { min-height: 65px; gap: .65rem }
    .top nav { gap: .95rem }
    .top nav a { font-size: .9rem }
    .brand { font-size: 1.02rem; gap: .56rem }
    .brand-mark { width: 27px; height: 27px; border-radius: 6px }
    .hero h1 { font-size: clamp(3.1rem, 12.2vw, 4.6rem) }
    .flow-top, .flow-guide { padding-inline: .85rem }
    .flow-stage { padding-inline: .65rem; gap: .66rem }
    .flow-node { gap: .2rem; font-size: clamp(.71rem, 2.9vw, .875rem); justify-content: center; flex-direction: column; min-height: 58px; padding: .35rem .15rem; overflow-wrap: anywhere }
    .node-icon { width: 20px; height: 20px; font-size: .87rem }
    .flow-column { gap: .55rem }
    .flow-guide { align-items: center; gap: .65rem }
    .flow-guide a { max-width: 9ch; flex-shrink: 0 }
    .section-heading { display: block }
    .section-heading > p { margin-top: .85rem }
    .article-grid { grid-template-columns: 1fr }
    .footer-inner { gap: .8rem; flex-wrap: wrap; padding-block: 1.3rem }
    .footer-inner .brand { flex-basis: 100% }
}
@media (max-width: 360px) {
    .top-inner { flex-wrap: wrap; padding-block: .65rem; gap: .45rem }
    .top nav { flex-basis: 100%; margin-left: 0 }
    .hero h1 { font-size: 2.75rem }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto }
    *, *::before, *::after { transition: none !important }
}
