/* =========================================================
   Raven Power — styles.css
   Dark, sleek, high-contrast. One restrained gold accent. Generous space.
   ========================================================= */

:root {
  /* Palette */
  --bg:           #000000;
  --bg-1:         #07080a;
  --bg-2:         #0c0e12;
  --panel:        #0a0c10;
  --panel-2:      #10131a;
  --line:         rgba(255, 255, 255, 0.07);
  --line-strong:  rgba(255, 255, 255, 0.14);

  --fg:           #f5f7fa;
  --fg-muted:     #9aa3b2;
  --fg-dim:       #8a909c; /* WCAG-AA on #000 (~5.4:1); was #6b7280 (4.48:1) — failed body text */

  /* One accent — refined gold, tuned to the raven mark's lightning bolt.
     Kept restrained: a single sharp highlight, not gold everywhere. */
  --accent:       #C9A249;
  --accent-2:     #D9B459; /* hover/brighter step */
  --accent-soft:  rgba(201, 162, 73, 0.16);
  --accent-glow:  rgba(201, 162, 73, 0.35);

  /* Per-discipline tints (used for capability tiles + project tags) */
  --tint-ai:      #C9A249;  /* gold — primary accent, matches logo bolt */
  --tint-pp:      #B79CFF;  /* lavender — Power Platform (cool counter) */
  --tint-bi:      #6FDDC4;  /* teal-mint — BI / Fabric */
  --tint-web:     #E8995A;  /* copper — Web (warm sibling to gold) */

  /* Type */
  --font-sans:    'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', ui-sans-serif, system-ui, sans-serif;

  /* Layout */
  --container:    1180px;
  --gutter:       clamp(20px, 4vw, 36px);
  --section-y:    clamp(80px, 12vw, 140px);
  --radius:       4px;
  --radius-lg:    10px;

  /* Motion */
  --ease:         cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #000; }

/* Visually hidden utility (a11y) */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Accessible skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  padding: 10px 14px;
  background: #fff;
  color: #000;
  border-radius: 6px;
  font-weight: 600;
  z-index: 100;
}
.skip-link:focus { left: 12px; }

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.04;
  margin: 0;
  color: var(--fg);
}
.accent { color: var(--accent); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
}
.eyebrow__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.link {
  color: var(--fg);
  border-bottom: 1px solid var(--line-strong);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.link:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: background .35s var(--ease), border-color .35s var(--ease), backdrop-filter .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.nav__mark {
  width: 32px;
  height: auto;
  display: block;
  /* Subtle gold halo around the mark — quieter so the wordmark holds equal weight */
  filter: drop-shadow(0 0 6px rgba(201, 162, 73, 0.10));
}
.nav__wordmark { font-size: 16px; font-weight: 600; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 14px;
  color: var(--fg-muted);
}
.nav__links a {
  position: relative;
  padding: 6px 0;
  transition: color .2s var(--ease);
}
.nav__links a:not(.nav__cta)::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 1px;
  background: var(--accent);
  transition: right .35s var(--ease);
}
.nav__links a:hover { color: var(--fg); }
.nav__links a:hover::after { right: 0; }

.nav__links a.nav__cta {
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--fg);
  transition: border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}
.nav__links a.nav__cta:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
/* nav__cta has no underline pseudo — selector above carries it */
.nav__links a.nav__cta::after { content: none; }

.nav__toggle {
  display: none;
  width: 36px; height: 36px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav__toggle span {
  display: block;
  width: 20px; height: 1.5px;
  background: var(--fg);
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav__mobile {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 16px var(--gutter) 26px;
  background: rgba(0,0,0,0.92);
  border-bottom: 1px solid var(--line);
}
.nav__mobile a {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
  color: var(--fg);
}
.nav__mobile a:last-child { border-bottom: 0; }

@media (max-width: 760px) {
  .nav__links { display: none; }
  .nav__toggle { display: flex; }
  .nav__mobile.is-open { display: flex; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 14.5px;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: transform .2s var(--ease), background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), box-shadow .25s var(--ease);
}
.btn:hover { will-change: transform; }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--fg);
  color: #000;
  border-color: var(--fg);
}
.btn--primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  /* Layered ring + glow — fades into the dark BG instead of clipping as a hard stroke */
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 20px var(--accent-glow);
}

