/* ══════════════════════════════════════
   pages.css - Fun, Work and case study styles
   ══════════════════════════════════════ */

/* ── Shared page containers ── */
#fun-content,
#work-content {
  transition: opacity 0.3s ease;
}

/* ── Shared page inner containers ── */
#fun-inner,
#work-inner,
#work-presentation {
  padding: var(--space-8) var(--space-6) var(--space-12);  /* was 28px 26px 48px */
  display: flex;
  flex-direction: column;
  gap: var(--space-6);  /* was 24px */
  min-height: 100%;
}

.fun-header,
.work-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.section-title {
  font-size: var(--text-2xl);
  font-weight: 600;  /* was 500 - more presence */
  color: var(--text);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}

.section-desc {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--text-45);
  line-height: var(--leading-loose);  /* was 1.6, now 1.7 */
  max-width: 620px;  /* was 480px - optimal reading length */
}

/* ── Fun - project cards grid ── */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);  /* was 12px */
}

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

.card {
  background: var(--text-08);
  border: 1px solid var(--text-12);
  padding: var(--space-4);  /* was 16px */
  display: flex;
  flex-direction: column;
  gap: var(--space-3);  /* was 12px */
  transition: background 0.25s ease,
              border-color 0.25s ease,
              transform 0.25s ease,
              box-shadow 0.25s ease;
  transform: translateY(0);
  box-shadow: 0 0 0 rgba(0,0,0,0);
}

.card:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.card:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 4px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-wrap {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.logo-wrap svg {
  width: 100%;
  height: 100%;
}

.card-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.card-link {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-35);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--text-20);
  padding-bottom: 1px;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
}

.card-link:hover { color: var(--accent-orange); }

.card-link:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
  border-radius: 2px;
}

.card-bio {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-60);
  line-height: 1.6;
}

.bio-problem {
  color: var(--text-75);
  font-weight: 500;
}

.bio-hook {
  color: var(--text-90);
  font-weight: 500;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meta-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.meta-label {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-35);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  min-width: 44px;
  padding-top: 1px;
  flex-shrink: 0;
}

.meta-icon {
  font-size: 8px;
  opacity: 0.6;
  margin-right: 2px;
}

.meta-val {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-45);
  line-height: 1.5;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.tag {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 7px;
  border: 1px solid var(--text-20);
  color: var(--text-45);
  transition: background 0.15s ease,
              border-color 0.15s ease,
              color 0.15s ease;
}

.tag:hover {
  background: var(--text-08);
  border-color: var(--border);
  color: var(--text);
}

/* ── Work - case study cards ── */
.work-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;  /* was 1fr 1fr - gives text more space */
  gap: var(--space-6);  /* was 20px */
  background: var(--text-08);
  border: 1px solid var(--text-12);
  padding: var(--space-5);  /* was 20px */
  cursor: pointer;
  transition: background 0.25s ease,
              border-color 0.25s ease,
              transform 0.25s ease,
              box-shadow 0.25s ease;
  transform: translateY(0);
  box-shadow: 0 0 0 rgba(0,0,0,0);
}

.work-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.work-card:active {
  transform: translateY(-2px);
}

.work-card:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 4px;
}

@media (max-width: 600px) {
  .work-card { grid-template-columns: 1fr; }
}

.work-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.badge {
  font-size: 10px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid var(--text-20);
  color: var(--text-45);
}

.badge.green {
  border-color: rgba(100,200,150,0.4);
  color: rgba(140,220,180,0.9);
}

.work-card-title {
  font-size: clamp(18px, 2.5vw, 28px);
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.work-card-sub {
  font-size: 13px;
  color: var(--text-45);
  line-height: 1.5;
}

.work-card-link {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-35);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--text-20);
  padding-bottom: 1px;
  white-space: nowrap;
  text-decoration: none;
  margin-top: 8px;
  display: inline-block;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.work-card-link:hover {
  color: var(--accent-orange);
  border-color: var(--accent-orange);
}

.work-card-link:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
  border-radius: 2px;
}

.work-card-preview {
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 2 / 1;
}

.work-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  transition: transform 0.4s ease, opacity 0.25s ease;
  transform: scale(1);
}

.work-card:hover .work-card-preview img {
  transform: scale(1.02);
  opacity: 0.95;
}

/* ── Case study full page ── */
.case-study {
  padding: 32px 26px 48px;
  max-width: 900px;
  margin: 0 auto;
}

.case-study.hidden { display: none; }
#work-inner.hidden  { display: none; }

.case-back {
  margin-bottom: 24px;
  display: inline-block;
}

/* Case study - section label */
.section-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-35);
  margin-bottom: 14px;
}

/* Case study - flow screen grid */
.flow-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 36px;
}

@media (max-width: 600px) {
  .flow-steps { grid-template-columns: 1fr; }
}

.step-card {
  background: var(--text-08);
  border: 1px solid var(--text-12);
  overflow: hidden;
}

.step-card img {
  width: 100%;
  display: block;
  border-bottom: 1px solid var(--text-08);
}

.step-meta { padding: 10px 12px; }

.step-num {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-35);
  margin-bottom: 3px;
}

.step-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-90);
  margin-bottom: 3px;
}

.step-desc {
  font-size: 11px;
  color: var(--text-45);
  line-height: 1.5;
}

/* Case study - stats row */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 36px;
  background: var(--text-12);
  border: 1px solid var(--text-12);
}

