/* ---------------------------------------------
   Vic Costik Portfolio — recreated local build
   --------------------------------------------- */

:root {
  --background: #ffffff;
  --foreground: #262626;
  --muted: #f5f5f5;
  --muted-foreground: #666666;
  --border: #e5e5e5;

  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --primary-foreground: #ffffff;

  --secondary: #333333;
  --secondary-foreground: #ffffff;

  --radius: 2rem;
  --radius-sm: 1rem;

  --max-width: 1280px;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;

  /* Spacing scale: consistent vertical rhythm across sections */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --space-7: 96px;

  --text-secondary: var(--muted-foreground);
}

/* Password gate */
.password-gate {
  display: none;
  min-height: 60vh;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}
.password-gate-box {
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.password-gate-label {
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 0 20px;
  color: var(--foreground);
}
.password-gate-box form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.password-gate-box input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 1rem;
}
.password-gate-box input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
}
.password-gate-error {
  color: #dc2626;
  font-size: 0.9rem;
  margin: 12px 0 0;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

/* height:auto is the default fix for width/height attributes (added for
   CLS prevention) otherwise being read as literal pixel sizes instead of
   an aspect-ratio hint once an author width is set. */
img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

p { line-height: 1.6; color: var(--muted-foreground); margin: 0; }

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

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  font-weight: 500;
  font-size: 1rem;
}

.main-nav a:hover { color: var(--primary); }

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--muted);
}

.icon-link:hover { background: var(--primary); color: #fff; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  width: 100%;
  height: 2px;
  background: var(--foreground);
  border-radius: 2px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 48px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.875rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover { background: rgba(124, 58, 237, 0.9); }

.btn-dark {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.btn-dark:hover { background: #000; }

.btn-outline-light {
  background: #fff;
  color: var(--foreground);
  border-color: var(--border);
}

.btn-outline-light:hover { background: var(--muted); }

/* Hero-scale buttons: bigger padding/type than the standard pill button */
.btn-hero {
  height: auto;
  padding: 24px 48px;
  font-size: 1.125rem;
  font-weight: 600;
}

/* Ghost button used for "View Project" on portfolio cards */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.875rem;
  background: transparent;
  color: var(--foreground);
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-ghost:hover {
  background: var(--primary);
  color: var(--primary-foreground);
  transform: none;
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: var(--space-6);
  min-height: calc(100vh - 73px);
  padding: var(--space-5) var(--space-3);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  background: var(--muted);
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  align-self: flex-start;
}

.badge:hover { color: var(--primary); }

.hero h1 {
  font-size: clamp(2.75rem, 5.6vw, 4.5rem);
  line-height: 1;
}

.accent { color: var(--primary); }

.hero-lede {
  font-size: 1.25rem;
  line-height: 1.4;
  max-width: 42rem;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-art img {
  border-radius: 24px;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ---------- Section heading ---------- */

.section-heading {
  text-align: center;
  max-width: 42rem;
  margin: 0 auto clamp(var(--space-4), 6vw, var(--space-6));
}

.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.section-heading p {
  font-size: 1.25rem;
  line-height: 1.4;
}

/* ---------- Impact / stats ---------- */

.impact {
  background: var(--secondary);
  color: var(--secondary-foreground);
  padding: var(--space-6) var(--space-3);
}

.impact .section-heading h2 { color: #fff; }

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

.stat-card {
  padding: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.4);
}

.stat-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin: 0 auto 16px;
  background: rgba(124, 58, 237, 0.2);
  color: var(--primary);
}

.stat-icon svg { width: 32px; height: 32px; }

.stat-card h3 {
  font-size: 1.5rem;
  line-height: 2rem;
  color: #fff;
  margin-bottom: 8px;
}

.stat-card p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
}

/* ---------- Portfolio ---------- */

.portfolio { padding: var(--space-4) var(--space-3) var(--space-7); }

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.project-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--muted);
  display: flex;
  flex-direction: column;
  min-height: 320px;
  transition: transform 0.2s ease, box-shadow 0.4s ease;
}

.project-card-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--muted);
  display: block;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

