/* =========================================================
   Braden Miller — Portfolio
   Design system: warm ivory canvas, terracotta accent,
   Fraunces (serif display) + Inter (sans), Apple × Claude.
   ========================================================= */

:root {
  /* Color */
  --bg:        #F7F7F3;
  --bg-tint:   #EDEDE6;
  --card:      #FFFFFF;
  --ink:       #1B1A16;
  --ink-soft:  #55514740;
  --muted:     #63625A;
  --muted-2:   #6B6960;  /* darkened to pass WCAG AA (>=4.5:1) on light backgrounds */
  --line:      #E4E3DB;
  --line-soft: #EEEEE7;
  --accent:    #2E6A4F;
  --accent-ink:#245840;
  --dark:      #121611;
  --dark-2:    #1B211A;
  --on-dark:   #ECEDE6;
  --on-dark-mut:#9AA394;

  /* Security cover */
  --cover-a:   #93BBA4;
  --cover-g1:  #20291F;
  --cover-g2:  #141B14;
  --cover-g3:  #0E130E;
  --cover-grid:#2E6A4F;

  /* Type */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Layout */
  --wrap: 1120px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 18px;
  --radius-lg: 26px;

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

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* height:auto is required: the width/height attributes on <img> act as
   presentational hints, so without it an image with width:100% would also
   take the attribute's pixel height and stretch vertically. */
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 8px;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: inline-flex; align-items: center; font-weight: 500; letter-spacing: -0.02em; font-size: 1.02rem; transition: color .25s var(--ease); }
.brand:hover { color: var(--accent); }

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2rem); }
.nav a { color: var(--muted); font-size: .95rem; font-weight: 450; transition: color .25s var(--ease); }
.nav a:hover { color: var(--ink); }
.nav a:not(.nav-cta) { position: relative; }
.nav a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 1.5px;
  background: currentColor; border-radius: 2px; opacity: .55;
  transform: scaleX(0); transform-origin: left center;
  transition: transform .35s var(--ease);
}
.nav a:not(.nav-cta):hover::after { transform: scaleX(1); }
.nav-cta {
  color: var(--ink) !important; border: 1px solid var(--line);
  padding: .5rem .95rem; border-radius: 999px; background: var(--card);
  transition: border-color .2s var(--ease), transform .2s var(--ease) !important;
}
.nav-cta:hover { border-color: var(--ink); transform: translateY(-1px); }
@media (max-width: 620px) {
  .nav a:not(.nav-cta) { display: none; }
  .header-inner { height: 64px; }
}

/* ---------- Hero ---------- */
.hero {
  min-height: calc(100vh - 72px);
  min-height: calc(100svh - 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(2.5rem, 7vh, 5rem);
}
@media (max-width: 620px) { .hero { min-height: calc(100svh - 64px); } }
.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .82rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; margin-bottom: 1.6rem;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 380;
  font-size: clamp(2.9rem, 7.2vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  max-width: 15ch;
}
.hero-title em { font-style: italic; color: var(--accent); font-weight: 400; }
.hero-lede {
  margin-top: 1.8rem; max-width: 46ch;
  font-size: clamp(1.08rem, 2vw, 1.28rem); line-height: 1.6; color: var(--muted);
  letter-spacing: -0.01em;
}
.hero-actions { margin-top: 2.4rem; display: flex; flex-wrap: wrap; gap: .8rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .98rem; font-weight: 500; padding: .85rem 1.5rem; border-radius: 999px;
  transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); transform: translateY(-2px); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); transition-duration: .1s; }
.btn-icon { opacity: .7; }

/* ---------- Section head ---------- */
.section-label {
  display: inline-block; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 1rem;
}
.section-head { max-width: 40ch; margin-bottom: clamp(2.2rem, 5vw, 3.4rem); }
.section-note { font-family: var(--serif); font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.25; letter-spacing: -0.02em; color: var(--ink); font-weight: 350; }

/* ---------- Work ---------- */
.work { padding-block: clamp(3rem, 8vw, 6rem); }

