/* ═══════════════════════════════════════════════════════════════════
   STUDIO FORMA — DESIGN SYSTEM
   Visual reverse-engineering of minimalist architecture portfolio
   ═══════════════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────────────
   1. DESIGN TOKENS (CSS Custom Properties)
   ─────────────────────────────────────────────────────────────────── */

:root {
  /* ── Colors: Light mode ────────────────────────────────────────── */
  --c-bg:           #ffffff;
  --c-bg-alt:       #f7f7f7;
  --c-text:         #000000;
  --c-text-muted:   #999999;
  --c-text-dim:     #cccccc;
  --c-border:       #e5e5e5;
  --c-border-dark:  #c8c8c8;
  --c-overlay:      rgba(255,255,255,0.96);
  --c-card-hover:   rgba(0,0,0,0.03);

  /* ── Typography ────────────────────────────────────────────────── */
  --font-display:   'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-logo:      'Space Grotesk', system-ui, sans-serif;
  --font-body:      'Inter', system-ui, -apple-system, sans-serif;

  /* ── Type Scale ────────────────────────────────────────────────── */
  /* Desktop base: 16px */
  --ts-xs:    11px;   /* labels, captions */
  --ts-sm:    13px;   /* meta, small text */
  --ts-base:  15px;   /* body text */
  --ts-md:    17px;   /* emphasis */
  --ts-lg:    22px;   /* subheadings */
  --ts-xl:    32px;   /* section titles */
  --ts-2xl:   48px;   /* project titles desktop */
  --ts-3xl:   56px;   /* logo */
  --ts-4xl:   72px;   /* list items desktop */
  --ts-hero:  96px;   /* menu items */

  /* ── Spacing scale (4-base) ─────────────────────────────────────── */
  --sp-1:   4px;
  --sp-2:   8px;
  --sp-3:   12px;
  --sp-4:   16px;
  --sp-5:   20px;
  --sp-6:   24px;
  --sp-8:   32px;
  --sp-10:  40px;
  --sp-12:  48px;
  --sp-16:  64px;
  --sp-20:  80px;
  --sp-24:  96px;
  --sp-32: 128px;

  /* ── Layout ─────────────────────────────────────────────────────── */
  --sidebar-w:    256px;
  --header-h:     56px;
  --detail-meta-w: 400px;

  /* ── Grid ───────────────────────────────────────────────────────── */
  --grid-cols:    3;
  --grid-gap:     10px;
  --grid-gap-sm:  6px;

  /* ── Animation ──────────────────────────────────────────────────── */
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:  cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:     180ms;
  --dur-med:      360ms;
  --dur-slow:     560ms;
  --dur-xslow:    800ms;

  /* ── Border radius ──────────────────────────────────────────────── */
  --rad-sm:  2px;
  --rad-md:  4px;
  --rad-lg:  8px;

  /* ── Shadows ────────────────────────────────────────────────────── */
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
}

/* ── Dark mode ──────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --c-bg:          #0c0c0c;
  --c-bg-alt:      #161616;
  --c-text:        #f0f0f0;
  --c-text-muted:  #555555;
  --c-text-dim:    #333333;
  --c-border:      #242424;
  --c-border-dark: #333333;
  --c-overlay:     rgba(12,12,12,0.97);
  --c-card-hover:  rgba(255,255,255,0.03);
}

/* ───────────────────────────────────────────────────────────────────
   2. RESET & BASE
   ─────────────────────────────────────────────────────────────────── */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  background-color: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
  overflow-x: hidden;
  cursor: none; /* Custom cursor */
  transition:
    background-color var(--dur-slow) var(--ease-in-out),
    color           var(--dur-slow) var(--ease-in-out);
}

