/* ─────────────────────────────────────────────────────────────────────────
   Max Minchin Portfolio - styles.css
   ───────────────────────────────────────────────────────────────────────── */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --font:           'Inter', system-ui, sans-serif;

  --bg:             #f5f4f1;        /* warm off-white page background      */
  --surface:        #ececec;
  --text:           #1a1a1a;
  --text-muted:     #555555;
  --text-light:     #ffffff;

  /* Project card backgrounds */
  --card-mint:      #c6edda;
  --card-lavender:  #e0d8f7;
  --card-dark:      #D1EAFA;
  --card-sage:      #cde8cd;

  /* Process cards */
  --card-process:   #daeaf8;

  /* Skills */
  --skill-bg:       #3a5a7c;
  --skill-text:     #ffffff;

  --radius-card:    18px;
  --radius-btn:     100px;
  --radius-tag:     100px;

  --max-w:          1100px;
  --nav-h:          60px;

  --shadow-card:    0 2px 16px rgba(0,0,0,0.07);
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

a { text-decoration: none; color: inherit; }

/* ── Layout helper ───────────────────────────────────────────────────────── */
.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

/* ── Navigation ──────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(236, 236, 236, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  height: var(--nav-h);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.nav-logo-img {
  height: 56px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.nav-link--active { color: var(--text); }

.nav-linkedin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: #0077b5;
  color: white !important;
  border-radius: 6px;
  transition: opacity 0.2s;
}

.nav-linkedin:hover { opacity: 0.8; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  padding: 80px 0 64px;
  text-align: center;
  background: #ececec;
}

.hero-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* gradient blob behind photo */
.hero-photo-wrap {
  position: relative;
  width: 122px;
  height: 122px;
  margin-bottom: 20px;
}

.hero-blob {
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(168, 130, 255, 0.35) 0%,
    rgba(200, 160, 255, 0.2) 35%,
    rgba(220, 190, 255, 0.08) 60%,
    transparent 75%
  );
  filter: blur(20px);
  pointer-events: none;
}

.hero-photo {
  width: 122px;
  height: 122px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 1;
  /* placeholder style when image is missing */
  background: #d8cce8;
}

/* availability badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ececec;
  border: 1px solid #d8d8d8;
  border-radius: var(--radius-tag);
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 22px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ecf74;
  flex-shrink: 0;
  animation: badge-pulse 3s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.15; }
}

/* name */
.hero-name {
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.hero-name-bold { font-weight: 400; }

/* role */
.hero-role {
  font-size: 1.65rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 20px;
  display: block;
  transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
}

/* bio */
.hero-bio {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.7;
  margin-bottom: 0;
}

/* ── Tools marquee ───────────────────────────────────────────────────────── */
.tools-marquee {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  overflow: hidden;
  padding: 32px 0;
  mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
}

.tools-track {
  display: flex;
  gap: 16px;
  width: max-content;
  animation: marquee 28s linear infinite;
}

@media (hover: hover) {
  .tools-track:hover { animation-play-state: paused; }
}
@media (hover: none) {
  .tools-marquee { pointer-events: none; }
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(var(--marquee-offset, -640px)); }
}

/* individual icon tiles */
.tool-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  cursor: default;
}

