/* =============================================================================
   steveo254 — global.css
   Loaded on every page. Holds design tokens, reset, base type, the header,
   the footer, and the shared reveal animation. Page-specific rules live in
   CSSs/<page>.css.
   Palette: "Midnight" (dark is the default) with a matching light mode.
   ========================================================================== */

/* ---- tokens : dark (default) --------------------------------------------- */
:root {
  color-scheme: dark;

  --ground:        #070C15;
  --surface:       #0F1B2D;
  --surface-2:     #14223A;
  --text:          #E8EEF7;
  --muted:         #8397B0;
  --rule:          #1E2E45;
  --accent:        #5DA0FF;
  --accent-hover:  #93BEFF;
  --pill:          #1A2B44;
  --strip:         #000000;
  --shadow-card:   0 1px 2px rgba(0, 0, 0, .40), 0 18px 42px rgba(0, 0, 0, .55);

  --font-mono:  'Press Start 2P', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-desc:  'JetBrains Mono', 'Fira Code', Consolas, 'Liberation Mono', monospace;

  --wrap:       660px;
  --wrap-wide:  1160px;
  --gutter:     clamp(20px, 5vw, 40px);
  --section:    clamp(3rem, 7vw, 5rem);
}

/* ---- tokens : light ---------------------------------------------------- */
:root[data-theme="light"] {
  color-scheme: light;
  --ground:       #EEF2F8;
  --surface:      #FFFFFF;
  --surface-2:    #E1E8F4;
  --text:         #0C1522;
  --muted:        #5B6B82;
  --rule:         #D6DFEC;
  --accent:       #1D4ED8;
  --accent-hover: #1740B0;
  --pill:         #E7ECF5;
  --strip:        #0C1522;
  --shadow-card:  0 1px 2px rgba(12, 21, 34, .05), 0 14px 34px rgba(12, 21, 34, .09);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --ground:       #EEF2F8;
    --surface:      #FFFFFF;
    --surface-2:    #E1E8F4;
    --text:         #0C1522;
    --muted:        #5B6B82;
    --rule:         #D6DFEC;
    --accent:       #1D4ED8;
    --accent-hover: #1740B0;
    --pill:         #E7ECF5;
    --strip:        #0C1522;
    --shadow-card:  0 1px 2px rgba(12, 21, 34, .05), 0 14px 34px rgba(12, 21, 34, .09);
  }
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .3s ease, color .3s ease;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, p, ul, ol { margin: 0; }
ul { list-style: none; padding: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--ground); }

/* ---- layout helpers ------------------------------------------------------ */
.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- shared form styling: contact page + the review form on work-detail ---- */
.contact__form { display: flex; flex-direction: column; gap: 1.5rem; }
/* display:none (not just off-screen positioning) — browser autofill, Chrome
   on Android especially, will still fill a field that's merely moved off-
   screen, defeating the honeypot for real visitors. A non-rendered field is
   skipped by autofill and still invisible to a simple bot parsing raw HTML. */
.contact__hp { display: none; }