/* Fallback for mobile (no custom cursor) */
@media (pointer: coarse) {
  body { cursor: auto; }
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

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

button {
  cursor: none;
  background: none;
  border: none;
  font-family: inherit;
  color: inherit;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

@media (pointer: coarse) {
  button { cursor: pointer; }
}

ul, ol { list-style: none; }

/* Scroll areas */
.scroll-area {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
}

.scroll-area::-webkit-scrollbar {
  width: 3px;
}

.scroll-area::-webkit-scrollbar-track {
  background: transparent;
}

.scroll-area::-webkit-scrollbar-thumb {
  background: var(--c-border);
  border-radius: 2px;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--c-text);
  outline-offset: 2px;
}

/* ───────────────────────────────────────────────────────────────────
   3. HEADER
   ─────────────────────────────────────────────────────────────────── */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-6);
  background-color: var(--c-bg);
  z-index: 100;
  transition: background-color var(--dur-slow) var(--ease-in-out);
  /* Subtle bottom border */
  border-bottom: 1px solid transparent;
}

/* Show border only when scrolled (added by JS) */
.header.is-scrolled {
  border-bottom-color: var(--c-border);
}

.header__left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.header__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--c-text);
  transition: color var(--dur-slow);
}

/* ── Back button ─────────────────────────────────────────────────── */
.btn-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--c-text);
  border-radius: var(--rad-sm);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
  transition:
    opacity   var(--dur-med) var(--ease-out),
    transform var(--dur-med) var(--ease-out),
    background var(--dur-fast);
}

.btn-back:hover {
  background: var(--c-bg-alt);
}

[data-view="detail"] .btn-back {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}

/* ── Header right ────────────────────────────────────────────────── */
.header__right {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

/* ── Theme toggle ────────────────────────────────────────────────── */
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--c-text);
  opacity: 0.55;
  border-radius: var(--rad-sm);
  transition: opacity var(--dur-fast), background var(--dur-fast);
}

.btn-icon:hover {
  opacity: 1;
  background: var(--c-bg-alt);
}

.btn-theme .icon-sun,
.btn-theme .icon-moon {
  position: absolute;
  transition: opacity var(--dur-fast), transform var(--dur-med) var(--ease-out);
}

.btn-theme { position: relative; }

[data-theme="light"] .btn-theme .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.7); }
[data-theme="light"] .btn-theme .icon-sun  { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="dark"]  .btn-theme .icon-sun  { opacity: 0; transform: rotate(90deg) scale(0.7); }
[data-theme="dark"]  .btn-theme .icon-moon { opacity: 1; transform: rotate(0) scale(1); }

/* ── Menu button ─────────────────────────────────────────────────── */
.btn-menu {
  font-family: var(--font-body);
  font-size: var(--ts-sm);
  font-weight: 400;
  letter-spacing: 0.025em;
  color: var(--c-text);
  border: 1px solid var(--c-border-dark);
  padding: 5px 14px;
  border-radius: var(--rad-sm);
  transition:
    background  var(--dur-fast),
    color       var(--dur-fast),
    border-color var(--dur-fast);
}

.btn-menu:hover {
  background: var(--c-text);
  color: var(--c-bg);
  border-color: var(--c-text);
}

/* ───────────────────────────────────────────────────────────────────
   4. SIDEBAR
   ─────────────────────────────────────────────────────────────────── */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: 90;
  display: flex;
  flex-direction: column;
  padding-top: calc(var(--header-h) + var(--sp-10));
  padding-left: var(--sp-8);
  pointer-events: none; /* Let content through; re-enable on children */
}

/* ── View toggles ────────────────────────────────────────────────── */
.sidebar__views {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: all;
}

.view-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-muted);
  border-radius: var(--rad-md);
  transition:
    color      var(--dur-fast),
    background var(--dur-fast);
}

.view-btn:hover {
  color: var(--c-text);
  background: var(--c-bg-alt);
}

.view-btn.active {
  color: var(--c-text);
  background: var(--c-bg-alt);
}

/* ── Logo ────────────────────────────────────────────────────────── */
.sidebar__logo {
  flex: 1;
  display: flex;
  align-items: flex-end;
  padding-bottom: var(--sp-10);
  pointer-events: all;
}