.btn--ghost {
  color: var(--fg);
  border-color: var(--line-strong);
  background: transparent;
}
.btn--ghost:hover {
  border-color: var(--fg);
  background: rgba(255,255,255,0.04);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;       /* fallback */
  min-height: 100svh;      /* small viewport — handles iOS mobile bars */
  min-height: 100dvh;      /* dynamic — keeps height correct when bars hide/show */
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
  isolation: isolate;
}
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: 0.85;
}
.hero__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 55% 35%, rgba(201, 162, 73, 0.08), transparent 60%),
    radial-gradient(50% 40% at 20% 75%, rgba(201, 162, 73, 0.05), transparent 70%),
    linear-gradient(180deg, transparent 60%, #000 100%);
}
/* Subtle large raven mark backdrop — right-anchored, low opacity.
   The mark's own gold bolt becomes a faint signature behind the headline.
   Hidden on small screens to keep the title legible. */
.hero__mark {
  position: absolute;
  right: -6%;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(420px, 52vw, 760px);
  height: auto;
  z-index: -1;
  opacity: 0.07;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 0 60px rgba(201, 162, 73, 0.18));
}
/* .hero__bolt removed — the gold hairline is already carried by .section::after
   above each section. Repeating it here, on the alt-section ribbon, and on the
   footer made the accent feel like wallpaper rather than a signature. */
.hero__bolt { display: none; }
@media (max-width: 760px) {
  .hero__mark { opacity: 0.05; right: -28%; }
}
@media (max-width: 480px) {
  .hero__mark { display: none; }
}
.hero__inner {
  position: relative;
  z-index: 1;
}

.hero__title {
  font-size: clamp(32px, 7.4vw, 92px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
  max-width: 18ch;
  margin-bottom: 28px;
  text-wrap: balance;
  overflow-wrap: break-word;
  word-break: normal;
}
.hero__sub {
  font-size: clamp(16px, 1.8vw, 20px);
  color: var(--fg-muted);
  max-width: 60ch;
  margin: 0 0 40px;
  line-height: 1.55;
  text-wrap: pretty;
}
.hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero__scroll {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px; height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  display: grid;
  place-items: center;
  opacity: 0.65;
  transition: opacity .2s var(--ease);
}
.hero__scroll:hover { opacity: 1; }
.hero__scroll span {
  width: 2px; height: 6px;
  background: var(--fg);
  border-radius: 2px;
  animation: scroll-bob 1.8s var(--ease) infinite;
}
@keyframes scroll-bob {
  0%   { transform: translateY(-4px); opacity: 0; }
  40%  { opacity: 1; }
  100% { transform: translateY(6px); opacity: 0; }
}

@media (max-width: 600px) {
  .hero__scroll { display: none; }
}

/* Mobile-specific hero tightening — fix clip at 360-390px */
@media (max-width: 480px) {
  .hero { padding: 104px 0 64px; }
  .hero__title {
    font-size: clamp(28px, 9vw, 40px);
    max-width: 100%;
    letter-spacing: -0.025em;
  }
  .hero__sub { max-width: 100%; }
}
@media (max-width: 360px) {
  .hero__title { font-size: 26px; }
}

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding: var(--section-y) 0;
  border-top: 1px solid var(--line);
  isolation: isolate;
}

/* Subtle graph-paper grid texture — visible but restrained */
.section--grid::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: 0 0, 0 0;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, #000 30%, transparent 80%);
  pointer-events: none;
}

/* Hairline accent at section top — reuses the gold motif */
.section::after {
  content: '';
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  opacity: 0.35;
  pointer-events: none;
}

.section--alt {
  background:
    radial-gradient(60% 45% at 50% 0%, rgba(201, 162, 73, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg) 100%);
}
/* Faint gradient ribbon along the top of alt sections — visible */
.section--alt::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 220px;
  z-index: -1;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 38px,
      rgba(201,162,73,0.045) 38px,
      rgba(201,162,73,0.045) 39px
    );
  mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
  pointer-events: none;
}

.section__head {
  margin-bottom: clamp(40px, 6vw, 72px);
  max-width: 760px;
}
.section__title {
  font-size: clamp(28px, 4.5vw, 56px);
  letter-spacing: -0.025em;
  line-height: 1.05;
  text-wrap: balance;
}
.section__lede {
  margin-top: 18px;
  font-size: clamp(15px, 1.4vw, 17px);
  color: var(--fg-muted);
  max-width: 64ch;
}