.field { display: flex; flex-direction: column; gap: .5rem; }
.field__label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.field__input {
  width: 100%;
  padding: .8rem .9rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 8px;
  font: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field__input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.field__input.is-invalid { border-color: #E5484D; }
textarea.field__input { resize: vertical; min-height: 9rem; }

.contact__submit {
  align-self: flex-start;
  padding: .8rem 1.4rem;
  background: var(--accent);
  color: var(--ground);
  border: 0;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .2s ease, opacity .2s ease;
}
.contact__submit:hover { background: var(--accent-hover); }
.contact__submit:disabled { opacity: .6; cursor: default; }

.contact__status { min-height: 1.2em; font-size: .95rem; color: var(--muted); }
.contact__status.is-ok { color: var(--accent); }
.contact__status.is-error { color: #E5484D; }

/* ---- workrow: company + role + date, shared by home + work pages ---- */
.worklist { display: flex; flex-direction: column; }

.workrow {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--rule);
  color: var(--text);
  text-decoration: none;
  transition: background-color .3s ease;
}
.worklist .workrow:first-child { border-top: 1px solid var(--rule); }
a.workrow:hover { background: var(--surface); }
/* The [hidden] attribute (set by JS/home.js's pager) would otherwise lose to
   the display:flex above — an author rule always wins over the UA
   stylesheet's [hidden]{display:none}, regardless of specificity. Same
   pattern as .cmdk-backdrop[hidden] below. */
.workrow[hidden] { display: none; }

/* Shared pill button for pagers/reveal controls — home page's Reviews and
   Selected work pagers, Work page's "Show more" buttons. */
.reviewpager__btn {
  font-family: var(--font-desc);
  font-size: .78rem;
  padding: .5rem 1rem;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  transition: border-color .3s ease, color .3s ease;
}
.reviewpager__btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.reviewpager__btn:disabled { opacity: .4; cursor: default; }

.workrow__avatar {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: .85rem;
  font-weight: 700;
}
.workrow--v1 .workrow__avatar { background: var(--text); color: var(--ground); }
.workrow--v2 .workrow__avatar { background: var(--accent); color: var(--ground); }
.workrow--v3 .workrow__avatar { background: var(--surface-2); color: var(--text); border: 1px solid var(--rule); }
.workrow--v4 .workrow__avatar { background: var(--pill); color: var(--accent); }

/* Real logo replaces the monogram once uploaded — sits on the same coloured
   circle (rather than cropping to fill it) so non-square/transparent logos
   still show in full. */
.workrow__avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  padding: 7px;
  box-sizing: border-box;
}

.workrow__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.workrow__org {
  font-family: var(--font-mono);
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workrow__cat { font-family: var(--font-desc); font-size: .78rem; color: var(--muted); }

.workrow__date {
  flex: none;
  font-family: var(--font-desc);
  font-size: .78rem;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

/* ---- certcard: licenses & certifications (home page) ---- */
.certlist { display: flex; flex-direction: column; }

.certcard {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.certlist .certcard:first-child { border-top: 1px solid var(--rule); }

.certcard__badge {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: -.02em;
  text-align: center;
}
.certcard--v1 .certcard__badge { background: var(--text); color: var(--ground); }
.certcard--v2 .certcard__badge { background: var(--accent); color: var(--ground); }
.certcard--v3 .certcard__badge { background: var(--surface-2); color: var(--text); border: 1px solid var(--rule); }
.certcard--v4 .certcard__badge { background: var(--pill); color: var(--accent); }
.certcard__badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  padding: 6px;
  box-sizing: border-box;
}

.certcard__body { flex: 1 1 auto; min-width: 0; }
.certcard__title { font-family: var(--font-mono); font-size: .85rem; font-weight: 700; color: var(--text); }
.certcard__issuer { margin-top: .25rem; font-family: var(--font-desc); font-size: .82rem; color: var(--muted); }
.certcard__meta { margin-top: .35rem; font-family: var(--font-desc); font-size: .78rem; color: var(--muted); }
.certcard__id {
  margin-top: .2rem;
  font-family: var(--font-desc);
  font-size: .7rem;
  color: var(--muted);
  word-break: break-all;
}
.certcard__show {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: .65rem;
  padding: .4rem .8rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--font-desc);
  font-size: .7rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color .3s ease, color .3s ease;
}
.certcard__show:hover { border-color: var(--accent); color: var(--accent); }
.certcard__show svg { width: 11px; height: 11px; }
.certcard__skills { margin-top: .55rem; font-family: var(--font-desc); font-size: .78rem; color: var(--muted); }
.certcard__skills > p { margin: 0; }

.certcard__skillsToggle summary {
  cursor: pointer;
  list-style: none;
  color: var(--muted);
}
.certcard__skillsToggle summary::-webkit-details-marker { display: none; }
.certcard__skillsToggle summary::marker { content: ''; }
.certcard__skillsToggle summary:hover { color: var(--accent); }
.certcard__skillsFull {
  margin: .5rem 0 0;
  padding-top: .5rem;
  border-top: 1px dashed var(--rule);
  color: var(--text);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: .7rem 1rem;
  border-radius: 8px;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* shared page header block (work / projects / contact / legal) */
.page-intro { margin-top: clamp(2.5rem, 7vw, 4.5rem); }
.page-intro__title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 1.4rem + 3vw, 3rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.02em;
}
.page-intro__text {
  margin-top: 1rem;
  max-width: 46ch;
  color: var(--muted);
  font-family: var(--font-desc);
  font-size: clamp(.9rem, .87rem + .3vw, 1rem);
  line-height: 1.7;
  text-wrap: pretty;
}

/* ---- header ------------------------------------------------------------- */
.site-header { background: var(--ground); }
.site-header__strip { height: 6px; background: var(--strip); transition: background-color .3s ease; }

.site-header__inner {
  max-width: var(--wrap-wide);
  margin-inline: auto;
  padding: clamp(12px, 3.4vw, 24px) var(--gutter) clamp(18px, 4vw, 34px);
}

/* single horizontal row at EVERY viewport — never stacks, no hamburger */
.site-header__card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: clamp(9px, 3vw, 20px);
  background: var(--surface);
  border-radius: clamp(13px, 2vw, 18px);
  box-shadow: var(--shadow-card);
  padding: clamp(12px, 3.2vw, 20px) clamp(12px, 3.4vw, 26px);
  font-family: var(--font-mono);
  transition: background-color .3s ease, box-shadow .3s ease;
}

.site-header__mark {
  flex: 0 1 auto;
  min-width: 0;
  font-size: clamp(10px, 3vw, 15px);
  line-height: 1;
  color: var(--accent);
  white-space: nowrap;
}

.site-nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: clamp(8px, 2.6vw, 18px);
  font-size: clamp(7px, 2.2vw, 10px);
  line-height: 1;
}
.site-nav__link { color: var(--accent); white-space: nowrap; transition: color .3s ease, background-color .3s ease; }
.site-nav__link:hover { color: var(--accent-hover); }
.site-nav__link.is-active {
  padding: clamp(5px, 1.6vw, 7px) clamp(7px, 2vw, 11px);
  border-radius: 999px;
  background: var(--pill);
  color: var(--text);
}