.logo {
  font-family: var(--font-logo);
  font-size: var(--ts-3xl);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--c-text);
  text-transform: lowercase;
  transition: opacity var(--dur-fast);
  display: block;
}

.logo:hover {
  opacity: 0.65;
}

/* ───────────────────────────────────────────────────────────────────
   5. MAIN LAYOUT
   ─────────────────────────────────────────────────────────────────── */

.main {
  position: relative;
  margin-top: var(--header-h);
  margin-left: var(--sidebar-w);
  min-height: calc(100vh - var(--header-h));
  overflow: hidden;
}

/* ───────────────────────────────────────────────────────────────────
   6. PANE / VIEW SYSTEM
   ─────────────────────────────────────────────────────────────────── */

.pane {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity   var(--dur-med) var(--ease-out),
    transform var(--dur-med) var(--ease-out);
  will-change: opacity, transform;
}

/* Entering from right */
.pane.entering-right  { transform: translateX(24px); }
/* Entering from left */
.pane.entering-left   { transform: translateX(-24px); }

.pane.is-active {
  opacity: 1;
  pointer-events: all;
  position: relative;
  transform: translateX(0);
}

/* ───────────────────────────────────────────────────────────────────
   7. GRID VIEW
   ─────────────────────────────────────────────────────────────────── */

.grid-container {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  gap: var(--grid-gap);
  padding: var(--grid-gap);
}

/* ── Project Card ────────────────────────────────────────────────── */
.project-card {
  position: relative;
  overflow: hidden;
  cursor: none;
  aspect-ratio: 4 / 3;
  background: var(--c-bg-alt);
  display: block;
}

/* Image zoom on hover */
.project-card__img {
  position: absolute;
  inset: 0;
  transition: transform var(--dur-slow) var(--ease-out);
  will-change: transform;
}

.project-card:hover .project-card__img {
  transform: scale(1.05);
}

/* Image: always visible, background color shows while loading */
.project-card__img::before {
  content: none;
}

/* Caption overlay */
.project-card__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.15) 40%,
    transparent 70%
  );
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity   var(--dur-med) var(--ease-out),
    transform var(--dur-med) var(--ease-out);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--sp-5);
}

.project-card:hover .project-card__overlay,
.project-card:focus-visible .project-card__overlay {
  opacity: 1;
  transform: translateY(0);
}

.project-card__name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  line-height: 1.2;
}

.project-card__year {
  font-family: var(--font-body);
  font-size: var(--ts-xs);
  font-weight: 400;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.06em;
  margin-top: var(--sp-1);
}

/* ── Grid variants ───────────────────────────────────────────────── */
[data-view="grid-sm"] .grid-container {
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gap-sm);
  padding: var(--grid-gap-sm);
}

[data-view="grid-sm"] .project-card__name {
  font-size: 13px;
  letter-spacing: 0.05em;
}

/* ───────────────────────────────────────────────────────────────────
   8. LIST VIEW
   ─────────────────────────────────────────────────────────────────── */

.pane--list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - var(--header-h));
}

/* ── Left names panel ────────────────────────────────────────────── */
.list-panel {
  display: flex;
  align-items: center;
  padding: var(--sp-16) var(--sp-12) var(--sp-16) var(--sp-10);
  border-right: 1px solid var(--c-border);
}

.list-names {
  width: 100%;
}

.list-item {
  cursor: none;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  transition: border-color var(--dur-fast);
}

.list-item:first-child {
  border-top: 1px solid var(--c-border);
}

.list-item__index {
  font-family: var(--font-body);
  font-size: var(--ts-xs);
  font-weight: 400;
  color: var(--c-text-dim);
  letter-spacing: 0.08em;
  min-width: 22px;
  transition: color var(--dur-fast);
}

.list-item__name {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, var(--ts-4xl));
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.015em;
  line-height: 1.05;
  color: var(--c-text-dim);
  transition: color var(--dur-fast);
}

/* Active / hover state */
.list-item.is-active .list-item__name,
.list-item:hover .list-item__name {
  color: var(--c-text);
}