/* Framed thumbnails: a consistent "screen" treatment for project
   images that aren't pre-rendered device mockups (a UI screenshot or
   a diagram), so every card reads at a similar visual weight. */
div.project-card-thumb.thumb-frame {
  overflow: hidden;
  border: 1px solid var(--border);
  border-bottom: none;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.thumb-frame-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.thumb-frame-bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.thumb-frame img {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: top;
  display: block;
}

.thumb-frame.thumb-frame-doc {
  padding: 20px;
}

.thumb-frame-doc img {
  object-fit: contain;
  border-radius: 6px;
}

.project-card-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-grow: 1;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.btn-arrow {
  display: inline-flex;
  margin-left: 4px;
  transition: transform 0.3s ease;
}

.btn-ghost:hover .btn-arrow { transform: translateX(4px); }

.tag {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
}

.project-card h3 {
  font-size: 1.5rem;
  line-height: 2rem;
}

.project-card p {
  font-size: 1rem;
  color: var(--muted-foreground);
  flex-grow: 1;
}

.project-card .btn { margin-top: 16px; align-self: flex-start; }

/* ---------- CTA ---------- */

.cta {
  background: var(--muted);
  padding: var(--space-7) var(--space-3);
  text-align: center;
}

.cta h2 {
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  margin-bottom: var(--space-2);
}

.cta p {
  color: var(--muted-foreground);
  max-width: 560px;
  margin: 0 auto var(--space-5);
  font-size: 1.05rem;
}

.cta-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: var(--space-4) var(--space-3);
  text-align: center;
  border-top: 1px solid var(--border);
}

.site-footer p {
  font-size: 0.88rem;
  margin: 4px 0;
}

.footer-sub { color: #999; }

/* ---------- Scroll reveal ---------- */

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered entrance: apply to a grid/list wrapper so children cascade in */
.stagger > *:nth-child(1) { transition-delay: 0ms; }
.stagger > *:nth-child(2) { transition-delay: 80ms; }
.stagger > *:nth-child(3) { transition-delay: 160ms; }
.stagger > *:nth-child(4) { transition-delay: 240ms; }
.stagger > *:nth-child(5) { transition-delay: 320ms; }
.stagger > *:nth-child(6) { transition-delay: 400ms; }
.stagger > *:nth-child(7) { transition-delay: 480ms; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 56px;
  }

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

@media (max-width: 640px) {
  .main-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 24px;
    display: none;
  }

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

  .nav-toggle { display: flex; }

  .stats-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   Case study pages (/projects/*)
   ========================================================= */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted-foreground);
  margin: 40px 0 32px;
}

.back-link-bottom {
  margin: 0 0 64px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.back-link:hover { color: var(--primary); }

.back-arrow {
  display: inline-flex;
  transition: transform 0.3s ease;
}

.back-link:hover .back-arrow { transform: translateX(-4px); }

.case-study-header {
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-5);
}

.case-study-header h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  margin-bottom: 20px;
  max-width: 800px;
}

.case-study-header .lede {
  font-size: 1.15rem;
  max-width: 720px;
  margin-bottom: 32px;
}

.callout {
  background: var(--muted);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 28px 32px;
  max-width: 780px;
}

.callout .callout-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
  display: block;
}

.callout p { color: var(--foreground); font-size: 1.05rem; }

.case-study-section {
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--border);
}

.case-study-section:last-of-type { border-bottom: none; }

.case-study-section h2 {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  margin-bottom: 28px;
}

.case-study-section > .lede {
  font-size: 1.05rem;
  max-width: 720px;
  margin-bottom: 28px;
}

.case-study-figure {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  box-shadow: 0 24px 48px -32px rgba(0, 0, 0, 0.25);
  transition: box-shadow 0.4s ease;
}

.case-study-figure:hover {
  box-shadow: 0 32px 64px -28px rgba(0, 0, 0, 0.32);
}

.case-study-figure img {
  width: 100%;
  height: auto;
  cursor: zoom-in;
  transition: transform 0.5s ease;
}

.case-study-figure:hover img { transform: scale(1.025); }

