/* ============================================================
   Brandon Davis — Product Builder
   Minimalist dark theme, matched to the BD mark (white on near-black).
   ============================================================ */

:root {
  --bg:        #0b0b0c;
  --bg-raised: #131316;
  --border:    #26262b;
  --text:      #f2f2f0;
  --muted:     #a1a1a8;
  --faint:     #6c6c74;
  --accent:    #10b981;      /* emerald — the single accent */
  --accent-dim:#0e5c46;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --maxw: 900px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

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

strong { color: var(--text); font-weight: 600; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #000; padding: .5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.brand:hover { color: var(--text); }
.nav-links { display: flex; gap: 1.6rem; list-style: none; margin: 0; padding: 0; font-size: .95rem; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); }
/* Small screens: wrap the header to two rows instead of hiding the links —
   three anchors don't need a hamburger, and the site stays JS-optional. */
@media (max-width: 560px) {
  .nav { height: auto; flex-wrap: wrap; padding-block: .8rem; gap: .35rem 1rem; }
  .nav-links { width: 100%; gap: 1.25rem; font-size: .9rem; }
}

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(3.5rem, 11vw, 7rem) clamp(2.5rem, 7vw, 4.5rem);
  display: grid;
  grid-template-columns: clamp(120px, 22vw, 210px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 4.5rem);
}
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; align-items: start; gap: 2.5rem; }
}

/* Hero blocks — outlined blocks stack up once on load; the last lands in emerald */
.hero-blocks svg { display: block; overflow: visible; width: 100%; max-width: 210px; height: auto; }
@media (max-width: 720px) {
  .hero-blocks svg { width: 84px; }
}
.hero-blocks rect {
  fill: none;
  stroke: var(--text);
  stroke-width: 1.75;
  vector-effect: non-scaling-stroke;   /* stays hairline even when the SVG scales up */
  opacity: 0;
  transform: translateY(-18px);
  animation: block-drop .5s cubic-bezier(.22, .9, .32, 1.15) forwards;
}
.hero-blocks rect.paint { stroke: var(--accent); }
.hero-blocks rect:nth-child(1) { animation-delay: .05s; }
.hero-blocks rect:nth-child(2) { animation-delay: .17s; }
.hero-blocks rect:nth-child(3) { animation-delay: .29s; }
.hero-blocks rect:nth-child(4) { animation-delay: .5s; }
.hero-blocks rect:nth-child(5) { animation-delay: .62s; }
.hero-blocks rect:nth-child(6) { animation-delay: .85s; }
@keyframes block-drop {
  to { opacity: 1; transform: translateY(0); }
}
/* Once the build-in finishes, JS marks each block settled so hover can take over
   (a filled animation would otherwise hold the transform). Clicking the stack
   rebuilds it into a new shape — blocks glide via the `translate` property,
   which composes with the hover `transform` instead of fighting it. */
.hero-blocks svg { cursor: pointer; }
.hero-blocks rect.settled { animation: none; opacity: 1; transform: none; pointer-events: all; }
@media (prefers-reduced-motion: no-preference) {
  .hero-blocks rect.settled {
    transition:
      transform .18s ease,
      translate .5s cubic-bezier(.22, .9, .32, 1.15);
  }
  .hero-blocks rect.settled:nth-child(2) { transition-delay: 0s, 40ms; }
  .hero-blocks rect.settled:nth-child(3) { transition-delay: 0s, 80ms; }
  .hero-blocks rect.settled:nth-child(4) { transition-delay: 0s, 120ms; }
  .hero-blocks rect.settled:nth-child(5) { transition-delay: 0s, 160ms; }
  .hero-blocks rect.settled:nth-child(6) { transition-delay: 0s, 220ms; }
  .hero-blocks rect.settled:hover { transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-blocks rect { animation: none; opacity: 1; transform: none; }
}

.eyebrow {
  font-family: var(--font-display); text-transform: uppercase;
  letter-spacing: .18em; font-size: .78rem; color: var(--accent);
  margin: 0 0 1.25rem;
}
.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  margin: 0 0 1.5rem; max-width: 18ch;
}
.lede { font-size: clamp(1.05rem, 2.3vw, 1.2rem); color: var(--muted); max-width: 60ch; margin: 0 0 2rem; }
.lede strong { color: var(--text); }

.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 2rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-display); font-weight: 500; font-size: .95rem;
  padding: .7rem 1.25rem; border-radius: 8px;
  border: 1px solid var(--border); color: var(--text);
  transition: border-color .18s, background .18s, color .18s, transform .18s;
}
.btn:hover { border-color: var(--faint); color: var(--text); transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #04140e; border-color: var(--accent); }
.btn-primary:hover { background: #34d399; color: #04140e; border-color: #34d399; }

.hero-meta { display: flex; flex-wrap: wrap; gap: 1.4rem; list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.hero-meta a { color: var(--muted); border-bottom: 1px solid var(--border); padding-bottom: 1px; }
.hero-meta a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3rem, 8vw, 5rem); border-top: 1px solid var(--border); }
.section-head { margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.5rem, 4vw, 2rem); margin: 0 0 .5rem; display: flex; align-items: baseline; gap: .75rem; }
.section-head p { color: var(--muted); margin: 0; max-width: 55ch; }
.marker { font-size: .85rem; color: var(--accent); font-weight: 500; letter-spacing: .05em; }