.list-item.is-active .list-item__index,
.list-item:hover .list-item__index {
  color: var(--c-text-muted);
}

/* ── Right image panel ───────────────────────────────────────────── */
.list-visual {
  position: relative;
  overflow: hidden;
  height: calc(100vh - var(--header-h));
  position: sticky;
  top: var(--header-h);
}

.list-image-wrap {
  position: absolute;
  inset: 0;
}

.list-image {
  object-fit: cover;
  width: 100%;
  height: 100%;
  transition:
    opacity   var(--dur-med) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}

.list-image.is-transitioning {
  opacity: 0;
  transform: scale(1.02);
}

/* ───────────────────────────────────────────────────────────────────
   9. DETAIL VIEW
   ─────────────────────────────────────────────────────────────────── */

.pane--detail {
  display: grid;
  grid-template-columns: var(--detail-meta-w) 1fr;
  min-height: calc(100vh - var(--header-h));
}

/* ── Meta panel ──────────────────────────────────────────────────── */
.detail-meta {
  padding: var(--sp-10) var(--sp-8);
  border-right: 1px solid var(--c-border);
  max-height: calc(100vh - var(--header-h));
  position: sticky;
  top: var(--header-h);
}

.detail-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, var(--ts-2xl));
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--c-text);
  margin-bottom: var(--sp-8);
}

.detail-fields {
  display: flex;
  flex-direction: column;
}

.detail-field {
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--c-border);
}

.detail-field:first-child {
  border-top: 1px solid var(--c-border);
}

.detail-field__label {
  font-family: var(--font-body);
  font-size: var(--ts-xs);
  font-weight: 400;
  color: var(--c-text-muted);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: var(--sp-1);
  line-height: 1.4;
}

.detail-field__value {
  font-family: var(--font-body);
  font-size: var(--ts-base);
  font-weight: 400;
  color: var(--c-text);
  line-height: 1.55;
}

/* ── Visuals panel ───────────────────────────────────────────────── */
.detail-visuals {
  max-height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
  padding: var(--grid-gap);
}

.detail-image {
  width: 100%;
  flex-shrink: 0;
}

.detail-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.detail-image:first-child img {
  aspect-ratio: 16 / 9;
}

/* ───────────────────────────────────────────────────────────────────
   10. MENU OVERLAY
   ─────────────────────────────────────────────────────────────────── */

.menu-overlay {
  position: fixed;
  inset: 0;
  background: var(--c-overlay);
  z-index: 200;
  display: flex;
  align-items: stretch;

  /* Hidden state */
  clip-path: inset(0 0 100% 0);
  transition:
    clip-path var(--dur-slow) var(--ease-out),
    background var(--dur-slow);
}

.menu-overlay[aria-hidden="false"] {
  clip-path: inset(0 0 0% 0);
}

.menu-overlay__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--sp-6) var(--sp-6) var(--sp-8);
}

/* Close button — top right */
.menu-overlay__close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-6);
}

/* ── Menu nav ────────────────────────────────────────────────────── */
.menu-nav {
  flex: 1;
  display: flex;
  align-items: center;
  padding-left: calc(var(--sidebar-w) - var(--sp-6));
}

.menu-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.menu-nav__link {
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, var(--ts-hero));
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--c-text-dim);
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  transition: color var(--dur-fast);
  text-transform: lowercase;
}

.menu-nav__link:hover,
.menu-nav__link.is-active {
  color: var(--c-text);
}

.menu-nav__num {
  font-family: var(--font-body);
  font-size: var(--ts-xs);
  font-weight: 400;
  color: var(--c-text-muted);
  letter-spacing: 0.1em;
  transition: color var(--dur-fast);
  align-self: flex-start;
  margin-top: 0.55em;
  min-width: 28px;
}

/* ── Menu footer ─────────────────────────────────────────────────── */
.menu-footer {
  display: flex;
  gap: var(--sp-12);
  padding-left: calc(var(--sidebar-w) - var(--sp-6));
  border-top: 1px solid var(--c-border);
  padding-top: var(--sp-5);
}