/* Featured / placeholder */
.feature {
  position: relative;
  display: grid; grid-template-columns: 1.15fr 1fr; align-items: stretch;
  gap: clamp(1.5rem, 4vw, 3rem);
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
  transition: transform .45s var(--ease), border-color .45s var(--ease);
  will-change: transform;
}
.feature::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none; opacity: 0;
  box-shadow: 0 28px 56px -26px rgba(24,26,16,.34);
  transition: opacity .45s var(--ease);
}
.feature:hover { transform: translateY(-5px); }
.feature:hover::after { opacity: 1; }
.feature-media { position: relative; min-height: 340px; overflow: hidden; border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.cover-security {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--cover-a);
  background:
    radial-gradient(120% 100% at 20% 0%, var(--cover-g1) 0%, var(--cover-g2) 55%, var(--cover-g3) 100%);
  overflow: hidden;
}
.cover-security::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(color-mix(in srgb, var(--cover-grid) 22%, transparent) 1px, transparent 1px),
                    linear-gradient(90deg, color-mix(in srgb, var(--cover-grid) 22%, transparent) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(80% 80% at 50% 40%, #000 0%, transparent 75%);
  opacity: .5;
}
.cover-security .shield { position: relative; width: 42%; max-width: 150px; filter: drop-shadow(0 8px 24px rgba(0,0,0,.4)); }
.feature-body { padding: clamp(1.75rem, 3vw, 2.75rem) clamp(1.75rem, 3vw, 2.75rem) clamp(1.75rem,3vw,2.75rem) 0; display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 780px) {
  .feature { grid-template-columns: 1fr; }
  .feature-media { min-height: 240px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .feature-body { padding: clamp(1.5rem, 5vw, 2rem); padding-top: 0; }
}

.tag {
  align-self: flex-start; font-size: .74rem; letter-spacing: .05em; text-transform: uppercase;
  font-weight: 600; padding: .35rem .7rem; border-radius: 999px; margin-bottom: 1.1rem;
  /* transparent by default so bordered variants keep an identical box height */
  border: 1px solid transparent;
}
.tag-progress { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 12%, transparent); }
/* Row wrapper: .feature-body is a flex column, so tags need their own row to
   sit side by side instead of stacking. */
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1.1rem; }
.tags .tag { align-self: auto; margin-bottom: 0; }
.tag-lock { display: inline-flex; align-items: center; gap: .38rem; color: var(--muted); background: var(--bg-tint); border-color: var(--line); }
.tag-lock svg { flex: none; }
.feature-title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1.1; letter-spacing: -0.02em; }
.feature-desc { margin-top: .9rem; color: var(--muted); font-size: 1.05rem; max-width: 38ch; }

/* Card grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.1rem, 2.4vw, 1.8rem); }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }

.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .45s var(--ease), border-color .45s var(--ease);
  will-change: transform;
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none; opacity: 0;
  box-shadow: 0 22px 44px -24px rgba(24,26,16,.32);
  transition: opacity .45s var(--ease);
}
.card:hover { transform: translateY(-5px); }
.card:hover::after { opacity: 1; }
.card-media {
  aspect-ratio: 16 / 11; overflow: hidden; background: var(--bg-tint);
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transform: translateZ(0); backface-visibility: hidden; transition: transform .6s var(--ease); }
.card:hover .card-media img { transform: translateZ(0) scale(1.05); }
.card-body { padding: 1.3rem 1.35rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.card-title { font-family: var(--serif); font-weight: 420; font-size: 1.4rem; letter-spacing: -0.02em; }
.card-desc { margin-top: .5rem; color: var(--muted); font-size: .96rem; line-height: 1.5; flex: 1; }

.card-meta { margin-top: 1.1rem; display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; font-size: .82rem; color: var(--muted-2); letter-spacing: .01em; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); opacity: .6; }

/* ---------- About ---------- */
.about { padding-block: clamp(4rem, 9vw, 7rem); }
.about-inner { display: grid; grid-template-columns: 0.85fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (max-width: 820px) { .about-inner { grid-template-columns: 1fr; } }
.about-media { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); }
.about-media img { width: 100%; height: auto; display: block; }
@media (max-width: 820px) { .about-media { max-width: 380px; } }
.about-title { font-family: var(--serif); font-weight: 360; font-size: clamp(1.7rem, 3.6vw, 2.5rem); line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 1.3rem; max-width: 18ch; }
.about-copy p { color: var(--muted); margin-bottom: 1rem; max-width: 46ch; }
.text-link { display: inline-flex; align-items: center; gap: .4rem; margin-top: .6rem; font-weight: 500; color: var(--ink); border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: gap .25s var(--ease), border-color .25s var(--ease); }
.text-link:hover { gap: .7rem; border-color: var(--accent); color: var(--accent-ink); }

