/* ============================================================
   Narcis Catrinescu — Portfolio
   Shared stylesheet for all pages
   ============================================================ */

:root {
  --bg: #fafaf9;
  --ink: #0a0a0a;
  --ink-2: #404040;
  --ink-3: #737373;
  --ink-4: #a3a3a3;
  --rule: #e7e5e4;
  --rule-soft: #f0efed;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter Tight', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-weight: 400;
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > footer { margin-top: auto; }
::selection { background: var(--ink); color: var(--bg); }
img { max-width: 100%; display: block; }
a { color: inherit; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.container-narrow { max-width: 800px; margin: 0 auto; padding: 0 32px; }

/* === NAV === */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background: rgba(250, 250, 249, 0.72);
  transition: border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
nav.scrolled { border-bottom-color: var(--rule); }
nav .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
nav .mark {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
nav .mark span { color: var(--ink-3); font-weight: 400; }
nav ul { list-style: none; display: flex; gap: 28px; align-items: center; }
nav ul a {
  text-decoration: none;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 400;
  transition: color 0.2s ease;
  position: relative;
}
nav ul a:hover { color: var(--ink); }
nav ul a.active { color: var(--ink); }
nav ul a.active::after {
  content: '';
  position: absolute;
  bottom: -6px; left: 0; right: 0;
  height: 1px;
  background: var(--ink);
}
@media (max-width: 600px) {
  nav .mark span { display: none; }
  nav ul { gap: 20px; }
}

/* === HERO === */
.hero { padding: 180px 0 140px; }
.hero-page { padding: 160px 0 80px; }
.availability {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 48px;
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  position: relative;
}
.dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: #22c55e;
  opacity: 0.25;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.25; }
  50% { transform: scale(1.4); opacity: 0; }
}
.hero h1 {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 32px;
  max-width: 880px;
}
.hero h1 .muted { color: var(--ink-3); }
.hero-bio {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 580px;
  margin-bottom: 48px;
}
.hero-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* === BUTTONS === */
.btn {
  text-decoration: none;
  font-size: 14px;
  padding: 11px 18px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  line-height: 1;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--ink-2); }
.btn-secondary { color: var(--ink-2); }
.btn-secondary:hover { color: var(--ink); }
.btn-outline { border: 1px solid var(--rule); color: var(--ink); background: transparent; }
.btn-outline:hover { border-color: var(--ink); }
.btn .arrow { transition: transform 0.2s ease; font-size: 12px; }
.btn:hover .arrow { transform: translate(2px, -2px); }

/* === SECTION LABEL === */
.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 60px;
  font-family: 'JetBrains Mono', monospace;
}
.section-label .num { font-variant-numeric: tabular-nums; }
.section-label .line { flex: 1; height: 1px; background: var(--rule); }

/* === WORK LIST === */
.work { padding: 80px 0; }
.project {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 64px;
  padding: 40px 0;
  border-bottom: 1px solid var(--rule);
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.project:first-of-type { border-top: 1px solid var(--rule); }
.project .info { padding: 16px 0; }
.project .info .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-4);
  margin-bottom: 24px;
  display: block;
}
.project .info h3 {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  transition: color 0.2s ease;
}
.project:hover .info h3 { color: var(--ink-2); }
.project .desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-3);
  margin-bottom: 24px;
  max-width: 440px;
}
.project .meta {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.project .meta span { display: inline-flex; align-items: center; gap: 6px; }
.project .meta span::before {
  content: '';
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--ink-4);
}
.project .meta span:first-child::before { display: none; }
.project .visual {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--rule-soft);
  position: relative;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.project:hover .visual { transform: translateY(-4px); }
.visual-1 {
  background: var(--rule-soft);
  display: flex; align-items: center; justify-content: center;
}
.visual-1::before {
  content: '';
  width: 50%; aspect-ratio: 1;
  border: 1px solid var(--ink-4);
  border-radius: 50%;
}
.visual-1::after {
  content: '';
  position: absolute;
  width: 50%; aspect-ratio: 1;
  background: var(--ink);
  border-radius: 50%;
  transform: translate(20%, 0);
  mix-blend-mode: difference;
}
.visual-2 {
  background: var(--ink);
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 32px 32px;
}
.visual-2::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 40%; height: 40%;
  border: 1px solid rgba(255,255,255,0.5);
}
.visual-3 { background: var(--rule-soft); overflow: hidden; }
.visual-3::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg, transparent 0, transparent 12px,
    var(--ink-4) 12px, var(--ink-4) 13px
  );
  opacity: 0.25;
}
.visual-3::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 65%; height: 60%;
  background: var(--ink);
}
@media (max-width: 768px) {
  .project { grid-template-columns: 1fr; gap: 24px; padding: 32px 0; }
  .project .visual { order: -1; }
}