/* ---------- Projects ---------- */
.projects {
  display: grid;
  grid-template-columns: 1fr;   /* one case study per row */
  gap: 1.5rem;
}
.project {
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .2s;
}
.project:hover { border-color: var(--faint); }
.project-media { display: block; overflow: hidden; }
.project-media img {
  display: block;
  width: 100%;
  height: auto;   /* natural aspect ratio — never crop the screenshot */
  transition: transform .45s ease;
}
.project:hover .project-media img { transform: scale(1.03); }
.project-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 3vw, 1.6rem);
}

/* Desktop: horizontal card — framed thumbnail + tech tags left, body right. The side
   column top-aligns so an expanded case study grows without stretching the image. */
@media (min-width: 721px) {
  .project {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    align-items: start;
  }
  .project-side {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    margin: clamp(1.25rem, 3vw, 1.6rem) 0 clamp(1.25rem, 3vw, 1.6rem) clamp(1.25rem, 3vw, 1.6rem);
  }
  .project-media {
    border: 1px solid var(--border);
    border-radius: 10px;
  }
}
@media (max-width: 720px) {
  .project-side .tags { padding: 1.1rem clamp(1.25rem, 3vw, 1.6rem) 0; }
}
.project-body .project-links { margin-top: auto; padding-top: 1.1rem; }

/* expand / collapse */
.project-more { margin-top: .25rem; border-top: 1px solid var(--border); }
.project-more summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: .9rem;
  color: var(--accent);
  padding: .85rem 0 .1rem;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.project-more summary::-webkit-details-marker { display: none; }
.project-more summary::after {
  content: "▾";
  font-size: .8rem;
  transition: transform .2s ease;
}
.project-more[open] summary::after { transform: rotate(180deg); }
.project-more[open] summary { color: var(--muted); }
.project-more .project-points { margin-top: .9rem; }
.details-body { overflow: hidden; }

/* grouped subheads inside a long case study */
.detail-head {
  font-family: var(--font-display);
  font-size: .78rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--faint);
  margin: 1.4rem 0 0;
}
.detail-group .detail-head + .project-points { margin-top: .6rem; margin-bottom: 1.1rem; }

.project-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-bottom: .35rem; }
.project-head h3 { font-size: clamp(1.35rem, 3.5vw, 1.7rem); margin: 0; }
.project-status {
  font-family: var(--font-display); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent-dim); border-radius: 999px; padding: .2rem .7rem;
}
.project-role { color: var(--faint); font-size: .92rem; margin: 0 0 1rem; font-family: var(--font-display); }
.project-summary { color: var(--muted); margin: 0 0 1.25rem; }
.project-points { margin: 0 0 1.5rem; padding-left: 1.1rem; color: var(--muted); }
.project-points li { margin-bottom: .55rem; }
.project-links { margin: 0; }
.project-links a { color: var(--accent); font-family: var(--font-display); font-size: .95rem; }

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.tags li {
  font-family: var(--font-display); font-size: .8rem; color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px; padding: .3rem .6rem; background: var(--bg);
}

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0 0 3rem; }
.role { padding: 1.5rem 0; border-top: 1px solid var(--border); }
.role:first-child { border-top: none; padding-top: 0; }
.role-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; margin-bottom: .75rem; }
.role-head h3 { font-size: 1.2rem; margin: 0; }
.role-org { font-family: var(--font-display); color: var(--accent); font-size: .95rem; }
.role-dates { color: var(--faint); font-size: .88rem; margin-left: auto; font-family: var(--font-display); }
.role-points { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.role-points li { margin-bottom: .45rem; }

/* ---------- Experience grid ---------- */
.exp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 2rem; }
.exp-subhead { font-size: .95rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin: 0 0 1rem; font-weight: 500; }
.plain-list { list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: .92rem; }
.plain-list li { margin-bottom: .6rem; padding-left: 1rem; position: relative; }
.plain-list li::before { content: "—"; position: absolute; left: 0; color: var(--faint); }
.plain-list a { color: var(--accent); white-space: nowrap; }

/* ---------- Contact ---------- */
.contact-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- Footer ---------- */
.site-footer {
  display: flex; align-items: center; gap: .75rem;
  padding-block: 2.5rem 3rem; border-top: 1px solid var(--border);
  color: var(--faint); font-size: .88rem;
}
