/* ─── Nav ─────────────────────────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background-color: transparent;
  border-bottom: none;
}

.nav-inner {
  max-width: calc(var(--content-width) + 2 * var(--page-padding));
  margin-inline: auto;
  padding-inline: var(--page-padding);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-name {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 18px;
  color: var(--color-text-secondary);
}

.nav-links {
  display: flex;
  gap: var(--space-xl);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 18px;
  color: var(--color-text-secondary);
}

.nav-links a {
  transition: color var(--duration-fast) var(--ease-out);
}

.nav-links a:hover {
  color: var(--color-card-hover);
}

/* ─── Hero ────────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  z-index: 1;
  height: 100svh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: var(--nav-height);
  overflow: hidden;
}

/* California 3D animation — fills space above tagline */
.california-scene {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 2100px;
  translate: 0 300px;
}

.california-rotate {
  width: min(80%, 88vh);
  height: min(80%, 88vh);
  transform-style: preserve-3d;
  animation: rotateY 20s linear infinite;
}

.california-outline {
  width: 100%;
  height: 100%;
  color: var(--color-text-secondary);
}

.sf-dot {
  animation: blink 2s ease-in-out infinite;
}

/* Location text — left side of hero */
.hero-location-text {
  position: relative;
  z-index: 2;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(14px, 1.4vw, 18px);
  color: var(--color-text-secondary);
  background-color: var(--color-bg);
  display: inline-block;
  padding-inline: 4px;
  margin-top: 48px;
}

@keyframes rotateY {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(360deg); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.2; }
}

/* Tagline overlaid at bottom of hero */
.hero-tagline {
  position: relative;
  z-index: 2;
  padding-top: 8px;
  padding-bottom: 120px;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.tagline-text {
  display: block;
}

.tagline-text p {
  font-family: var(--font-display);
  font-style: normal;
  font-size: clamp(36px, 4.7vw, 68px);
  line-height: 1.5;
  color: var(--color-text-secondary);

  /* Pill background to lift text off ASCII */
  display: inline;
  background-color: var(--color-bg);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding-inline: 4px;
}

.tagline-text em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--color-card-hover);
}

/* hero-subtitle removed — replaced by .hero-location */

/* ─── Projects section ────────────────────────────────────────────────────── */

.projects {
  padding-block: var(--space-3xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

/* ─── Card ────────────────────────────────────────────────────────────────── */

.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  cursor: pointer;
}

.card-media {
  width: 100%;
  background-color: var(--color-card-bg);
  overflow: hidden;
}

.card-media video,
.card-media img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--duration-slow) var(--ease-out);
}

.card:hover .card-media video,
.card:hover .card-media img {
  transform: scale(1.02);
}