/* === LOCKED PROJECTS (portfolio in progress) === */
.project-locked {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 64px;
  align-items: center;
}
.project-locked:hover .info h3 { color: inherit; }
.project-locked .info { max-width: 640px; }
.project-locked .desc { max-width: 560px; }
.lock-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
}
.lock-tag::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-4);
}
@media (max-width: 768px) {
  .project-locked { grid-template-columns: 1fr; gap: 16px; }
  .lock-tag { align-self: flex-start; }
}

.portfolio-notice {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  padding: 28px 32px;
  margin-bottom: 16px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--rule-soft);
}
.portfolio-notice .notice-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 8px;
  display: block;
}
.portfolio-notice h4 {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  color: var(--ink);
}
.portfolio-notice p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-3);
  max-width: 560px;
}
@media (max-width: 768px) {
  .portfolio-notice { grid-template-columns: 1fr; padding: 24px; gap: 20px; }
}

/* === ABOUT === */
.about { padding: 120px 0 80px; }
.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 80px;
  align-items: start;
}
.about-grid h2 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.about-text p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
  margin-bottom: 20px;
  max-width: 620px;
}
.about-text p:last-of-type { margin-bottom: 0; }
.about-text strong { color: var(--ink); font-weight: 500; }

.timeline { margin-top: 64px; }
.timeline-row {
  display: grid;
  grid-template-columns: 140px 1fr 1fr;
  gap: 32px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.timeline-row:first-child { border-top: 1px solid var(--rule); }
.timeline-row .year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.timeline-row .role { font-size: 15px; font-weight: 500; color: var(--ink); }
.timeline-row .place { font-size: 14px; color: var(--ink-3); text-align: right; }
@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .timeline-row { grid-template-columns: 100px 1fr; gap: 16px; }
  .timeline-row .place { grid-column: 2; text-align: left; font-size: 13px; }
}

/* === SKILLS === */
.skills { padding: 80px 0 120px; }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 48px;
}
.skill-col h4 {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.skill-col ul { list-style: none; }
.skill-col li {
  font-size: 15px;
  color: var(--ink-2);
  padding: 6px 0;
  line-height: 1.4;
}
@media (max-width: 900px) { .skills-grid { grid-template-columns: repeat(2, 1fr); gap: 40px; } }
@media (max-width: 520px) { .skills-grid { grid-template-columns: 1fr; gap: 32px; } }

/* === CONTACT === */
.contact { padding: 140px 0 100px; border-top: 1px solid var(--rule); }
.contact-page { padding: 160px 0 100px; border-top: none; }
.contact h2 {
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: 48px;
  max-width: 880px;
}
.contact h2 .muted { color: var(--ink-3); }
.contact-email {
  font-size: clamp(20px, 2.4vw, 28px);
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 4px;
  transition: opacity 0.2s ease;
  display: inline-block;
  letter-spacing: -0.02em;
}
.contact-email:hover { opacity: 0.6; }
.contact-grid {
  margin-top: 96px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}
.contact-col h5 {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.contact-col a, .contact-col p {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  line-height: 1.7;
  display: block;
  transition: color 0.2s ease;
}
.contact-col a:hover { color: var(--ink-3); }
.contact-page-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 80px;
  margin-top: 80px;
  padding-top: 48px;
  border-top: 1px solid var(--rule);
}
.contact-page-grid .col h5 {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.contact-page-grid .info-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 15px;
  border-bottom: 1px solid var(--rule-soft);
}
.contact-page-grid .info-row:last-child { border-bottom: none; }
.contact-page-grid .key { color: var(--ink-3); }
.contact-page-grid .val { color: var(--ink); }
.contact-page-grid .val a { color: var(--ink); text-decoration: none; transition: color 0.2s; }
.contact-page-grid .val a:hover { color: var(--ink-3); }
@media (max-width: 768px) {
  .contact-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .contact-page-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ============================================================
   CASE STUDY PAGES
   ============================================================ */

.case-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--ink-3);
  text-decoration: none;
  transition: color 0.2s ease;
  margin-bottom: 60px;
}
.case-back:hover { color: var(--ink); }
.case-back .arrow-back { transition: transform 0.2s ease; }
.case-back:hover .arrow-back { transform: translateX(-2px); }