.menu-footer__col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.menu-footer__label {
  font-size: var(--ts-xs);
  font-weight: 400;
  color: var(--c-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--sp-1);
}

.menu-footer p {
  font-size: var(--ts-sm);
  color: var(--c-text);
  line-height: 1.6;
}

.menu-footer a {
  color: var(--c-text);
  transition: opacity var(--dur-fast);
}

.menu-footer a:hover {
  opacity: 0.55;
}

/* ───────────────────────────────────────────────────────────────────
   11. CUSTOM CURSOR
   ─────────────────────────────────────────────────────────────────── */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  will-change: transform;
}

.cursor__dot {
  position: absolute;
  width: 5px;
  height: 5px;
  background: var(--c-text);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: background var(--dur-slow);
}

.cursor__ring {
  position: absolute;
  width: 32px;
  height: 32px;
  border: 1px solid var(--c-text);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.4;
  transition:
    width        var(--dur-med) var(--ease-out),
    height       var(--dur-med) var(--ease-out),
    opacity      var(--dur-med) var(--ease-out),
    border-color var(--dur-slow);
}

/* Cursor expand on interactive elements */
body.cursor-hover .cursor__ring {
  width: 52px;
  height: 52px;
  opacity: 0.2;
}

body.cursor-click .cursor__ring {
  width: 22px;
  height: 22px;
  opacity: 0.6;
}

/* ───────────────────────────────────────────────────────────────────
   12. SCROLL-REVEAL ANIMATION
   ─────────────────────────────────────────────────────────────────── */

/* Card entrance: CSS animation fires as soon as card enters DOM */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.project-card {
  animation: cardIn var(--dur-med) var(--ease-out) both;
}

/* Stagger delays */
.project-card:nth-child(1)    { animation-delay:   0ms; }
.project-card:nth-child(2)    { animation-delay:  55ms; }
.project-card:nth-child(3)    { animation-delay: 110ms; }
.project-card:nth-child(4)    { animation-delay: 165ms; }
.project-card:nth-child(5)    { animation-delay: 220ms; }
.project-card:nth-child(6)    { animation-delay: 275ms; }
.project-card:nth-child(7)    { animation-delay: 330ms; }
.project-card:nth-child(8)    { animation-delay: 385ms; }
.project-card:nth-child(9)    { animation-delay: 440ms; }
.project-card:nth-child(10)   { animation-delay: 495ms; }
.project-card:nth-child(n+11) { animation-delay: 550ms; }

/* ───────────────────────────────────────────────────────────────────
   13. RESPONSIVE BREAKPOINTS
   ─────────────────────────────────────────────────────────────────── */

/* ── 1440px — Large Desktop ───────────────────────────────────────── */
@media (min-width: 1440px) {
  :root {
    --sidebar-w: 280px;
    --grid-gap:  12px;
  }
  .grid-container {
    grid-template-columns: repeat(3, 1fr);
  }
  .logo {
    font-size: 62px;
  }
}

/* ── 1200px — Desktop ─────────────────────────────────────────────── */
@media (max-width: 1200px) {
  :root {
    --sidebar-w:      220px;
    --detail-meta-w:  360px;
  }
  .logo {
    font-size: 48px;
  }
  [data-view="grid-sm"] .grid-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── 1024px — Laptop ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root {
    --sidebar-w:      200px;
    --detail-meta-w:  320px;
    --grid-cols: 2;
  }
  .logo {
    font-size: 42px;
  }
  .list-item__name {
    font-size: clamp(24px, 3vw, 52px);
  }
  .menu-nav__link {
    font-size: clamp(40px, 6vw, 80px);
  }
}