.site-nav__toggle {
  flex: 0 0 auto;
  display: inline-flex;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
}
.site-nav__toggle svg {
  width: clamp(13px, 3.4vw, 16px);
  height: clamp(13px, 3.4vw, 16px);
  transition: transform .35s ease;
}
/* Only the real theme toggle (sun/moon) flips in light mode — [data-theme-toggle]
   scopes this precisely, since .site-nav__toggle is now shared with the
   command-palette search button too, which must never rotate. */
:root[data-theme="light"] [data-theme-toggle] svg { transform: rotate(180deg); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) [data-theme-toggle] svg { transform: rotate(180deg); }
}

/* ---- footer ----------------------------------------------------------------- */
.site-footer { background: var(--ground); margin-top: var(--section); }
.site-footer__inner {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 2.75rem) var(--gutter) clamp(3rem, 7vw, 4.5rem);
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 10px;
  transition: border-color .3s ease;
}
.site-footer__cols {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.75rem, 5vw, 3.5rem);
}
.site-footer__col { display: flex; flex-direction: column; gap: .95rem; }
.site-footer__head { color: var(--muted); }
.site-footer__col a { color: var(--text); }
.site-footer__col a:hover { color: var(--accent); }
.site-footer__legal {
  margin-top: clamp(2rem, 5vw, 2.75rem);
  color: var(--muted);
  line-height: 2;
}
.site-footer__legal a { color: var(--muted); }
.site-footer__legal a:hover { color: var(--accent); }

/* ---- command palette (Ctrl/Cmd+K) --------------------------------------- */
.cmdk-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 20px 20px;
}
.cmdk-backdrop[hidden] { display: none; }

.cmdk {
  width: 100%;
  max-width: 520px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.cmdk__field {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  flex: none;
}
.cmdk__field svg { width: 16px; height: 16px; flex: none; }
.cmdk__input {
  flex: 1 1 auto;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  font-family: var(--font-desc);
  font-size: .92rem;
  color: var(--text);
}
.cmdk__input::placeholder { color: var(--muted); }
.cmdk__esc {
  flex: none;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: .2em .4em;
}

.cmdk__list { list-style: none; margin: 0; padding: .5rem; overflow-y: auto; }
.cmdk__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem .7rem;
  border-radius: 8px;
  font-family: var(--font-desc);
  font-size: .88rem;
  color: var(--text);
  cursor: pointer;
}
.cmdk__item[hidden] { display: none; }
.cmdk__item.is-active { background: var(--surface-2); }
.cmdk__item-hint { flex: none; font-size: .76rem; color: var(--muted); }
.cmdk__empty { margin: 0; padding: 1.2rem 1rem; text-align: center; color: var(--muted); font-family: var(--font-desc); font-size: .85rem; }
.cmdk__empty[hidden] { display: none; }

/* ---- floating WhatsApp button ------------------------------------------- */
.whatsapp-fab {
  position: fixed;
  right: clamp(16px, 4vw, 28px);
  bottom: clamp(16px, 4vw, 28px);
  z-index: 30;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #25D366;
  color: #0B1410;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  transition: background-color .25s ease, box-shadow .25s ease;
}
/* Scaling this icon on hover anti-aliased its thin bubble outline into a
   blurry halo (worse against a dark ground), so the hover feedback is a
   deeper shadow + brighter green instead of a transform. */
.whatsapp-fab:hover { background: #2fe374; color: #0B1410; box-shadow: 0 6px 20px rgba(0, 0, 0, .45); }
.whatsapp-fab:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---- signature motion : blur-to-sharp rise, staggered by JS ------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  filter: blur(4px);
  transition:
    opacity .6s ease,
    transform .6s cubic-bezier(.2, .7, .2, 1),
    filter .6s ease;
}
[data-reveal].is-in { opacity: 1; transform: none; filter: none; }

@media (prefers-reduced-motion: reduce) {
  body,
  .site-header__strip,
  .site-header__card,
  .site-nav__link,
  .site-footer__inner { transition: none; }
  .site-nav__toggle svg { transition: none; }
  .whatsapp-fab { transition: none; }
  [data-reveal],
  [data-reveal].is-in { opacity: 1; transform: none; filter: none; transition: none; }
}
