@import url('https://fonts.googleapis.com/css2?family=Orelega+One&family=Open+Sans:wght@400;600;700&family=Caveat&display=swap');

:root {
  --bg-primary: #fffaf0;
  --bg-secondary: #fff8e6;
  --bg-white: #ffffff;
  --text-primary: #3d3c38;
  --text-secondary: #5c5a55;
  --text-orange: #d05d38;
  --text-purple: #8e38d0;
  --text-teal: #2699c2;
  --border-orange: #d05d38;
  --border-secondary: #d5dbdb;
  --border-tertiary: #b7bdbd;
  --font-heading: 'Orelega One', serif;
  --font-body: 'Open Sans', sans-serif;
  --font-handwriting: 'Caveat', cursive;
  --radius-l: 8px;
  --radius-full: 99999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-28: 112px;
  --space-36: 144px;
  --space-40: 160px;
  --max-width: 1120px;
  --side-padding: var(--space-40);
  --container-width: 1440px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul {
  list-style: none;
}

/* ===== NAV ===== */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6) var(--side-padding);
  background-color: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  max-width: var(--container-width);
  margin: 0 auto;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 20px;
  white-space: nowrap;
}

.nav-logo .flower {
  color: var(--text-orange);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-10);
}

.nav-link {
  font-size: 20px;
  padding: 2px 28px;
  position: relative;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--text-secondary);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  inset: -1px 0 0 0;
  background: url('../images/nav-active.svg') no-repeat center / 100% 100%;
  pointer-events: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-primary);
}

.nav-toggle svg {
  width: 28px;
  height: 28px;
}

/* ===== HERO (Home) ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  padding: var(--space-10) max(var(--side-padding), calc((100% - var(--container-width) + var(--side-padding) * 2) / 2)) var(--space-20);
  border-bottom: 1px solid var(--border-tertiary);
}

.hero-greeting {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.1s forwards;
}

.hero-greeting h1 {
  font-family: var(--font-heading);
  font-size: 60px;
  font-weight: 400;
  color: var(--text-orange);
  line-height: 1.1;
}

.hero-greeting .kaomoji {
  font-family: var(--font-heading);
  font-size: 48px;
  color: var(--text-purple);
}

.hero-tagline {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 400;
  color: var(--text-orange);
  line-height: 1.2;
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

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

.hero-tagline .star {
  color: var(--text-teal);
  display: inline-block;
  animation: spin 6s linear infinite;
}

.hero-tagline .flower {
  color: #d038a2;
}

/* ===== WORK SECTION ===== */
.section {
  padding: var(--space-10) var(--side-padding) var(--space-16);
  max-width: var(--container-width);
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 400;
  line-height: 36px;
  margin-bottom: var(--space-3);
}

.section-desc {
  font-size: 20px;
  line-height: 24px;
  margin-bottom: var(--space-10);
}

/* ===== PROJECT CARDS ===== */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.card {
  background: var(--bg-white);
  border-radius: var(--radius-l);
  padding: var(--space-10);
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.card-image {
  width: 100%;
  border-radius: var(--radius-l);
  aspect-ratio: 1440 / 820;
  object-fit: cover;
}

.card-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  gap: 20px;
}

.card-title {
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 600;
  line-height: 28px;
}

.card-btn {
  align-self: flex-end;
  border: 1px solid var(--border-orange);
  border-radius: var(--radius-full);
  padding: 16px 20px;
  color: var(--text-orange);
  font-size: 20px;
  line-height: 24px;
  background: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  display: inline-block;
}

.card-btn:hover {
  background-color: var(--text-orange);
  color: white;
}

.other-projects {
  font-size: 20px;
  line-height: 24px;
  margin-top: var(--space-6);
}

/* ===== REFERENCES ===== */
.references {
  padding: var(--space-20) var(--side-padding) var(--space-16);
  max-width: var(--container-width);
  margin: 0 auto;
}