/* ---------- Recommendations ---------- */
.recs { padding-block: clamp(3rem, 8vw, 6rem); }
.rec-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); padding: clamp(1.6rem, 3.5vw, 2.6rem); }
.rec-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.4rem; }
.rec-avatar { flex: none; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: .95rem; font-weight: 600; letter-spacing: .02em; color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.rec-person { display: flex; flex-direction: column; gap: .15rem; }
.rec-name { font-weight: 600; color: var(--ink); }
.rec-role { font-size: .85rem; color: var(--muted-2); line-height: 1.4; }
.rec-quote { position: relative; overflow: hidden; max-height: 150px; }
.rec-card.is-open .rec-quote { max-height: none; }
.rec-quote p { color: var(--muted); line-height: 1.7; margin-bottom: 1rem; }
.rec-quote p:last-child { margin-bottom: 0; }
.rec-quote::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4em; background: linear-gradient(to bottom, transparent, var(--card)); pointer-events: none; transition: opacity .3s var(--ease); }
.rec-card.is-open .rec-quote::after { opacity: 0; }
.rec-toggle { display: inline-block; margin-top: 1.3rem; background: none; border: none; border-bottom: 1px solid var(--line); padding: 0 0 1px; font: inherit; font-size: .92rem; font-weight: 500; color: var(--accent-ink); cursor: pointer; transition: border-color .2s var(--ease); }
.rec-toggle:hover { border-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .rec-quote { transition: none; } }

/* ---------- Contact ---------- */
.contact { background: var(--dark); color: var(--on-dark); border-radius: clamp(24px, 4vw, 40px) clamp(24px, 4vw, 40px) 0 0; margin-top: clamp(2rem, 5vw, 4rem); padding-block: clamp(4.5rem, 10vw, 8rem); }
.contact-inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.contact-eyebrow { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 1.3rem; }
.contact-title { font-family: var(--serif); font-weight: 340; font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1.06; letter-spacing: -0.025em; max-width: 16ch; }
.contact-mail { display: inline-block; margin-top: 2rem; font-family: var(--serif); font-style: italic; font-size: clamp(1.2rem, 3vw, 1.7rem); color: var(--on-dark); border-bottom: 1px solid color-mix(in srgb, var(--on-dark) 30%, transparent); padding-bottom: 4px; transition: color .25s var(--ease), border-color .25s var(--ease); }
.contact-mail:hover { color: var(--accent); border-color: var(--accent); }
.contact-links { margin-top: 2.6rem; display: flex; gap: 1.6rem; flex-wrap: wrap; justify-content: center; }
.contact-links a { color: var(--on-dark-mut); font-size: .95rem; transition: color .2s var(--ease); position: relative; }
.contact-links a:hover { color: var(--on-dark); }
.contact-foot { margin-top: clamp(3rem, 7vw, 5rem); padding-top: 1.6rem; border-top: 1px solid color-mix(in srgb, var(--on-dark) 12%, transparent); width: 100%; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .6rem; font-size: .82rem; color: var(--on-dark-mut); }

/* ---------- Reveal on scroll ----------
   Entrance is a one-shot keyframe animation (removed on completion via .done)
   so it never clobbers element hover transitions (e.g. cards are .reveal too). */
.reveal { opacity: 0; }
.reveal.in {
  animation: reveal-in .9s var(--ease) var(--reveal-delay, 0ms) both;
  will-change: opacity, transform;
}
.reveal.done { animation: none; opacity: 1; will-change: auto; }
@keyframes reveal-in {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in { animation: none !important; opacity: 1 !important; }
}