/* ---------- Stats strip ---------- */
.stats {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(201,162,73,0.05) 0%, transparent 100%),
    #050608;
  padding: clamp(44px, 6vw, 72px) 0;
}
.stats__list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: clamp(20px, 3vw, 40px);
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 14px;
  border-left: 1px solid var(--line-strong);
}
.stat__num {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--fg);
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
}
.stat__plus {
  color: var(--accent);
  font-weight: 500;
  margin-left: 1px;
}
.stat__label {
  font-size: 13px;
  color: var(--fg-muted);
  letter-spacing: 0.01em;
  line-height: 1.4;
}

/* ---------- Capabilities ---------- */
.caps {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
/* Force a clean 2×2 in the tablet band so we never land on a lonely 3rd tile */
@media (min-width: 720px) and (max-width: 1023px) {
  .caps { grid-template-columns: repeat(2, 1fr); }
}
.cap {
  background: var(--bg);
  padding: 36px 30px 30px;
  position: relative;
  transition: background .35s var(--ease);
  --tint: var(--accent);
}
.cap--ai  { --tint: var(--tint-ai); }
.cap--pp  { --tint: var(--tint-pp); }
.cap--bi  { --tint: var(--tint-bi); }
.cap--web { --tint: var(--tint-web); }

.cap::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--tint);
  opacity: 0;
  transform: scaleX(0.2);
  transform-origin: left;
  transition: opacity .35s var(--ease), transform .45s var(--ease);
}
.cap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Centered top-edge glow — descends symmetrically rather than from one corner */
  background: rgba(201, 162, 73, 0.10);
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--tint) 14%, transparent), transparent 55%);
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.cap:hover { background: var(--panel); }
.cap:hover::before { opacity: 1; transform: scaleX(1); }
.cap:hover::after  { opacity: 1; }

.cap__icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  color: var(--tint);
  margin-bottom: 22px;
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--tint) 25%, transparent));
}
.cap__title {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin: 0 0 10px;
}
.cap__copy {
  margin: 0 0 16px;
  color: var(--fg-muted);
  font-size: 14.5px;
  line-height: 1.6;
}
.cap__detail {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.04em;
  /* Plain fallback for browsers without color-mix; quieter tint blend (35/65) */
  color: var(--fg-muted);
  color: color-mix(in srgb, var(--tint) 35%, var(--fg-muted));
  font-weight: 500;
}

/* ---------- Work controls: filter chips + live search ---------- */
.work-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.work-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  background: var(--panel);
  color: var(--fg-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    color .18s var(--ease),
    background .18s var(--ease),
    border-color .18s var(--ease),
    transform .18s var(--ease);
}
.chip:hover {
  color: var(--fg);
  border-color: var(--line-strong);
  background: var(--panel-2);
}
.chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.chip.is-active {
  color: #000;
  background: var(--accent);
  border-color: var(--accent);
}
.chip.is-active:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.work-search {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 220px;
  flex: 1 1 220px;
  max-width: 320px;
}
.work-search__icon {
  position: absolute;
  left: 12px;
  width: 14px;
  height: 14px;
  color: var(--fg-dim);
  pointer-events: none;
}
.work-search input {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
  padding: 8px 14px 8px 34px;
  font-size: 14px;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.work-search input::placeholder { color: var(--fg-dim); }
.work-search input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--panel-2);
}
.work-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 14px; width: 14px;
  background: var(--fg-dim);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3 3 L13 13 M13 3 L3 13' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3 3 L13 13 M13 3 L3 13' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>") center / contain no-repeat;
  cursor: pointer;
}

.work-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--fg-dim);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  margin: 0 0 16px;
  font-size: 14px;
}

/* Filtered-out cards: instantly hidden so layout reflows without gaps.
   The 'reveal' classes already handled fade-in; we keep this purely structural. */
.grid > li.is-hidden { display: none; }

@media (max-width: 640px) {
  .work-controls { flex-direction: column; align-items: stretch; }
  .work-search { max-width: none; }
}

