/* ============================================================================
 * DATUMOLOGY — components.css
 * THE REUSABLE PARTS: buttons, badges, hero, service/work cards, process,
 * stats, the contact form, and the marquee.
 *
 * Why a second file? main.css holds the rarely-changing foundation; this file
 * holds the pieces you tweak constantly. Splitting them keeps each file
 * focused and easy to scan — a small taste of "separation of concerns,"
 * the same idea that later separates routes/models/templates in Flask.
 *   -> WGU: Front-End Web Development (Term 2), Software Engineering (later)
 * ==========================================================================*/


/* ----------------------------------------------------------------------------
 * BUTTONS
 * One base class (.btn) + modifiers (.btn--primary / .btn--ghost). This is the
 * BEM-ish "block + modifier" naming pattern: predictable, no specificity wars.
 *   -> WGU: Front-End Web Development (Term 2)
 * --------------------------------------------------------------------------*/
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.9rem; letter-spacing: 0.02em;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease),
              border-color var(--dur) var(--ease), color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-2px); } /* a small lift = tactile feedback */
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--accent);
  color: #04201c;                 /* dark text on bright accent = AA contrast  */
  font-weight: 600;
}
.btn--primary:hover {
  background: var(--accent-soft);
  box-shadow: 0 8px 30px -8px var(--accent); /* a glow that hints "energy"     */
}

.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }


/* ----------------------------------------------------------------------------
 * BADGES / PILLS
 * --------------------------------------------------------------------------*/
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 8px var(--accent); }


/* ----------------------------------------------------------------------------
 * HERO — the first full-height impression. This is where the "wow" lives.
 * A radial accent glow floats behind oversized display type.
 *   -> WGU: UI Design (Term 3)
 * --------------------------------------------------------------------------*/
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  position: relative;
  padding-top: var(--nav-h);
  overflow: hidden;
}
/* Two soft radial glows positioned with absolute + z-index behind content.
 * pointer-events:none so they never block clicks. */
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.5; pointer-events: none; z-index: 0;
}
.hero::before { width: 540px; height: 540px; background: radial-gradient(circle, var(--accent), transparent 70%);
  top: -120px; right: -80px; }
.hero::after  { width: 460px; height: 460px; background: radial-gradient(circle, var(--accent-2), transparent 70%);
  bottom: -160px; left: -120px; opacity: 0.32; }
.hero .container { position: relative; z-index: 1; }

.hero h1 { margin: var(--space-3) 0; max-width: 16ch; }
.hero h1 .grad {
  /* Gradient text: clip a gradient to the shape of the letters. */
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero__lead { font-size: 1.2rem; max-width: 52ch; margin-bottom: var(--space-4); }
.hero__cta { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* Floating "instrument readout" stat chips under the hero copy. */
.hero__meta { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-6); }
.hero__meta .stat { border-left: 2px solid var(--accent); padding-left: var(--space-2); }
.hero__meta .stat b { font-family: var(--font-display); font-size: 1.6rem; color: var(--text); display: block; }
.hero__meta .stat span { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); }


/* ----------------------------------------------------------------------------
 * SECTION HEADER (eyebrow + title + optional intro)
 * --------------------------------------------------------------------------*/
.section-head { max-width: 60ch; margin-bottom: var(--space-8); }
.section-head h2 { margin: var(--space-2) 0; }


/* ----------------------------------------------------------------------------
 * CARD GRID + CARDS (services & work share a base card)
 * auto-fit + minmax = a responsive grid with NO media queries: as many columns
 * as fit, each at least 300px, sharing leftover space equally.
 *   -> WGU: Front-End Web Development (Term 2)
 * --------------------------------------------------------------------------*/
.grid { display: grid; gap: var(--space-3); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  position: relative;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease),
              background var(--dur) var(--ease);
  overflow: hidden;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); background: var(--surface-alt); }
/* A thin accent line that sweeps across the top of a card on hover. */
.card::before {
  content: ""; position: absolute; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width var(--dur) var(--ease);
}
.card:hover::before { width: 100%; }

.card__icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--surface-hi); color: var(--accent);
  font-size: 1.25rem; margin-bottom: var(--space-3);
}
.card h3 { margin-bottom: var(--space-1); }
.card__num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-faint); }