.references .section-title {
  margin-bottom: var(--space-10);
}

.ref-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ref-card {
  background: var(--bg-white);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-l);
  padding: var(--space-10);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-10);
}

.ref-text {
  font-size: 16px;
  line-height: 24px;
}

.ref-text strong {
  font-weight: 600;
}

.ref-author {
  text-align: right;
}

.ref-author-name {
  font-weight: 700;
  font-size: 16px;
  line-height: 18px;
}

.ref-author-title {
  font-size: 14px;
  line-height: 16px;
  color: var(--text-primary);
}

/* ===== FOOTER ===== */
.footer {
  background-color: var(--bg-secondary);
  padding: var(--space-24) max(var(--side-padding), calc((100% - var(--container-width) + var(--side-padding) * 2) / 2));
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.footer-kaomoji {
  font-size: 14px;
  line-height: 16px;
}

.footer-links {
  display: flex;
  gap: var(--space-6);
  align-items: center;
}

.footer-links a {
  font-size: 20px;
  line-height: 24px;
  transition: color 0.2s;
}

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

.footer-copyright {
  font-size: 14px;
  line-height: 16px;
  color: var(--text-secondary);
}

/* ===== ABOUT PAGE ===== */
.about-content {
  display: flex;
  gap: var(--space-20);
  padding: var(--space-28) var(--side-padding) var(--space-36);
  align-items: flex-start;
  max-width: var(--container-width);
  margin: 0 auto;
}

.about-portrait {
  position: relative;
  flex-shrink: 0;
}

.portrait-frame {
  width: 348px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  background: white;
  overflow: hidden;
}

.portrait-frame img {
  width: 316px;
  height: 270px;
  object-fit: cover;
  object-position: top;
  border-radius: 4px;
}

.portrait-text {
  font-family: var(--font-handwriting);
  font-size: 32px;
  color: var(--text-orange);
  text-align: center;
  margin-top: 8px;
}

.uruguay-stamp {
  position: absolute;
  width: 181px;
  height: 181px;
  left: 213px;
  top: 198px;
  transform: rotate(-20deg);
}

.about-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  justify-content: center;
  align-self: stretch;
}

.about-bio {
  font-size: 16px;
  line-height: 18px;
}

.about-skills-title {
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  margin-bottom: var(--space-3);
}

.about-skills-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 16px;
  line-height: 24px;
}

.about-skills-list .skill-item .star {
  color: var(--text-teal);
}

/* ===== PROJECT PAGES ===== */
.project-cover {
  padding: 36px var(--side-padding);
  max-width: var(--container-width);
  margin: 0 auto;
}

.project-cover img {
  width: 100%;
  border-radius: var(--radius-l);
  aspect-ratio: 1440 / 820;
  object-fit: cover;
}

.project-main {
  padding: var(--space-10) var(--side-padding) var(--space-36);
  max-width: var(--container-width);
  margin: 0 auto;
}

.project-header {
  border-bottom: 1px solid var(--border-tertiary);
  padding-bottom: 20px;
  margin-bottom: 56px;
}

.project-title {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 400;
  line-height: 36px;
  margin-bottom: 20px;
}