/* ---------- Work grid ---------- */
.grid {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.proj {
  position: relative;
  padding: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform .35s var(--ease), border-color .35s var(--ease), background .35s var(--ease);
  overflow: hidden;
  --tag-tint: var(--accent);
  /* Drives currentColor on the motif SVGs below */
  color: var(--tag-tint);
}
.proj:has(.proj__tag[data-tag="ai"])     { --tag-tint: var(--tint-ai); }
.proj:has(.proj__tag[data-tag="pp"])     { --tag-tint: var(--tint-pp); }
.proj:has(.proj__tag[data-tag="bi"])     { --tag-tint: var(--tint-bi); }
.proj:has(.proj__tag[data-tag="web"])    { --tag-tint: var(--tint-web); }
.proj:has(.proj__tag[data-tag="fabric"]) { --tag-tint: var(--tint-bi); }

.proj:hover {
  transform: translateY(-3px);
  /* Fallback first, then color-mix for capable browsers */
  border-color: var(--line-strong);
  border-color: color-mix(in srgb, var(--tag-tint) 30%, var(--line-strong));
  background: var(--panel-2);
}

/* Tag-keyed motif strip */
.proj__motif {
  position: relative;
  width: 100%;
  aspect-ratio: 200 / 100;
  background: linear-gradient(180deg, #07090c 0%, #0a0c10 100%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.proj__motif svg {
  width: 100%;
  height: 100%;
  display: block;
}
.proj__motif::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, var(--panel) 100%);
  pointer-events: none;
}
/* Motif SVGs use currentColor for strokes/fills; the .proj sets
   color: var(--tag-tint), so each card's motif lands on the real
   palette token instead of a hue-rotate approximation. */

.proj__tag {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 10px;
  /* Plain fallback for older browsers */
  border: 1px solid var(--line-strong);
  border: 1px solid color-mix(in srgb, var(--tag-tint) 45%, transparent);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--tag-tint);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.proj__title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 24px 28px 12px;
}
.proj__copy {
  margin: 0 28px 22px;
  color: var(--fg-muted);
  font-size: 14.5px;
  line-height: 1.6;
  flex-grow: 1;
}
.proj__metric {
  margin: 0;
  padding: 16px 28px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: -0.01em;
}
.proj__metric-from,
.proj__metric-arrow,
.proj__metric-to {
  white-space: nowrap;
}
.proj__metric-from {
  color: var(--fg-dim);
  text-decoration: line-through;
  text-decoration-color: rgba(255,255,255,0.2);
}
.proj__metric-arrow {
  color: var(--tag-tint);
  font-weight: 700;
}
.proj__metric-to {
  color: var(--fg);
  font-weight: 600;
}
.proj__metric-label {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 500;
  margin-left: auto;
}

/* ---------- References (NDA line) ---------- */
.testimonial { text-align: left; }
.references__line {
  margin: 0;
  padding: clamp(24px, 3vw, 36px) clamp(28px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(60% 80% at 0% 0%, rgba(201,162,73,0.06), transparent 60%),
    var(--panel);
  font-family: var(--font-display);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--fg);
  max-width: 720px;
  text-wrap: pretty;
}

/* ---------- About ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.about__body p {
  margin: 0 0 18px;
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.65;
  color: var(--fg);
  max-width: 60ch;
}
.about__body p:nth-of-type(n+2) { color: var(--fg-muted); }
.about__body em { color: var(--accent); font-style: normal; }
.about__aside {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

/* Headshot placeholder — circular ring with initials.
   Replace with <img> in HTML when a real photo is dropped at assets/matt.jpg */
.about__portrait {
  float: right;
  width: clamp(120px, 18vw, 168px);
  height: clamp(120px, 18vw, 168px);
  border-radius: 50%;
  margin: 0 0 14px 24px;
  position: relative;
  /* Quieter placeholder — the bio is the work; this is a holding shape until a real headshot lands. */
  background: linear-gradient(135deg, #0e1218 0%, #060709 100%);
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.about__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.about__portrait-initials {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg-muted);
  opacity: 0.55;
}
@media (max-width: 520px) {
  .about__portrait {
    float: none;
    margin: 0 auto 18px;
    display: grid;
  }
}

@media (max-width: 800px) {
  .about__grid { grid-template-columns: 1fr; }
}

/* ---------- Facts (about + contact aside) ---------- */
.facts { margin: 0; padding: 0; }
.fact {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.fact:last-child { border-bottom: 0; }
.fact dt {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 500;
  margin: 2px 0 0;
}
.fact dd {
  margin: 0;
  font-size: 14.5px;
  color: var(--fg);
  line-height: 1.55;
}
@media (max-width: 520px) {
  .fact { grid-template-columns: 1fr; gap: 4px; }
}

/* Credentials lines — strong tier visually distinct from fundamentals */
.cred {
  display: block;
  margin-bottom: 6px;
  line-height: 1.4;
  color: var(--fg);
}
.cred:last-child { margin-bottom: 0; }
.cred--strong {
  font-weight: 500;
}
.cred--strong::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 8px var(--accent-glow);
}
.cred:not(.cred--strong) {
  color: var(--fg-muted);
  font-size: 13px;
  padding-top: 6px;
  margin-top: 6px;
  border-top: 1px dashed var(--line);
}

/* ---------- Contact ---------- */
.contact__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin: 22px 0 6px;
}
.contact__cta-or {
  color: var(--fg-muted);
  font-size: 14px;
}
.contact__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
}
@media (max-width: 800px) {
  .contact__grid { grid-template-columns: 1fr; }
}
.contact__aside {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.form { display: grid; gap: 18px; }
.form__direct {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(201,162,73,0.04);
  font-size: 13.5px;
  color: var(--fg-muted);
}
.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 520px) { .form__row { grid-template-columns: 1fr; } }