.tool-figma   { background: #ffffff; border: 1px solid #d4d4d4; padding: 6px; }
.tool-figma img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tool-framer  { background: #0055ff; }
.tool-ae      { background: #9966ff; }
.tool-pr      { background: #7c4dff; }
.tool-sketch  { background: #f7ab1b; }
.tool-behance { background: #1769ff; font-size: 0.58rem; }
.tool-ps      { background: #31a8ff; color: #1a1a1a; }
.tool-ai      { background: #ff9a00; color: #1a1a1a; }
.tool-pp      { background: #e24329; }
.tool-miro    { background: #ffd02f; color: #1a1a1a; }
.tool-inv     { background: #ff3366; }
.tool-notion  { background: #fff; border: 1px solid #d4d4d4; }
.tool-notion img { width: 55%; height: 55%; object-fit: contain; display: block; filter: opacity(0.65); }
.tool-claude  { background: transparent; padding: 0; overflow: hidden; }
.tool-claude img { width: 36px; height: 36px; border-radius: 8px; display: block; }
.tool-adobe   { background: #fff; border: 1px solid #d4d4d4; }
.tool-adobe img { width: 60%; height: 60%; object-fit: contain; display: block; }

/* ── Projects ─────────────────────────────────────────────────────────────── */
.projects {
  padding: 72px 0;
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* base card */
.project-card {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
  transform-origin: top center;
  border-radius: var(--radius-card);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 340px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.25s;
}

.project-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.13);
}

/* stacking z-index - later cards slide over earlier ones */
.project-card:nth-child(1) { z-index: 1; }
.project-card:nth-child(2) { z-index: 2; }
.project-card:nth-child(3) { z-index: 3; }
.project-card:nth-child(4) { z-index: 4; }

/* card colour variants */
.project-card--mint    { background: var(--card-mint); }
.project-card--lavender { background: var(--card-lavender); }
.project-card--dark    { background: var(--card-dark); }
.project-card--sage    { background: var(--card-sage); }

/* text pane */
.project-card-text {
  padding: 36px 36px 36px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.project-card-text--light .project-title,
.project-card-text--light .project-desc { color: var(--text-light); }

.project-card-text--light .project-desc { opacity: 0.8; }

.project-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.project-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

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

/* View Project button */
.btn-project {
  display: inline-flex;
  align-items: center;
  background: #1a1a1a;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: var(--radius-btn);
  width: fit-content;
  transition: background 0.2s, transform 0.15s;
  margin-top: 4px;
}

.btn-project:hover { background: #333; transform: scale(1.03); }

.btn-project--light {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  backdrop-filter: blur(4px);
}

.btn-project--light:hover { background: rgba(255,255,255,0.28); }

/* image / media pane */
.project-card-media {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 40px;
}

/* Horizon logo pane */
.project-card-media--logo {
  background: #ececec;
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  padding: 32px;
}

.horizon-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.horizon-icon { width: 60px; height: 60px; }

.horizon-wordmark {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #1a1a1a;
}

/* dark card image tweak */
.project-card-media--dark img { opacity: 0.9; }

/* ── Process ──────────────────────────────────────────────────────────────── */
.process {
  padding: 72px 0;
  background: #ececec;
}

.process-intro {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 680px;
  line-height: 1.75;
  margin-bottom: 36px;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.process-card {
  background: var(--card-process);
  border-radius: 14px;
  padding: 28px 30px;
  position: relative;
  overflow: hidden;
}

.process-card::after {
  content: attr(data-num);
  position: absolute;
  top: 7px;
  right: 16px;
  font-size: 3.9rem;
  font-weight: 800;
  line-height: 1;
  color: rgba(0,0,0,0.07);
  pointer-events: none;
  user-select: none;
}

.process-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.process-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Skills ───────────────────────────────────────────────────────────────── */
.skills {
  padding: 72px 0;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tag {
  background: var(--skill-bg);
  color: var(--skill-text);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 8px;
  letter-spacing: 0.01em;
}

/* ── Education ────────────────────────────────────────────────────────────── */
.education {
  padding: 0 0 80px;
}

.education-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.education-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 0;
  border-top: 1px solid rgba(0,0,0,0.08);
  gap: 24px;
}

.education-item:last-child {
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.education-degree {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}

.education-right {
  text-align: right;
  flex-shrink: 0;
}

.education-school {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.education-dates {
  font-size: 0.8rem;
  color: #888;
  margin-top: 2px;
}

/* ── Hamburger / mobile nav ───────────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

/* animate to × when open */
.nav--open .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav--open .nav-hamburger span:nth-child(2) { opacity: 0; }
.nav--open .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile {
  position: absolute;
  top: var(--nav-h);
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  background: rgba(236, 236, 236, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding: 8px 32px 16px;
  z-index: 99;
}

.nav--open .nav-mobile { display: flex; }

.nav-mobile a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 13px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: color 0.2s;
  width: 100%;
  text-align: center;
}

.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile a:hover { color: var(--text); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* ── Theme toggle ─────────────────────────────────────────────────────────── */
.theme-toggle {
  background: none;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 100px;
  height: 34px;
  padding: 0 12px 0 10px;
  gap: 6px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}
.theme-toggle:hover { color: var(--text); border-color: rgba(0,0,0,0.3); }
.icon-sun { display: none; }
.theme-label-dark { display: none; }
[data-theme="dark"] .theme-label-light { display: none; }
[data-theme="dark"] .theme-label-dark  { display: inline; }

/* ── Dark mode ────────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:            #0e0e10;
  --surface:       #1a1a1d;
  --text:          #f5f5f5;
  --text-muted:    #c0c0c0;
  --card-mint:     #12291e;
  --card-lavender: #1c1630;
  --card-dark:     #0f1e2e;
  --card-sage:     #132113;
  --card-process:  #141e28;
  --shadow-card:   0 2px 16px rgba(0,0,0,0.4);
}
[data-theme="dark"] .nav { background: rgba(14,14,16,0.9); border-bottom-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .nav-mobile { background: rgba(14,14,16,0.97); border-bottom-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .nav-mobile a { border-bottom-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .hero { background: var(--bg); }
[data-theme="dark"] .hero-badge { background: var(--surface); border-color: rgba(255,255,255,0.1); }
[data-theme="dark"] .process { background: var(--surface); }
[data-theme="dark"] .footer { background: var(--surface); border-top-color: rgba(255,255,255,0.07); }
[data-theme="dark"] .footer-bottom { border-top-color: rgba(255,255,255,0.07); }
[data-theme="dark"] .education-item { border-top-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .education-item:last-child { border-bottom-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .btn-project { background: #e8e8e8; color: #111; }
[data-theme="dark"] .btn-project:hover { background: #fff; }
[data-theme="dark"] .project-card-media--logo { background: var(--surface); }
[data-theme="dark"] .horizon-wordmark { color: var(--text); }
[data-theme="dark"] .tool-figma { background: #2a2a2d; border-color: rgba(255,255,255,0.1); }
[data-theme="dark"] .tool-adobe { background: #2a2a2d; border-color: rgba(255,255,255,0.1); }
[data-theme="dark"] .tool-notion { background: #2a2a2d; border-color: rgba(255,255,255,0.1); }
[data-theme="dark"] .tool-notion img { filter: invert(1); }
[data-theme="dark"] .about-divider { background: rgba(255,255,255,0.08); }
[data-theme="dark"] .hobby-item { border-top-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .theme-toggle { border-color: rgba(255,255,255,0.2); }
[data-theme="dark"] .theme-toggle:hover { border-color: rgba(255,255,255,0.4); }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .process-card::after { color: rgba(255,255,255,0.07); }
[data-theme="dark"] .nav-logo-img { filter: invert(1); }
[data-theme="dark"] .cs-divider { background: rgba(255,255,255,0.08); }
[data-theme="dark"] .cs-step { border-top-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .cs-step:last-child { border-bottom-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .cs-stat { background: var(--surface); border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .cs-wcag-card { background: var(--surface); border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .project-award { background: rgba(255,255,255,0.1); }
[data-theme="dark"] .project-next-arrow { background: #e8e8e8; }
[data-theme="dark"] .project-next-arrow svg { color: #111; }

/* Applied by JS only during toggle - not on page load - to avoid a flash */
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition-property:        background-color, color, border-color, box-shadow !important;
  transition-duration:        0.55s !important;
  transition-timing-function: ease !important;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  padding: 56px 0 32px;
  border-top: 1px solid rgba(0,0,0,0.07);
  background: #ececec;
}

.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 32px;
}

.footer-sitemap {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 48px;
  justify-content: start;
  margin-bottom: 48px;
}

.footer-col-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #aaa;
  margin-bottom: 14px;
}

.footer-col a {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.15s;
}

.footer-col a:last-child { margin-bottom: 0; }
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  border-top: 1px solid rgba(0,0,0,0.07);
  padding-top: 24px;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: #aaa;
}

@media (max-width: 480px) {
  .footer-sitemap {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

/* process drops to 2 columns on smaller desktops/tablets */
@media (max-width: 900px) {
  .process-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* disable sticky stacking on mobile - just stack normally */
  .project-card {
    position: relative;
    top: unset;
    grid-template-columns: 1fr;
    height: auto;
  }

  .project-card-media {
    height: 220px;
    order: -1;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
  }

  .project-card-media img {
    object-fit: contain;
    padding: 20px;
  }

  .project-card-media--logo {
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    order: -1;
    height: 160px;
  }

  .project-card-text {
    padding: 28px 28px 32px;
  }

  .process-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .education-item {
    flex-direction: column;
    gap: 6px;
  }

  .education-right {
    text-align: left;
  }

  .section-inner {
    padding: 0 20px;
  }

  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }
}

@media (max-width: 480px) {
  .hero-name { font-size: 2rem; }
  .section-title { font-size: 1.4rem; }
  .process-grid { grid-template-columns: 1fr; }
}

/* ─── Back to Top ─────────────────────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 999;
}
#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}
#back-to-top:hover {
  transform: translateY(-2px);
  opacity: 0.8;
}