/* ----------------------------------------------------------------------------
 * WORK / CASE-STUDY CARD (a card with a generated "preview" panel on top)
 * The preview is a pure-CSS gradient + label (no screenshots needed), which
 * keeps the site self-contained for Fastmail Files and lightning fast.
 * --------------------------------------------------------------------------*/
.work-card { padding: 0; }

/* The preview is a miniature "browser window": a chrome bar (dots + address)
 * on top of a rendered "screen." It's pure CSS — no screenshot file — so the
 * page stays self-contained and fast. To show a REAL screenshot later, drop an
 * <img> inside .browser-screen and it fills the frame (see the img rule below). */
.work-card__preview {
  aspect-ratio: 16 / 10;
  display: flex; flex-direction: column;
  position: relative;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

/* The chrome bar: three "traffic light" dots + a faux address pill. */
.browser-bar {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface-hi);
  border-bottom: 1px solid var(--border);
}
.browser-bar .b-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); opacity: 0.55; }
.browser-bar .b-dot:nth-child(1) { background: #ff5f57; }
.browser-bar .b-dot:nth-child(2) { background: #febc2e; }
.browser-bar .b-dot:nth-child(3) { background: #28c840; }
.browser-url {
  flex: 1; margin-left: 0.4rem;
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  padding: 0.22rem 0.6rem; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* The "screen" below the bar: a distinct gradient + the project wordmark, plus
 * a few faux content lines that suggest a real page beneath. */
.browser-screen {
  flex: 1; position: relative;
  display: grid; place-items: center;
  text-align: center; padding: var(--space-3);
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.35rem; letter-spacing: -0.01em; color: var(--text);
  background:
    radial-gradient(120% 120% at 20% 10%, rgba(45,226,200,0.18), transparent 60%),
    radial-gradient(120% 120% at 90% 90%, rgba(139,108,255,0.16), transparent 55%),
    var(--surface-alt);
}
/* Faint "skeleton" lines drawn under the title to hint at page content. */
.browser-screen::after {
  content: ""; position: absolute; left: 14%; right: 14%; bottom: 16%;
  height: 26px; border-radius: 4px;
  background:
    linear-gradient(var(--grid-line), var(--grid-line)) left top / 60% 6px no-repeat,
    linear-gradient(var(--grid-line), var(--grid-line)) left 14px / 80% 6px no-repeat,
    linear-gradient(var(--grid-line), var(--grid-line)) left 28px / 45% 6px no-repeat;
  opacity: 0.9; pointer-events: none;
}
/* When a real screenshot <img> is dropped in, it covers the whole screen. */
.browser-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.browser-screen img + * { display: none; }
/* :has() lets a parent style itself based on its CHILDREN — for years CSS had
 * no "parent selector" and this finally fixed that (Chrome/FF/Safari since
 * ~2023). Here: once a real screenshot exists, hide the faux skeleton lines
 * the ::after draws, and drop the padding so the image owns the full frame. */
.browser-screen:has(img) { padding: 0; }
.browser-screen:has(img)::after { display: none; }
.card:hover .browser-screen img { transform: scale(1.03); transition: transform 1.2s var(--ease); }
.work-card__body { padding: var(--space-4); }
.work-card__tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: var(--space-2); }
.tag { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 6px; padding: 0.2rem 0.55rem; }
.work-card__link { color: var(--accent); font-family: var(--font-mono); font-size: 0.85rem;
  display: inline-flex; align-items: center; gap: 0.4rem; margin-top: var(--space-3); }
.work-card.is-placeholder .browser-screen { color: var(--text-faint); }
.work-card.is-placeholder .browser-url { color: var(--text-faint); opacity: 0.8; }


/* ----------------------------------------------------------------------------
 * PROCESS (numbered steps with a connecting line)
 * --------------------------------------------------------------------------*/
.process { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); }
.step { position: relative; padding-top: var(--space-3); border-top: 1px solid var(--border); }
.step__n { font-family: var(--font-mono); color: var(--accent); font-size: 0.85rem; letter-spacing: 0.1em; }
.step h3 { font-size: 1.2rem; margin: var(--space-1) 0; }


/* ----------------------------------------------------------------------------
 * CTA STRIP
 * --------------------------------------------------------------------------*/
.cta-strip {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(140% 140% at 0% 0%, rgba(45,226,200,0.10), transparent 55%),
    var(--surface);
  padding: var(--space-8);
  text-align: center;
}
.cta-strip h2 { margin-bottom: var(--space-2); }
.cta-strip .btn { margin-top: var(--space-3); }


/* ----------------------------------------------------------------------------
 * MARQUEE (a slow auto-scrolling strip of capability keywords)
 * Decorative; aria-hidden in the HTML so screen readers skip the duplication.
 * --------------------------------------------------------------------------*/
.marquee { overflow: hidden; border-block: 1px solid var(--border); padding-block: var(--space-3);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee__track { display: flex; gap: var(--space-6); width: max-content;
  animation: marquee 28s linear infinite; }
.marquee span { font-family: var(--font-display); font-size: 1.4rem; color: var(--text-faint);
  display: inline-flex; align-items: center; gap: var(--space-6); white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }


/* ----------------------------------------------------------------------------
 * CONTACT FORM
 * Real validation happens in JS; these styles cover the visual states. Because
 * Fastmail Files has NO server, the form is a front-end stub (see contact.html
 * comments for how to wire it to a real handler later).
 *   -> WGU: JavaScript Programming (Term 3), Web Dev Foundations (Term 1)
 * --------------------------------------------------------------------------*/
.form { display: grid; gap: var(--space-3); }
.field { display: grid; gap: 0.45rem; }
.field label { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted); }
.field input, .field textarea {
  font-family: var(--font-body); font-size: 1rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.85rem 1rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,226,200,0.15); /* a soft focus ring = clear, accessible focus */
}
.field textarea { resize: vertical; min-height: 140px; }
.field.has-error input, .field.has-error textarea { border-color: var(--danger); }
.field__error { color: var(--danger); font-size: 0.82rem; min-height: 1.1em; }
.form__status { font-family: var(--font-mono); font-size: 0.9rem; min-height: 1.2em; }
.form__status.is-ok { color: var(--success); }

.contact-detail { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.contact-detail i { color: var(--accent); width: 20px; text-align: center; }
.contact-detail a, .contact-detail span { color: var(--text); }
.placeholder-note { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); }


/* ----------------------------------------------------------------------------
 * INTRO SPLASH (the logo animation video, home page only)
 *
 * LESSON — splash screens are risky UX. Done wrong, they're a toll booth in
 * front of your content. Three rules make this one polite:
 *   1. ONCE PER SESSION: JS checks sessionStorage and never replays it during
 *      the same browsing session. First impression only.
 *   2. ALWAYS SKIPPABLE: a real <button>, keyboard-focusable, and clicking
 *      anywhere dismisses it too.
 *   3. RESPECTS prefers-reduced-motion: users who've told their OS "less
 *      motion, please" never see it at all (JS checks before showing).
 * The element ships with the `hidden` attribute so there is ZERO flash for
 * returning visitors — JS opts IN to showing it, not out.
 *   -> WGU: UI Design (Term 3) — motion as enhancement, never as gatekeeper.
 * --------------------------------------------------------------------------*/
.splash {
  position: fixed; inset: 0; z-index: 300;
  display: none;                         /* JS adds .is-open to reveal — see below */
  align-items: center; justify-content: center;
  background: var(--bg);
  cursor: pointer;                       /* the whole overlay is "click to skip" */
  opacity: 1;
  transition: opacity 0.6s var(--ease);
}
/* BUG STORY (a great one — write this on your heart): the first version set
 * `display:flex` directly on .splash and relied on the HTML `hidden` attribute
 * to keep it off-screen. But `hidden` only works via the BROWSER's stylesheet
 * (`[hidden] { display:none }`), and ANY author rule — even a plain class —
 * outranks the entire user-agent stylesheet in the cascade. So our display:flex
 * silently defeated `hidden`, and the JS show/hide logic fought the CSS.
 * Moral: never pair the hidden attribute with an element you also give a
 * `display` value. Use a state class for both directions instead.
 *   -> WGU: Front-End Web Development (Term 2) — the cascade's origin rules. */
.splash.is-open { display: flex; }
.splash.is-leaving { opacity: 0; pointer-events: none; }
.splash video {
  width: min(720px, 88vw);
  max-height: 80vh;
  /* mix-blend hides the video's black letterboxing against our near-black bg */
}
.splash__skip {
  position: absolute; right: var(--space-3); bottom: var(--space-3);
  font-family: var(--font-mono); font-size: 0.8rem