.card:hover .card-client,
.card:hover .card-title,
.card:hover .card-link,
.card:hover .tag {
  color: var(--color-card-hover);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.card-client {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.card-title {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(18px, 1.68vw, 24px);
  color: var(--color-text-primary);
  line-height: 1.3;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.tag {
  border: 1px solid var(--color-border);
  padding: 10px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.card-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  color: var(--color-text-primary);
  width: fit-content;
  transition: gap var(--duration-fast) var(--ease-out);
}

.card-link:hover {
  gap: 14px;
}

.card-link-arrow {
  font-size: 20px;
  line-height: 1;
}

/* Cards are visible by default.
   JS adds .will-animate before observing, so opacity:0 only applies
   when the IntersectionObserver is actually running. */
.card {
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow var(--duration-base) var(--ease-out);
}

.card .card-client,
.card .card-title,
.card .card-link,
.card .tag {
  transition: color var(--duration-fast) var(--ease-out);
}

.card.will-animate {
  opacity: 0;
  transform: translateY(32px);
}

.card.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */

.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--color-border-nav);
  height: var(--nav-height);
  display: flex;
  align-items: center;
}

.footer-inner {
  max-width: calc(var(--content-width) + 2 * var(--page-padding));
  margin-inline: auto;
  padding-inline: var(--page-padding);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy,
.footer-links {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  color: var(--color-text-secondary);
}

.footer-links {
  display: flex;
  gap: var(--space-xl);
}

.footer-links a {
  transition: color var(--duration-fast) var(--ease-out);
}

.footer-links a:hover {
  color: var(--color-text-primary);
}

/* ─── Page load animation ─────────────────────────────────────────────────── */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Elements animate in via CSS — no JS class required */
.animate-in {
  animation: fadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-in:nth-child(1) { animation-delay: 0ms; }
.animate-in:nth-child(2) { animation-delay: 100ms; }
.animate-in:nth-child(3) { animation-delay: 200ms; }

/* ─── Mobile ──────────────────────────────────────────────────────────────── */

/* ─── Case Study ──────────────────────────────────────────────────────────── */

.case-study {
  padding-top: 120px;
  padding-bottom: var(--space-3xl);
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.cs-back {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  transition: color var(--duration-fast) var(--ease-out);
}

.cs-back:hover {
  color: var(--color-card-hover);
}

.cs-header {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.cs-title {
  font-family: var(--font-display);
  font-style: normal;
  font-size: clamp(28px, 3.33vw, 48px);
  line-height: 1.1;
  color: var(--color-text-primary);
}

.cs-hero {
  width: 100%;
  background-color: var(--color-card-bg);
  overflow: hidden;
}

.cs-hero img {
  width: 100%;
  height: auto;
  display: block;
}

.cs-meta {
  display: flex;
  gap: 57px;
  flex-wrap: wrap;
}

.cs-meta-item {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cs-meta-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
}

.cs-meta-value {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 18px;
  color: var(--color-text-primary);
}

/* ── Text blocks ──────────────────────────────────────────────────────────── */

.cs-text-block {
  display: flex;
  align-items: flex-start;
}

.cs-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  line-height: 2.2;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  min-width: 218px;
  flex-shrink: 0;
}

.cs-label--hidden {
  opacity: 0;
  pointer-events: none;
  user-select: none;
}

.cs-body {
  flex: 1;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text-primary);
}

.cs-body p + p {
  margin-top: 1em;
}

.cs-body strong {
  font-weight: 600;
}

/* ── Images ───────────────────────────────────────────────────────────────── */

.cs-image-row {
  display: flex;
}

.cs-image-offset {
  min-width: 218px;
  flex-shrink: 0;
}

.cs-image {
  flex: 1;
  overflow: hidden;
}

.cs-image img,
.cs-image video {
  width: 100%;
  height: auto;
  display: block;
}

.cs-image--rounded img,
.cs-image--rounded video {
  border-radius: 8px;
}

.cs-image--full {
  width: 100%;
}

.cs-image--card {
  background: #efefef;
  padding: 20px;
  border-radius: 5px;
}

/* ── Bullet lists in text blocks ──────────────────────────────────────────── */

.cs-body ul {
  list-style: disc;
  padding-left: 24px;
}

.cs-body li {
  line-height: 1.7;
}

.cs-body li + li {
  margin-top: 0.25em;
}

/* ── Callout card ────────────────────────────────────────────────────────── */

.cs-callout {
  flex: 1;
  background: var(--color-text-primary);
  color: var(--color-bg);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.cs-callout-title {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.5;
  letter-spacing: -0.02em;
}

.cs-callout-columns {
  display: flex;
  gap: 61px;
}

.cs-callout-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cs-callout-heading {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.07em;
}

.cs-callout-text {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.5;
  letter-spacing: -0.02em;
}

/* ── CTA ──────────────────────────────────────────────────────────────────── */

.cs-cta {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(18px, 1.68vw, 24px);
  color: var(--color-text-primary);
  text-align: center;
  width: 100%;
}

.cs-cta a {
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color var(--duration-fast) var(--ease-out);
}

.cs-cta a:hover {
  color: var(--color-card-hover);
}

/* ─── About page ─────────────────────────────────────────────────────────── */

.about-quote {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(18px, 1.68vw, 24px);
  line-height: 1.7;
  color: var(--color-text-primary);
}

.about-quote a {
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color var(--duration-fast) var(--ease-out);
}

.about-quote a:hover {
  color: var(--color-card-hover);
}

.about-bio {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text-primary);
}

.about-experience {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--color-text-primary);
}

.about-experience-title {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(18px, 1.68vw, 24px);
  line-height: 1.7;
}

.about-exp-row {
  display: flex;
  gap: 64px;
  font-size: 16px;
  line-height: 1.7;
}

.about-exp-company {
  font-family: var(--font-body);
  font-weight: 600;
  width: 244px;
  flex-shrink: 0;
}

.about-exp-role {
  font-family: var(--font-body);
  font-weight: 400;
  flex: 1;
}

.about-ascii {
  width: 100%;
  overflow: hidden;
}

.about-ascii pre {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  line-height: 1;
  color: #8f8f8f;
  white-space: pre;
  opacity: 0.85;
  transform-origin: top left;
  transition: color var(--duration-slow) var(--ease-out);
}

.about-ascii:hover pre {
  color: var(--color-card-hover);
}

/* ── Headshot with hover swap ─────────────────────────────────────────────── */

.about-headshot {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.about-headshot img {
  width: 100%;
  height: auto;
  display: block;
}

.about-headshot-ascii {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-out);
}

.about-headshot:hover .about-headshot-ascii {
  opacity: 1;
}

.about-headshot:hover .about-headshot-photo {
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-out);
}

/* ── Sections (scroll reveal targets) ────────────────────────────────────── */

.cs-section {
  display: flex;
  flex-direction: column;
  gap: 32px;
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.cs-section.will-animate {
  opacity: 0;
  transform: translateY(32px);
}

.cs-section.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ── Make entire card clickable via link overlay ──────────────────────────── */

.card {
  position: relative;
}

.card-link::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ─── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .nav-links {
    gap: 24px;
    font-size: 16px;
  }

  .nav-name {
    font-size: 16px;
  }

  .california-scene {
    translate: 0 0;
  }

  .california-rotate {
    width: 95%;
    height: 95%;
  }

  .hero-tagline {
    padding-top: 24px;
    padding-bottom: 104px;
  }

  .projects {
    gap: 80px;
    padding-block: 80px;
  }

  .footer-links {
    gap: 24px;
  }

  .cs-text-block {
    flex-direction: column;
    gap: 8px;
  }

  .cs-label--hidden {
    display: none;
  }

  .cs-image-row {
    flex-direction: column;
  }

  .cs-image-offset {
    display: none;
  }

  .cs-meta {
    gap: var(--space-lg);
  }

  .cs-title {
    font-size: clamp(24px, 6vw, 36px);
  }

  .about-exp-row {
    flex-direction: column;
    gap: 4px;
  }

  .about-exp-company {
    width: 100%;
  }
}