.case-top { padding: 140px 0 60px; }
.case-facts-top {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 48px;
  padding: 48px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 64px;
}
.case-fact-block .label {
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 10px;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.case-fact-block .val {
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
  letter-spacing: -0.01em;
}
@media (max-width: 768px) {
  .case-facts-top { grid-template-columns: 1fr; gap: 24px; padding: 32px 0; }
}

.case-title {
  font-size: clamp(32px, 4.6vw, 56px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 60px;
  max-width: 1000px;
}
.case-title .muted { color: var(--ink-3); }

.case-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  padding: 60px 0;
  border-top: 1px solid var(--rule);
  margin-bottom: 80px;
}
.case-intro h3 {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 20px;
}
.case-intro p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
  margin-bottom: 16px;
}
.case-intro p:last-child { margin-bottom: 0; }
.case-intro a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 3px; }
.case-intro a:hover { text-decoration-color: var(--ink); }
@media (max-width: 768px) {
  .case-intro { grid-template-columns: 1fr; gap: 32px; padding: 32px 0; }
}

.case-cover {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 80px;
  position: relative;
  background: var(--rule-soft);
}

/* Phase = Discover/Define/Develop/Deliver block */
.phase {
  padding: 80px 0;
  border-top: 1px solid var(--rule);
}
.phase-header {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 64px;
  margin-bottom: 48px;
  align-items: baseline;
}
.phase-header .phase-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.phase-header .phase-tag .step {
  display: block;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.phase-header .phase-tag .name {
  display: block;
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0.12em;
}
.phase-header h2 {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.phase-header h2 em { font-style: normal; color: var(--ink-3); }

.phase-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 64px;
  align-items: start;
}
.phase-body-text { max-width: 720px; }
.phase-body-text > * + * { margin-top: 18px; }
.phase-body-text p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
}
.phase-body-text strong { color: var(--ink); font-weight: 500; }
.phase-body-text em { color: var(--ink); font-style: italic; }
.phase-body-text h4 {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  margin-top: 32px;
  margin-bottom: 12px;
}
.phase-body-text ul {
  list-style: none;
  margin-top: 16px;
}
.phase-body-text ul li {
  padding: 12px 0 12px 28px;
  border-bottom: 1px solid var(--rule);
  font-size: 16px;
  color: var(--ink-2);
  line-height: 1.55;
  position: relative;
}
.phase-body-text ul li:last-child { border-bottom: none; }
.phase-body-text ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 22px;
  width: 16px; height: 1px;
  background: var(--ink-4);
}
.phase-body-text ol {
  list-style: none;
  counter-reset: phase-list;
  margin-top: 16px;
}
.phase-body-text ol li {
  counter-increment: phase-list;
  padding: 14px 0 14px 40px;
  border-bottom: 1px solid var(--rule);
  font-size: 16px;
  color: var(--ink-2);
  line-height: 1.55;
  position: relative;
}
.phase-body-text ol li:last-child { border-bottom: none; }
.phase-body-text ol li::before {
  content: counter(phase-list, decimal-leading-zero);
  position: absolute;
  left: 0; top: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-4);
}

@media (max-width: 768px) {
  .phase-header { grid-template-columns: 1fr; gap: 16px; }
  .phase-body { grid-template-columns: 1fr; gap: 24px; }
}

.phase-images {
  display: grid;
  gap: 24px;
  margin: 48px 0;
}
.phase-images.cols-2 { grid-template-columns: 1fr 1fr; }
.phase-images.cols-3 { grid-template-columns: repeat(3, 1fr); }
.phase-images.cols-1 { grid-template-columns: 1fr; }
@media (max-width: 768px) {
  .phase-images.cols-3, .phase-images.cols-2 { grid-template-columns: 1fr; }
}

.phase-image {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--rule-soft);
  position: relative;
  transition: transform 0.4s ease;
}
.phase-image-tall { aspect-ratio: 3 / 4; }
.phase-image-wide { aspect-ratio: 16 / 9; }
.phase-image .caption {
  position: absolute;
  bottom: 12px;
  left: 16px;
  right: 16px;
  font-size: 11px;
  color: var(--ink-3);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.phase-image-dark { background: var(--ink); }
.phase-image-dark .caption { color: var(--ink-4); }

.fill-grid {
  background-image:
    linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px);
  background-size: 24px 24px;
}
.fill-grid-dark {
  background-color: var(--ink) !important;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 24px 24px;
}
.fill-circles::after {
  content: '';
  position: absolute;
  inset: 20% 25%;
  border: 1px solid var(--ink-4);
  border-radius: 50%;
}
.fill-circles::before {
  content: '';
  position: absolute;
  top: 20%; right: 15%;
  width: 35%; aspect-ratio: 1;
  background: var(--ink);
  border-radius: 50%;
  mix-blend-mode: difference;
}
.fill-bars::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg, transparent 0, transparent 14px,
    var(--ink-4) 14px, var(--ink-4) 15px
  );
  opacity: 0.3;
}
.fill-bars::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 60%; height: 50%;
  background: var(--ink);
}
.fill-frame::after {
  content: '';
  position: absolute;
  inset: 16%;
  border: 1px solid var(--ink-3);
}
.fill-rect-stack::before {
  content: '';
  position: absolute;
  top: 20%; left: 15%; right: 35%; bottom: 35%;
  background: var(--ink-3);
  opacity: 0.2;
}
.fill-rect-stack::after {
  content: '';
  position: absolute;
  top: 35%; left: 30%; right: 15%; bottom: 20%;
  background: var(--ink);
}
.fill-rows::before {
  content: '';
  position: absolute;
  inset: 16% 14%;
  background: repeating-linear-gradient(
    180deg, var(--ink-4) 0, var(--ink-4) 1px,
    transparent 1px, transparent 14px
  );
  opacity: 0.4;
}
.fill-rows::after {
  content: '';
  position: absolute;
  top: 16%; left: 14%;
  width: 40%; height: 8%;
  background: var(--ink);
}
.fill-mockup::before {
  content: '';
  position: absolute;
  top: 12%; bottom: 12%; left: 50%;
  transform: translateX(-50%);
  width: 32%;
  border: 1px solid var(--ink-4);
  border-radius: 18px;
  background: var(--bg);
}
.fill-mockup::after {
  content: '';
  position: absolute;
  top: 24%; left: 50%;
  transform: translateX(-50%);
  width: 18%; height: 5%;
  background: var(--ink);
  border-radius: 4px;
}

