/* ============================================================
   B-DATASET · Light / Minimal / Tech design system
   UI + body: Inter · Mono, labels & data: JetBrains Mono
   Neutral paper, hairline rules, one signal blue.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ---------- Tokens ---------- */
:root {
    --bg:        #FFFFFF;
    --bg-2:      #FAFAFA;
    --bg-3:      #F4F5F7;
    --surface:   #FFFFFF;

    --text:      #0B0D12;
    --text-2:    #3A414D;
    --muted:     #6B7280;
    --muted-2:   #9AA1AC;

    --accent:      #0F62FE;
    --accent-2:    #0043CE;
    --accent-soft: #E7EFFF;
    --accent-line: #B9D0FF;
    --ok:          #0E9F6E;
    --warn:        #B45309;
    --err:         #D92D20;

    --line:      #E7E9EE;
    --line-2:    #D6DAE1;

    --maxw: 1120px;
    --radius: 6px;
    --radius-lg: 10px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);

    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --shadow: 0 1px 2px rgba(11, 13, 18, 0.04), 0 8px 24px rgba(11, 13, 18, 0.04);

    --grid-gap: clamp(28px, 5vw, 56px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Very light technical dot grid, fades out down the page */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(var(--line-2) 1px, transparent 1px);
    background-size: 28px 28px;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent 55%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent 55%);
    opacity: 0.75;
}