.project-details {
  display: flex;
  justify-content: space-between;
  font-size: 20px;
  line-height: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.project-details strong {
  font-weight: 600;
}

.project-section {
  margin-bottom: 56px;
}

.project-subtitle-lg {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 24px;
  line-height: 28px;
  margin-bottom: 16px;
}

.project-section-title {
  font-weight: 600;
  font-size: 20px;
  line-height: 24px;
  margin-bottom: var(--space-4);
}

.project-caption + .project-section-title,
.project-images-row + .project-section-title,
video + .project-section-title {
  margin-top: var(--space-10);
}

.project-text {
  font-size: 18px;
  line-height: 24px;
  margin-bottom: 16px;
}

.project-text strong {
  font-weight: 700;
}

.project-text a {
  color: var(--text-orange);
  text-decoration: underline;
}

.project-main video {
  width: 100%;
  border-radius: 4px;
  margin-bottom: var(--space-4);
}

.project-images-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.project-images-row.three-col {
  grid-template-columns: 1fr 1fr 1fr;
}

.project-gallery {
  background: var(--bg-secondary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-l);
  padding: var(--space-8);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.project-gallery-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.project-gallery-col img {
  width: 100%;
  border-radius: 4px;
}

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

.finding-card {
  background: #d9f0d8;
  border-radius: var(--radius-l);
  padding: var(--space-5) var(--space-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  text-align: center;
  color: #0a4d08;
}

.finding-card .finding-icon {
  font-family: var(--font-heading);
  font-size: 32px;
  line-height: 36px;
}

.finding-card .finding-text {
  font-size: 20px;
  line-height: 24px;
}

.metric-cards {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.metric-card {
  flex: 1;
  background: var(--text-orange);
  border: 1px solid #e58422;
  border-radius: var(--radius-l);
  padding: var(--space-4);
  color: white;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.metric-card .metric-value {
  font-weight: 700;
  font-size: 32px;
  line-height: 36px;
}

.metric-card .metric-label {
  font-size: 20px;
  line-height: 24px;
}

.outcome-table {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-l);
  padding: var(--space-5) var(--space-4);
  display: grid;
  grid-template-columns: 2fr 0.75fr 0.75fr 1fr;
  gap: var(--space-4) 0;
  font-size: 18px;
  line-height: 24px;
  overflow: hidden;
}

.outcome-table .table-header {
  border-bottom: 1px solid var(--border-tertiary);
  padding-bottom: var(--space-1);
}

.outcome-table .table-change {
  font-weight: 700;
}


.project-images-row.single {
  grid-template-columns: 1fr;
}

.project-images-row img {
  width: 100%;
  border-radius: 4px;
}

.project-images-row:has(+ .project-caption) {
  margin-bottom: var(--space-2);
}

.project-caption {
  font-size: 14px;
  line-height: 16px;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.project-caption a {
  color: var(--text-orange);
  text-decoration: underline;
}

.project-list {
  list-style: disc;
  padding-left: 27px;
  font-size: 18px;
  line-height: 24px;
  margin-bottom: 16px;
}

.project-list li {
  margin-bottom: 16px;
}

.project-list li:last-child {
  margin-bottom: 0;
}

.goal-callout {
  background: var(--bg-secondary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-l);
  padding: 16px;
  margin-bottom: 16px;
}

.goal-callout-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.goal-callout-header svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.goal-callout-header span {
  font-weight: 600;
  font-size: 20px;
  line-height: 24px;
}

.goal-callout p {
  font-size: 18px;
  line-height: 24px;
}

.goal-callout strong {
  font-weight: 700;
  color: var(--text-orange);
}

/* ===== PROBLEM / INSIGHTS / OPPORTUNITY CARDS ===== */
.pio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.pio-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-l);
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.pio-card-title {
  font-weight: 600;
  font-size: 20px;
  line-height: 24px;
}

.pio-chart {
  width: 100%;
  border-radius: 4px;
}

.pio-label {
  font-weight: 600;
  font-size: 14px;
  line-height: 16px;
  margin-bottom: 12px;
}

.pio-body {
  font-size: 16px;
  line-height: 18px;
}

.pio-highlight {
  font-weight: 700;
  color: var(--text-orange);
}

.pio-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pio-card-fill {
  flex: 1;
  gap: 8px;
  padding: 16px 20px 24px;
}

.questions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.question-card {
  background: var(--bg-white);
  border-radius: var(--radius-l);
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.question-mark {
  font-weight: 700;
  font-size: 32px;
  color: var(--text-orange);
  opacity: 0.5;
  transform: rotate(-16.5deg);
  flex-shrink: 0;
  width: 26px;
  text-align: center;
}

.question-text {
  font-weight: 700;
  font-size: 18px;
  line-height: 24px;
}

.version-flow {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.version-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-tertiary);
  border-radius: var(--radius-l);
  padding: 12px 20px;
}

.version-card .version-label {
  font-size: 14px;
  line-height: 20px;
}

.version-card .version-desc {
  font-weight: 700;
  font-size: 18px;
  line-height: 24px;
}

.version-arrow {
  font-size: 24px;
  color: var(--border-tertiary);
  flex-shrink: 0;
}


/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  :root {
    --side-padding: var(--space-20);
  }
}

@media (max-width: 900px) {
  :root {
    --side-padding: var(--space-10);
  }

  .hero-greeting h1 {
    font-size: 42px;
  }

  .hero-greeting .kaomoji {
    font-size: 36px;
  }

  .hero-tagline {
    font-size: 32px;
  }

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

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

  .about-content {
    flex-direction: column;
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
  }

  .about-portrait {
    align-self: center;
  }

  .project-details {
    flex-direction: column;
    gap: 8px;
  }

  .project-images-row {
    grid-template-columns: 1fr;
  }

  .project-images-row.three-col {
    grid-template-columns: 1fr;
  }

  .project-gallery {
    grid-template-columns: 1fr;
  }

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

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

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

  .version-flow {
    flex-direction: column;
  }

  .version-arrow {
    transform: rotate(90deg);
  }

  .metric-cards {
    flex-direction: column;
  }

  .outcome-table {
    grid-template-columns: 1fr 1fr 1fr;
    font-size: 16px;
  }

  .outcome-table span:nth-child(4n+1) {
    grid-column: 1 / -1;
  }

  .outcome-table .table-header:first-child {
    grid-column: 1 / -1;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    flex-direction: column;
    padding: 20px var(--side-padding) 30px;
    gap: 16px;
    border-bottom: 1px solid var(--border-tertiary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  }

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

  .nav-toggle {
    display: block;
  }

  .nav-link {
    font-size: 18px;
    padding: 8px 0;
  }

  .nav-link.active::before {
    display: none;
  }

  .nav-link.active {
    color: var(--text-orange);
    padding: 8px 0;
  }
}

@media (max-width: 600px) {
  :root {
    --side-padding: 20px;
  }


  .hero-greeting {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-greeting h1 {
    font-size: 36px;
  }

  .hero-greeting .kaomoji {
    font-size: 28px;
  }

  .hero-tagline {
    font-size: 24px;
  }

  .section-title {
    font-size: 28px;
  }

  .card {
    padding: 20px;
    gap: var(--space-6);
  }

  .card-title {
    font-size: 20px;
  }

  .portrait-frame {
    width: 280px;
  }

  .portrait-frame img {
    width: 248px;
    height: 210px;
  }

  .uruguay-stamp {
    width: 120px;
    height: 120px;
    left: 160px;
    top: 160px;
  }

  .project-title {
    font-size: 24px;
  }

  .ref-card {
    padding: 24px;
  }

  .footer {
    padding: 48px var(--side-padding);
    gap: var(--space-8);
  }
}

/* ===== LIGHTBOX ===== */
.project-main img[data-expandable] {
  cursor: zoom-in;
}

.project-gallery-col img[data-expandable] {
  cursor: zoom-in;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  cursor: zoom-out;
  align-items: center;
  justify-content: center;
  padding: var(--space-10);
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: white;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  padding: 8px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.lightbox-close:hover {
  opacity: 1;
}

/* ===== SKIP LINK ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--text-orange);
  color: white;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-l);
  z-index: 1000;
  font-weight: 600;
}

.skip-link:focus {
  top: 16px;
}

/* ===== FOCUS STYLES ===== */
:focus-visible {
  outline: 2px solid var(--text-orange);
  outline-offset: 2px;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}