/* ---------- Lightbox ---------- */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: rgba(15, 15, 20, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox-overlay.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-sm);
  box-shadow: 0 32px 64px -20px rgba(0, 0, 0, 0.6);
  cursor: zoom-out;
  transform: scale(0.96);
  transition: transform 0.25s ease;
}

.lightbox-overlay.open img { transform: scale(1); }

.lightbox-close {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1001;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.2); }

.figure-caption {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  text-align: center;
  margin-bottom: 40px;
}

.figure-pending {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 40px 32px;
  text-align: center;
  color: var(--muted-foreground);
  background: var(--muted);
  margin-bottom: 16px;
  font-size: 0.92rem;
}

.figure-pending strong {
  display: block;
  color: var(--foreground);
  font-size: 1rem;
  margin-bottom: 6px;
}

.outcome-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.outcome-chip {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  font-weight: 600;
  font-size: 0.98rem;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.outcome-chip:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 16px 32px -20px rgba(124, 58, 237, 0.35);
}

.outcome-chip.with-body {
  font-weight: 700;
}

.outcome-chip p {
  font-weight: 400;
  font-size: 0.9rem;
  margin-top: 8px;
  color: var(--muted-foreground);
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.problem-card {
  padding-left: 16px;
  border-left: 3px solid transparent;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.problem-card:hover {
  border-left-color: var(--primary);
  transform: translateX(4px);
}

.problem-card h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.problem-card p { font-size: 0.95rem; }

.process-list {
  counter-reset: process;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.process-list li {
  counter-increment: process;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  font-size: 1.02rem;
}

.process-list li::before {
  content: counter(process);
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.process-note {
  font-style: italic;
  color: var(--muted-foreground);
  margin-bottom: 20px;
}

.feature-block {
  margin-bottom: var(--space-5);
}

.feature-block:last-child { margin-bottom: 0; }

.feature-block h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.feature-block p {
  max-width: 720px;
  margin-bottom: 20px;
}

.feature-subitem {
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 4px;
}

.reflection-block {
  max-width: 780px;
}

.reflection-block p { margin-bottom: 16px; font-size: 1.02rem; }
.reflection-block p:last-child { margin-bottom: 0; }

@media (max-width: 900px) {
  .outcome-grid { grid-template-columns: 1fr 1fr; }
  .problem-grid { grid-template-columns: 1fr; }
}

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

/* =========================================================
   About page
   ========================================================= */

.about-hero {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-6) 0 var(--space-5);
}

.about-photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.25);
}

.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

.eyebrow {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
  margin-bottom: 16px;
}

.about-hero h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
}

.about-subtext {
  margin-top: var(--space-1);
  color: var(--text-secondary);
}

.text-link {
  color: var(--primary);
  text-decoration: underline;
}

.about-body {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-6);
  padding-bottom: var(--space-6);
}

.about-body p {
  font-size: 1.05rem;
  margin-bottom: 18px;
  max-width: 640px;
}

.about-body .eyebrow { margin-top: 44px; }
.about-body .eyebrow:first-child { margin-top: 0; }

.about-sidebar {
  border-left: 1px solid var(--border);
  padding-left: 48px;
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.about-sidebar h2 {
  font-size: 1.15rem;
  margin-bottom: 20px;
}

.edu-item + .edu-item { margin-top: 20px; }

.edu-item .degree { font-weight: 700; font-size: 1rem; }
.edu-item .school { color: var(--muted-foreground); font-style: italic; font-size: 0.92rem; }

.experience-logos {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.experience-logos img {
  max-height: 44px;
  width: auto;
  object-fit: contain;
  opacity: 0.8;
  filter: grayscale(40%);
  transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
}

.experience-logos img:hover {
  opacity: 1;
  filter: grayscale(0%);
  transform: scale(1.04);
}

@media (max-width: 800px) {
  .about-hero { grid-template-columns: 1fr; text-align: center; }
  .about-photo { max-width: 240px; margin: 0 auto; }
  .about-body { grid-template-columns: 1fr; gap: 40px; }
  .about-sidebar { border-left: none; border-top: 1px solid var(--border); padding-left: 0; padding-top: 40px; }
}