::selection { background: var(--accent); color: #fff; }

img { display: block; max-width: 100%; }
a { color: inherit; }

.mono { font-family: var(--mono); }
.serif { font-family: var(--sans); }

/* ============================================================
   LAYOUT
   ============================================================ */
.wrap {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: clamp(20px, 5vw, 40px);
}
.page { padding-top: clamp(56px, 9vw, 96px); padding-bottom: clamp(72px, 10vw, 120px); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.site-header__inner {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding: 14px clamp(20px, 5vw, 40px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    text-decoration: none;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 1px;
}
.brand b { color: var(--accent); font-weight: 700; }
.brand .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    margin-left: 7px;
    animation: blink 2.4s var(--ease) infinite;
}
@keyframes blink { 0%, 70%, 100% { opacity: 1; } 85% { opacity: 0.25; } }

.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.01em;
    color: var(--muted);
    text-decoration: none;
    padding: 7px 11px;
    border-radius: var(--radius);
    transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.nav a:hover { color: var(--text); background: var(--bg-3); }
.nav a.active { color: var(--accent); background: var(--accent-soft); }

/* ============================================================
   TYPE PRIMITIVES
   ============================================================ */
.kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid var(--line);
    background: var(--bg-2);
    padding: 5px 11px;
    border-radius: 100px;
}
.kicker::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.hero__title {
    font-size: clamp(2.6rem, 7.5vw, 5rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.04em;
    margin-top: 22px;
}
.hero__title em { font-style: normal; color: var(--accent); }
.hero__title .rule {
    display: inline-block;
    width: clamp(48px, 9vw, 120px);
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    vertical-align: middle;
    margin: 0 0.12em 0.22em;
}

.section__title {
    font-size: clamp(1.7rem, 3.6vw, 2.5rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.03em;
}
.section__title em { font-style: normal; color: var(--accent); }

.section__index {
    display: block;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted-2);
    margin-bottom: 12px;
}

.lead {
    font-size: clamp(1.02rem, 1.7vw, 1.18rem);
    color: var(--text-2);
    max-width: 62ch;
}

.tlink {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-line);
    transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.tlink:hover { color: var(--accent-2); border-color: var(--accent-2); }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-bottom: clamp(48px, 7vw, 80px); }
.hero__grid {
    margin-top: clamp(34px, 5vw, 52px);
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: var(--grid-gap);
    align-items: start;
}
.hero__lede { color: var(--text-2); font-size: 1.03rem; max-width: 56ch; }
.hero__lede strong { color: var(--text); font-weight: 600; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.hero__panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 6px 20px;
}
.specs { list-style: none; }
.specs li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 0.8rem;
}
.specs li:last-child { border-bottom: 0; }
.specs .k { color: var(--muted-2); letter-spacing: 0.08em; font-size: 0.7rem; }
.specs .v { color: var(--text); text-align: right; }
.specs .v.on { color: var(--ok); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    --btn-bg: var(--accent);
    --btn-fg: #fff;
    --btn-bd: var(--accent);
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1;
    padding: 13px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--btn-bd);
    background: var(--btn-bg);
    color: var(--btn-fg);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease),
                color 0.18s var(--ease), transform 0.18s var(--ease);
}
.btn:hover { --btn-bg: var(--accent-2); --btn-bd: var(--accent-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--text); --btn-bd: var(--line-2); }
.btn--ghost:hover { --btn-bg: var(--bg-3); --btn-fg: var(--text); --btn-bd: var(--line-2); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* ============================================================
   SECTIONS · SOURCES · NOTE
   ============================================================ */
.section {
    padding-top: clamp(44px, 6vw, 72px);
    border-top: 1px solid var(--line);
    margin-top: clamp(44px, 6vw, 72px);
}
.section:first-of-type { border-top: 0; margin-top: 0; }

.sources {
    margin-top: 26px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}
.source-chip {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.source-chip:hover { border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-2px); }
.source-chip img { width: 34px; height: 34px; object-fit: contain; }
.source-chip .meta { display: grid; gap: 2px; }
.source-chip .meta b { font-size: 0.95rem; font-weight: 600; }
.source-chip .meta span { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }

.note {
    margin-top: 20px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    background: var(--bg-2);
    color: var(--text-2);
    font-size: 0.95rem;
    max-width: 78ch;
}
.note strong { color: var(--text); font-weight: 600; }

/* ============================================================
   PROSE (docs · about · extras)
   ============================================================ */
.prose { margin-top: clamp(38px, 6vw, 60px); display: grid; gap: 0; }
.prose article {
    display: grid;
    grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
    gap: var(--grid-gap);
    padding: clamp(28px, 4vw, 40px) 0;
    border-top: 1px solid var(--line);
}
.prose article:last-child { border-bottom: 1px solid var(--line); }
.prose h2 {
    font-size: 1.12rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    align-self: start;
    position: sticky;
    top: 84px;
}
.prose h2 .num {
    display: block;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 6px;
}
.prose p { color: var(--text-2); }
.prose p + p, .prose p + ul, .prose p + ol { margin-top: 1em; }
.prose ol, .prose ul { padding-left: 1.15em; color: var(--text-2); }
.prose li { margin-bottom: 0.5em; }
.prose li::marker { color: var(--muted-2); font-family: var(--mono); font-size: 0.85em; }
.prose code {
    font-family: var(--mono);
    font-size: 0.84em;
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 1px 5px;
    color: var(--text);
}

/* ============================================================
   CONSOLE (app form)
   ============================================================ */
.console {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.console__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--bg-2);
    font-family: var(--mono);
    font-size: 0.74rem;
    letter-spacing: 0.04em;
}
.console__head .label { color: var(--muted); }
.console__head .status {
    display: inline-flex; align-items: center; gap: 7px;
    color: var(--ok);
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
}
.console__head .status::before {
    content: '';
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 3px rgba(14, 159, 110, 0.14);
}
.console__body { padding: clamp(22px, 3.4vw, 30px); display: grid; gap: 22px; }

.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.field { display: grid; gap: 8px; min-width: 0; }
.field label {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.field input {
    width: 100%;
    font-family: var(--sans);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--bg-2);
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    padding: 12px 14px;
    transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background-color 0.18s var(--ease);
}
.field input::placeholder { color: var(--muted-2); }
.field input:hover { border-color: var(--muted-2); }
.field input:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input[type="password"] { font-family: var(--mono); letter-spacing: 0.06em; }

.fieldset { border: 0; display: grid; gap: 8px; }
.fieldset legend {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0;
    margin-bottom: 8px;
}