/* Real cover image on a .visual or .case-cover tile.
   Add .has-image alongside the tile and set --cover to the image URL.
   Selectors are doubled (.has-image.has-image) to win specificity over
   .project .visual and .case-cover, which both set a background color. */
.has-image.has-image::before,
.has-image.has-image::after { content: none !important; }
.has-image.has-image {
  background-color: var(--rule-soft);
  background-image: var(--cover);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* === DIMENSION BADGE ===
   Any placeholder with data-dimensions="WxH" shows a centred label
   indicating the rendered size and the recommended 2x export size.
   Auto-suppressed when .has-image is also present. */
.visual[data-dimensions],
.case-cover[data-dimensions],
.phase-image[data-dimensions] {
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: none;
  background-color: var(--rule-soft);
}
.visual[data-dimensions]::after,
.case-cover[data-dimensions]::after,
.phase-image[data-dimensions]::after {
  /* Override any inherited ::after pattern from .visual-* / .fill-* */
  content: attr(data-dimensions);
  position: relative;
  top: auto; left: auto; right: auto; bottom: auto;
  transform: none;
  width: auto; height: auto;
  background: var(--bg);
  color: var(--ink-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  z-index: 2;
  mix-blend-mode: normal;
  opacity: 1;
  margin: 0;
}
/* Hide the original generated decoration so the badge sits on a clean field */
.visual[data-dimensions]::before,
.case-cover[data-dimensions]::before,
.phase-image[data-dimensions]::before { content: none; }

/* When a real image is provided, hide the badge entirely */
.has-image.has-image[data-dimensions]::before,
.has-image.has-image[data-dimensions]::after { content: none !important; }

/* Stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  max-width: 720px;
}
.stat-grid .stat-num {
  font-size: clamp(36px, 4.5vw, 56px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.stat-grid .stat-label {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.4;
}

/* Scenario block */
.scenario {
  padding: 32px;
  border-radius: 6px;
  background: var(--rule-soft);
  margin: 32px 0;
  max-width: 720px;
}
.scenario .scenario-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.scenario p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  margin-bottom: 12px;
}
.scenario p:last-child { margin-bottom: 0; }
.scenario .task {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 16px;
  color: var(--ink);
}

/* Next project */
.next-project {
  padding: 100px 0;
  border-top: 1px solid var(--rule);
  background: var(--bg);
}
.next-project .label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.next-project a {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: opacity 0.2s ease;
}
.next-project a:hover { opacity: 0.7; }
.next-project h3 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 16px;
}
.next-project .next-meta { font-size: 14px; color: var(--ink-3); }

/* === FOOTER === */
footer {
  padding: 28px 0;
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
  font-size: 13px;
}
footer .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* === PORTRAIT === */
/* Hero — small avatar next to the availability pill */
.hero-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}
.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--rule-soft);
}
.avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-meta-row .availability { margin-bottom: 0; }

/* About page — large portrait taking the left column */
.about-grid:has(.about-portrait) {
  grid-template-columns: 360px 1fr;
}
.about-portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  overflow: hidden;
  background: var(--rule-soft);
  position: relative;
}
.about-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.about-portrait .portrait-meta {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  display: flex;
  justify-content: space-between;
}

@media (max-width: 768px) {
  .about-grid:has(.about-portrait) { grid-template-columns: 1fr; }
  .about-portrait { aspect-ratio: 1 / 1; max-width: 320px; }
}

/* === REVEAL === */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.in { opacity: 1; transform: translateY(0); }