.field { display: grid; gap: 8px; }
.field__label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 500;
}
.field__opt {
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg-muted);
  font-size: 11px;
  opacity: 0.85;
}
.field input,
.field textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  padding: 12px 0 12px;
  font-size: 16px;
  color: var(--fg);
  border-radius: 0;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
  resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: var(--fg-muted); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
  /* Visible focus indicator that does NOT rely on the 1px underline alone */
  box-shadow: 0 2px 0 0 var(--accent);
}
.field input:user-invalid,
.field textarea:user-invalid {
  border-bottom-color: #ff7676;
}

.form__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.form__status {
  margin: 0;
  font-size: 13.5px;
  color: var(--fg-muted);
  min-height: 1.4em;
}
.form__status.is-ok { color: var(--accent); }
.form__status.is-err { color: #ff9e9e; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 44px;
  background: #000;
  position: relative;
}
/* Footer top hairline kept neutral — the gold ribbon already runs above every
   section via .section::after. Stacking another one here read as wallpaper. */
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--fg);
}
.footer__mark {
  width: 24px;
  height: auto;
  display: block;
  opacity: 0.92;
}
.footer__meta {
  font-size: 13px;
  color: var(--fg-muted);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.footer__sep { color: var(--fg-muted); opacity: .6; }
.footer__reg { color: var(--fg-muted); }
.footer__reg-num {
  color: var(--fg-muted);
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}
.footer__top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-muted);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.footer__top:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

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

/* ---------- Stack section: tabbed plugin browser ---------- */
.stack-wrap {
  margin-top: 18px;
}
.stack-stats {
  list-style: none;
  margin: 0 0 22px;
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.stack-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--fg-muted);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.stack-stat strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
  text-transform: none;
}

.stack-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0 12px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
}
.stack-tab {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 14px;
  background: var(--panel);
  color: var(--fg-muted);
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.stack-tab:hover {
  color: var(--fg);
  background: var(--panel-2);
  border-color: var(--line-strong);
}
.stack-tab.is-active {
  color: var(--accent);
  background: var(--panel-2);
  border-color: var(--line-strong);
}
.stack-tab.is-active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: -13px;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.stack-tab__name { font-family: var(--font-mono); font-size: 12.5px; }
.stack-tab__ver { font-family: var(--font-mono); font-size: 11px; color: var(--fg-dim); }
.stack-tab.is-active .stack-tab__ver { color: var(--accent-2); }

.stack-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  animation: stack-fade-in .25s var(--ease-out);
}
.stack-panel[hidden] { display: none; }
@keyframes stack-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.stack-panel__desc {
  margin: 0 0 16px;
  color: var(--fg-muted);
  font-size: 15px;
  max-width: 70ch;
}

.stack-counts {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.stack-counts li { display: inline-flex; }
.stack-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 11px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.stack-chip:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line-strong));
  color: var(--fg);
}
.stack-chip[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-2));
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line-strong));
  color: var(--fg);
}
.stack-chip strong {
  color: var(--accent);
  font-weight: 600;
}
.stack-empty {
  margin: 12px 0 0;
  color: var(--fg-muted);
  font-size: 14px;
  font-style: italic;
}

.stack-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.stack-items li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.stack-items li:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line-strong));
}
.stack-items code {
  font-family: var(--font-mono);
  color: var(--fg);
  font-size: 13px;
  background: none;
  padding: 0;
}
.stack-items span {
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.45;
}

.stack-cta {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 640px) {
  .stack-stats { gap: 14px 20px; padding: 12px 14px; }
  .stack-stat strong { font-size: 19px; }
  .stack-panel { padding: 18px 16px; }
  .stack-tab { padding: 7px 11px; }
}

/* ---------- Focus rings ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.field input:focus-visible,
.field textarea:focus-visible { outline: none; }