/* ---------- Stacked feature previews ---------- */
.feature-title a { color: inherit; text-decoration: none; }
/* stretched link covers the whole feature (which is position:relative) */
.feature-link::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.feature-media > .cover-fill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Booz card: the cover crossfades to the Digital Battlespace mockup on hover. */
.feature-media > .cover-hover { opacity: 0; z-index: 1; pointer-events: none; transition: opacity .55s var(--ease); }
.feature:hover .cover-hover, .feature:focus-within .cover-hover { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .cover-hover { transition: none; } }
/* Follows the active theme rather than a hardcoded black, so the logo panel
   stays warm-light in light mode and dark in dark mode. */
.feature-media--logo { background: var(--bg-tint); }
/* Sized as a small centred mark rather than filling the panel. max-width caps
   it so it stays small on wide panels instead of scaling with the container. */
.cover-logo { position: absolute; inset: 0; margin: auto; width: auto; height: auto; max-width: min(38%, 175px); max-height: 68%; object-fit: contain; padding: 0; }

.expand-btn {
  position: absolute; top: 16px; right: 16px; z-index: 3;
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%;
  background: color-mix(in srgb, var(--card) 68%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--line); color: var(--ink);
  transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease);
}
.expand-btn:hover { transform: scale(1.09); background: var(--card); border-color: var(--ink); }
.expand-btn:active { transform: scale(.97); }

/* Animated "wall of work" */
.feature-media .wall { position: absolute; inset: 0; z-index: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px; overflow: hidden; background: var(--wall-bg, var(--bg-tint)); }
.wall-col { display: flex; flex-direction: column; gap: 14px; }
.wall-col img { width: 100%; display: block; border-radius: 12px; box-shadow: 0 10px 22px -14px rgba(0,0,0,.45); }
@keyframes wallUp { from { transform: translate3d(0,0,0); } to { transform: translate3d(0,-50%,0); } }
.feature.in-view .wall-col { animation: wallUp var(--wall-dur, 36s) linear infinite; will-change: transform; }
.feature.in-view .wall-col:nth-child(2) { animation-duration: var(--wall-dur2, 27s); }
.cover-fade { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: contain; background: var(--wall-bg, var(--bg-tint)); pointer-events: none; transition: opacity 1.1s var(--ease); }
.feature.wall-revealed .cover-fade { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .feature .wall-col { animation: none !important; }
  .cover-fade { transition: none; }
}

/* ---------- Keyboard focus (accessibility) ---------- */
:where(a, button, input, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
/* Tabbing to a whole preview card shows a ring around the card, not just the inline title link */
.feature:focus-within { outline: 2px solid var(--accent); outline-offset: 4px; }
.feature:focus-within .feature-link:focus-visible { outline: none; }
/* Frosted controls degrade to solid where transparency is reduced */
@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--bg); }
  .expand-btn { background: var(--card); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- Theme toggle button ---------- */
.theme-toggle { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; transition: border-color .2s var(--ease), transform .2s var(--ease); }
.theme-toggle:hover { border-color: var(--ink); transform: translateY(-1px); }
.theme-toggle svg { width: 18px; height: 18px; }

/* ---------- Dark mode ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15150F; --bg-tint: #201E16; --card: #1C1B14;
    --ink: #ECEAE0; --muted: #A8A493; --muted-2: #928E7E;
    --line: #2F2D22; --line-soft: #26241B;
    --accent: #6DB690; --accent-ink: #8CC8A8;
    --dark: #1A1912; --dark-2: #201E16; --on-dark: #ECEAE0; --on-dark-mut: #9A9788;
    --cover-grid: #6DB690;
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .feature--spotify .feature-media { --wall-bg: #1E2A22 !important; }
}
:root[data-theme="dark"] {
  --bg: #15150F; --bg-tint: #201E16; --card: #1C1B14;
  --ink: #ECEAE0; --muted: #A8A493; --muted-2: #928E7E;
  --line: #2F2D22; --line-soft: #26241B;
  --accent: #6DB690; --accent-ink: #8CC8A8;
  --dark: #1A1912; --dark-2: #201E16; --on-dark: #ECEAE0; --on-dark-mut: #9A9788;
  --cover-grid: #6DB690;
  color-scheme: dark;
}
:root[data-theme="dark"] .feature--spotify .feature-media { --wall-bg: #1E2A22 !important; }

/* ---------- Cross-document page transitions (progressive enhancement) ---------- */
@view-transition { navigation: auto; }