/* ── 768px — Tablet ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --sidebar-w:      0px;
    --header-h:       52px;
    --grid-gap:       6px;
    --grid-cols:      2;
  }

  body { cursor: auto; }
  .cursor { display: none; }

  .sidebar {
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-3) var(--sp-6);
    background: var(--c-bg);
    border-top: 1px solid var(--c-border);
    z-index: 90;
    padding-top: var(--sp-3);
  }

  .sidebar__views {
    flex-direction: row;
    gap: var(--sp-2);
  }

  .sidebar__logo {
    flex: 0;
    padding-bottom: 0;
    align-items: center;
  }

  .logo {
    font-size: 28px;
  }

  .main {
    margin-left: 0;
    margin-bottom: 60px;
  }

  /* Grid: 2-column on tablet */
  .grid-container {
    grid-template-columns: repeat(2, 1fr);
  }

  [data-view="grid-sm"] .grid-container {
    grid-template-columns: repeat(3, 1fr);
  }

  /* List: full-width names, hide image */
  .pane--list {
    grid-template-columns: 1fr;
  }

  .list-visual {
    display: none;
  }

  .list-panel {
    padding: var(--sp-8) var(--sp-6);
    border-right: none;
  }

  /* Detail: stack vertically */
  .pane--detail {
    grid-template-columns: 1fr;
  }

  .detail-meta {
    position: relative;
    top: 0;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
    padding: var(--sp-6);
  }

  .detail-visuals {
    max-height: none;
    padding: var(--sp-3);
  }

  /* Menu */
  .menu-footer {
    flex-direction: column;
    gap: var(--sp-6);
    padding-left: var(--sp-6);
  }

  .menu-nav {
    padding-left: var(--sp-6);
  }

  .menu-nav__link {
    font-size: clamp(32px, 10vw, 56px);
  }
}

/* ── 480px — Mobile ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  :root {
    --grid-cols: 1;
    --grid-gap:  4px;
  }

  .grid-container {
    grid-template-columns: 1fr;
    padding: var(--sp-2);
  }

  [data-view="grid-sm"] .grid-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-card {
    aspect-ratio: 3 / 2;
  }

  .list-item__name {
    font-size: clamp(22px, 7vw, 38px);
  }

  .detail-title {
    font-size: 32px;
  }

  .menu-nav__link {
    font-size: clamp(28px, 12vw, 48px);
  }

  .header__title {
    font-size: 18px;
  }

  .logo {
    font-size: 24px;
  }
}

/* ── 390px — Small Mobile ─────────────────────────────────────────── */
@media (max-width: 390px) {
  .header {
    padding: 0 var(--sp-4);
  }

  .project-card__name {
    font-size: 14px;
  }
}

/* ───────────────────────────────────────────────────────────────────
   14. WHATSAPP CTA
   ─────────────────────────────────────────────────────────────────── */

.whatsapp-cta {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--c-text);
  color: var(--c-bg);
  padding: 11px 20px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: var(--ts-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  transition:
    transform    var(--dur-fast) var(--ease-out),
    box-shadow   var(--dur-fast) var(--ease-out),
    opacity      var(--dur-fast);
  cursor: none;
}

.whatsapp-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.24);
}

.whatsapp-cta svg {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
}

/* Hide if no phone configured */
.whatsapp-cta[data-hidden="true"] {
  display: none;
}

/* ── Logo imagen ──────────────────────────────────────────────────── */
.logo img {
  max-height: 52px;
  max-width: 160px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left bottom;
}

/* ── Menu footer injected by CMS ─────────────────────────────────── */
.menu-footer__col a {
  color: var(--c-text);
  text-decoration: none;
}
.menu-footer__col a:hover {
  opacity: 0.6;
}

/* ───────────────────────────────────────────────────────────────────
   15. PRINT
   ─────────────────────────────────────────────────────────────────── */

@media print {
  .sidebar,
  .header,
  .menu-overlay,
  .cursor,
  .whatsapp-cta {
    display: none;
  }

  .main {
    margin: 0;
  }

  .pane--grid.is-active {
    position: static;
  }

  .grid-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ───────────────────────────────────────────────────────────────────
   15. REDUCED MOTION
   ─────────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