@media (max-width: 600px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

.stat {
  background: var(--text-08);
  padding: 14px 16px;
}

.stat-num {
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-45);
  line-height: 1.4;
}

/* Case study - two col layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 36px;
}

@media (max-width: 540px) {
  .two-col { grid-template-columns: 1fr; }
}

.point {
  font-size: 13px;
  color: var(--text-60);
  line-height: 1.6;
  padding-left: 14px;
  position: relative;
  margin-bottom: 7px;
}

.point::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-20);
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tool {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  background: var(--text-08);
  border: 1px solid var(--text-12);
  color: var(--text-45);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--text-12);
}

.footer-meta {
  font-size: 11px;
  color: var(--text-35);
}

/* Journey map image */
.journey-wrap {
  margin-bottom: 36px;
}

.journey-wrap img {
  width: 100%;
  display: block;
  border: 1px solid var(--text-12);
}

/* ── Case study enhancements ── */

/* Problem hook */
.problem-hook {
  margin-bottom: var(--space-8);
  padding: var(--space-5);
  background: var(--text-08);
  border-left: 3px solid var(--border);
}

.hook-text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-75);
  max-width: 680px;
}

/* Context grid */
.context-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-10);
}

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

.context-card {
  padding: var(--space-4);
  background: var(--text-08);
  border: 1px solid var(--text-12);
}

.context-icon {
  font-size: 24px;
  margin-bottom: var(--space-2);
  opacity: 0.7;
}

.context-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--text);
}

.context-desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-60);
}

/* Stat insights */
.stat-insight {
  font-size: 10px;
  color: var(--text-35);
  line-height: 1.4;
  margin-top: var(--space-2);
  font-style: italic;
}

/* Solution overview */
.solution-overview {
  margin-bottom: var(--space-10);
}

.solution-text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-75);
  max-width: 680px;
}

/* Step why annotations */
.step-why {
  font-size: 10px;
  color: var(--text-35);
  line-height: 1.5;
  margin-top: var(--space-2);
  padding-left: var(--space-2);
}

/* Impact section */
.impact-section {
  margin-bottom: var(--space-10);
}

.impact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

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

.impact-card {
  padding: var(--space-4);
  background: var(--text-08);
  border: 1px solid var(--text-12);
}

.impact-card.learning {
  grid-column: 1 / -1;  /* Spans both columns */
  background: rgba(100,200,150,0.08);
  border-color: rgba(100,200,150,0.25);
}

.impact-metric {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.impact-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(140,220,180,0.95);
  margin-bottom: var(--space-2);
  letter-spacing: 0.02em;
}

.impact-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-60);
}

/* Design decisions intro */
.decisions-intro {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-60);
  margin-bottom: var(--space-4);
  max-width: 640px;
}

/* ── About page ── */
.about-inner {
  padding: var(--space-8) var(--space-6) var(--space-12);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  min-height: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.about-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-8);
  align-items: start;
}

@media (max-width: 700px) {
  .about-content {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

.about-photo {
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--text-12);
}

.about-photo img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.about-photo:hover img {
  transform: scale(1.02);
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.about-bio {
  font-size: var(--text-lg);
  line-height: var(--leading-loose);
  color: var(--text-75);
  max-width: 540px;
}

.about-bio .inline-link {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--text-35);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.about-bio .inline-link:hover {
  color: var(--accent-orange);
  border-color: var(--accent-orange);
}

.about-bio .inline-link:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
  border-radius: 2px;
}

.about-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.about-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  background: var(--text-08);
  border: 1px solid var(--text-12);
  text-decoration: none;
  transition: background 0.25s ease,
              border-color 0.25s ease,
              transform 0.2s ease;
}

.about-link:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.about-link:active {
  transform: translateX(2px);
}

.about-link:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 4px;
}

.link-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  letter-spacing: var(--tracking-tight);
}

.link-arrow {
  font-size: var(--text-base);
  color: var(--text-35);
  transition: color 0.2s ease, transform 0.2s ease;
}

.about-link:hover .link-arrow {
  color: var(--accent-orange);
  transform: translate(2px, -2px);
}

/* ── Content entrance animations ── */

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

/* Apply staggered entrance animations */
.fun-header,
.work-header,
.about-header,
.section-desc,
.cards > .card,
.work-card,
.about-content,
.problem-hook,
.context-grid,
.stats,
.solution-overview,
.flow-steps,
.journey-wrap,
.impact-section,
.two-col {
  animation: fadeInUp 0.5s ease-out backwards;
}

/* Stagger delays */
.fun-header,
.work-header,
.about-header {
  animation-delay: 0.05s;
}

.section-desc,
.about-content {
  animation-delay: 0.1s;
}

.cards > .card:nth-child(1),
.problem-hook {
  animation-delay: 0.15s;
}

.cards > .card:nth-child(2),
.context-grid {
  animation-delay: 0.2s;
}

.cards > .card:nth-child(3),
.stats {
  animation-delay: 0.25s;
}

.work-card,
.solution-overview {
  animation-delay: 0.15s;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .fun-header,
  .work-header,
  .about-header,
  .section-desc,
  .cards > .card,
  .work-card,
  .about-content,
  .problem-hook,
  .context-grid,
  .stats,
  .solution-overview,
  .flow-steps,
  .journey-wrap,
  .impact-section,
  .two-col {
    animation: none;
  }
}