/* Segmented control */
.segmented {
    display: inline-flex;
    padding: 3px;
    gap: 3px;
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--muted);
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.segmented label:hover { color: var(--text); }
.segmented input:checked + label {
    background: var(--surface);
    color: var(--accent);
    box-shadow: 0 1px 2px rgba(11, 13, 18, 0.08);
}
.segmented input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Source toggle (Unsplash / Pexels) */
.source-toggle { display: grid; gap: 8px; }
.source-toggle .cap {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.checkTypeContact { position: absolute; opacity: 0; pointer-events: none; }
.checkTypeContact + label {
    width: 168px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius);
    background: var(--bg-3);
    border: 1px solid var(--line-2);
    position: relative;
    cursor: pointer;
    overflow: hidden;
    padding: 3px;
}
.checkTypeContact + label .img {
    width: 81px; height: 42px; z-index: 2;
    display: flex; align-items: center; justify-content: center;
    background-position: center; background-repeat: no-repeat; background-size: 58%;
    transition: background-image 0.3s var(--ease);
}
/* default = Unsplash active (highlight tile on the left) */
.checkTypeContact + label .img:first-of-type { background-image: url(../Icons/unsplashIconWhite.svg); }
.checkTypeContact + label .img:last-of-type  { background-image: url(../Icons/pexelsIconDark.png); }
.checkTypeContact:checked + label .img:first-of-type { background-image: url(../Icons/unsplashIconDark.svg); }
.checkTypeContact:checked + label .img:last-of-type  { background-image: url(../Icons/pexelsIconWhite.png); }
.checkTypeContact + label .bg {
    position: absolute; top: 3px; left: 3px;
    width: 81px; height: 42px; z-index: 1;
    background: var(--accent);
    border-radius: 4px;
    transition: left 0.4s var(--ease);
}
.checkTypeContact:checked + label .bg { left: 84px; }
.checkTypeContact:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

.console__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ============================================================
   PROGRESS
   ============================================================ */
.progress-wrap {
    margin-top: 26px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg-2);
}
.progress-wrap p {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    color: var(--text-2);
    margin-bottom: 10px;
    display: flex; align-items: center; gap: 9px;
}
.progress-wrap p::before {
    content: '';
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent);
    animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.35; transform: scale(0.75); }
}

.progress {
    height: 8px;
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 100px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 100px;
    font-size: 0;              /* the bar speaks; the % label stays for a11y */
    color: transparent;
    transition: width 0.25s var(--ease);
}

/* ============================================================
   RESULTS GRID
   ============================================================ */
.sheet { margin-top: clamp(30px, 4vw, 44px); }
.sheet__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius) var(--radius) 0 0;
    background: var(--bg-2);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
#imagesContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
#imagesContainer:not(:empty) {
    padding: 10px;
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--surface);
}
#imagesContainer img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 4px;
    background: var(--bg-3);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
#imagesContainer img:hover { transform: scale(1.02); box-shadow: var(--shadow); }

.download-bar { margin-top: 22px; display: flex; justify-content: center; }

/* ============================================================
   ALERT
   ============================================================ */
.alert {
    margin-top: 22px;
    padding: 14px 18px;
    border: 1px solid #F5C2C0;
    border-left: 3px solid var(--err);
    border-radius: var(--radius);
    background: #FEF3F2;
    color: #912018;
    font-family: var(--mono);
    font-size: 0.82rem;
}

/* ============================================================
   CODE BLOCK · TREE
   ============================================================ */
.codeblock {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.codeblock__bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 14px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
}
.codeblock__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.codeblock__dot.amber { background: var(--accent); }
.codeblock__name {
    margin-left: 8px;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--muted);
}
.codeblock code {
    display: block;
    padding: 20px;
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.75;
    color: var(--text-2);
    white-space: pre;
    overflow-x: auto;
    background: none;
    border: 0;
}

.tree {
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.8;
    color: var(--text-2);
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    white-space: pre;
    overflow-x: auto;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); }
.site-footer__inner {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding: 24px clamp(20px, 5vw, 40px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--muted);
}

/* ============================================================
   REVEAL
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(12px);
    animation: reveal 0.6s var(--ease) forwards;
    animation-delay: calc(var(--d, 0) * 70ms);
}
@keyframes reveal { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .hero__grid { grid-template-columns: 1fr; }
    .prose article { grid-template-columns: 1fr; gap: 14px; }
    .prose h2 { position: static; }
}
@media (max-width: 640px) {
    .site-header__inner { flex-direction: column; align-items: flex-start; gap: 10px; }
    .nav { margin-left: -11px; }
    .field-row { grid-template-columns: 1fr; }
    .console__actions { grid-template-columns: 1fr; }
    .segmented { width: 100%; }
    .segmented label { flex: 1; text-align: center; padding: 8px 10px; }
    .checkTypeContact + label { width: 100%; }
    .checkTypeContact + label .img { width: 50%; }
    .checkTypeContact + label .bg { width: calc(50% - 3px); }
    .checkTypeContact:checked + label .bg { left: 50%; }
    .site-footer__inner { flex-direction: column; align-items: flex-start; }
}
