/* ═══════════════════════════════════════════════════════════
   LAU LAB — Mobile-First Design System
   Base = mobile (320px+). Scales UP via min-width queries.
   ═══════════════════════════════════════════════════════════ */

/* Fonts loaded via <link> in HTML <head> — NOT via @import (blocks CSS parsing) */

/* ── Design Tokens ── */
:root {
  --c-bg: #FFB3B1;
  --c-primary: #9A0002;
  --font-display: 'Playfair Display', serif;
  --font-body: 'Outfit', sans-serif;
  --brutal-shadow: 4px 4px 0px 0px rgba(0,0,0,0.4);
  --brutal-shadow-hover: 2px 2px 0px 0px rgba(0,0,0,0.6);
  --radius: 12px;
  --border: 2px solid var(--c-primary);
  --tap-min: 48px; /* Fitts' Law minimum touch target */
  --focus-ring: 0 0 0 3px var(--c-primary), 0 0 0 5px var(--c-bg);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; max-width: 100vw; }

body {
  font-family: var(--font-body);
  background-color: var(--c-bg);
  color: var(--c-primary);
  font-size: 1rem; /* 16px base — prevents iOS zoom on inputs */
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport for mobile address bar */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeSpeed;
}

main { flex: 1; padding-top: 80px; width: 100%; }

/* ── Typography (mobile base) ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}
h1 em, h2 em, h3 em {
  font-weight: 400;
  font-style: italic;
  font-family: var(--font-display);
}

p {
  font-size: 1rem; /* 16px on mobile */
  font-weight: 300;
  margin-bottom: 1.25rem;
  line-height: 1.7; /* Extra line-height for mobile readability */
}

/* ── Focus (WCAG 2.2 AA) ── */
:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════
   NAVIGATION — Mobile hamburger by default
   ═══════════════════════════════════════════════ */
.nav-wrapper {
  position: fixed;
  top: 0.75rem;
  left: 0;
  right: 0;
  margin: 0 auto;
  z-index: 1000;
  width: 100%;
  padding: 0 0.75rem;
  will-change: transform;
}

.nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  background: rgba(255, 179, 177, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  box-shadow: var(--brutal-shadow);
  transition: transform 0.4s cubic-bezier(0.25,1,0.5,1);
}

.nav__logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-logo-img { height: 28px; width: auto; max-width: 100px; display: block; }

/* Hamburger toggle – VISIBLE by default (mobile-first) */
.nav__toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  padding: 0.75rem;
  -webkit-tap-highlight-color: transparent;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--c-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Menu – HIDDEN by default (mobile-first) */
.nav__menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  width: 100%;
  background: var(--c-bg);
  border: var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  flex-direction: column;
  list-style: none;
  box-shadow: var(--brutal-shadow);
  z-index: 999;
}

.nav__menu.active { display: flex; }

.nav__menu a {
  color: var(--c-primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem; /* Larger on mobile for readability */
  font-family: var(--font-display);
  text-transform: uppercase;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
  border-radius: calc(var(--radius) - 4px);
  transition: background-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.nav__menu a:hover,
.nav__menu a:active { background-color: rgba(154,0,2,0.08); }
.nav__menu a.active {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ═══════════════════════════════════════════════
   LAYOUT — Mobile base
   ═══════════════════════════════════════════════ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.section { padding: 2rem 0; width: 100%; }

/* ═══════════════════════════════════════════════
   BUTTONS — Full-width on mobile, Fitts-optimized
   ═══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  padding: 1rem 1.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  text-decoration: none;
  border: var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* Eliminates 300ms tap delay */
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  /* Active state for instant tactile feedback */
}
.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0px 0px rgba(0,0,0,0.4);
}

.btn--primary {
  background-color: var(--c-primary);
  color: var(--c-bg);
  box-shadow: var(--brutal-shadow);
}
.btn--secondary {
  background-color: transparent;
  color: var(--c-primary);
  box-shadow: var(--brutal-shadow);
}

/* ═══════════════════════════════════════════════
   BENTO GRID — Single column on mobile
   ═══════════════════════════════════════════════ */
.bento-grid, .bento-grid-3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: auto;
  gap: 1rem;
  width: 100%;
}

.bento-card {
  background: var(--c-bg);
  border: var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--brutal-shadow);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 200px;
}

/* No hover transforms on touch — only on pointer devices */
@media (hover: hover) and (pointer: fine) {
  .bento-card {
    transition: transform 0.3s cubic-bezier(0.25,1,0.5,1), box-shadow 0.3s cubic-bezier(0.25,1,0.5,1);
    will-change: transform;
  }
  .bento-card:hover {
    transform: translate(-4px, -4px);
    box-shadow: 10px 10px 0px 0px rgba(0,0,0,0.5);
  }
  .btn--primary:hover {
    transform: translate(4px, 4px);
    box-shadow: var(--brutal-shadow-hover);
  }
  .btn--secondary:hover {
    transform: translate(4px, 4px);
    box-shadow: var(--brutal-shadow-hover);
    background-color: var(--c-primary);
    color: var(--c-bg);
  }
}

.bento-hero {
  grid-column: 1 / -1;
  min-height: 280px;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.bento-hero h1 {
  font-size: clamp(2rem, 8vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -1px;
  margin-bottom: 1.5rem;
}

.bento-image { padding: 0; display: flex; }
.bento-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.bento-text-lg, .bento-wide { grid-column: 1 / -1; }
.bento-text-lg { justify-content: center; }
.bento-square { justify-content: center; align-items: center; text-align: center; }

/* ═══════════════════════════════════════════════
   PORTFOLIO CARDS — Touch-friendly on mobile
   ═══════════════════════════════════════════════ */
.portfolio-card {
  padding: 0;
  aspect-ratio: 1;
  min-height: unset;
}
.portfolio-card img, .portfolio-card video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* On touch devices: always show label (no hover) */
.portfolio-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  background: var(--c-primary);
  color: var(--c-bg);
  transform: translateY(0); /* VISIBLE by default on mobile */
}
.portfolio-card-content h3 {
  color: var(--c-bg);
  margin-bottom: 0;
  font-size: 1rem;
}
.portfolio-card-content p {
  font-size: 0.85rem;
  margin-bottom: 0;
}

/* On pointer devices (desktop): hide and reveal on hover */
@media (hover: hover) and (pointer: fine) {
  .portfolio-card img, .portfolio-card video {
    transition: transform 0.5s ease;
  }
  .portfolio-card:hover img, .portfolio-card:hover video {
    transform: scale(1.05);
  }
  .portfolio-card-content {
    transform: translateY(100%);
    transition: transform 0.3s ease;
    padding: 1.5rem;
  }
  .portfolio-card:hover .portfolio-card-content {
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════
   FOOTER — Compact on mobile
   ═══════════════════════════════════════════════ */
.footer {
  border-top: var(--border);
  padding: 2.5rem 0 1.5rem;
  background-color: var(--c-primary);
  color: var(--c-bg);
  margin-top: 2rem;
  overflow: hidden;
  width: 100%;
}

.footer-huge-text {
  font-family: var(--font-display);
  font-size: 18vw;
  line-height: 1.1;
  white-space: normal;
  word-wrap: break-word;
  font-weight: 700;
  color: var(--c-bg);
  margin: 0;
  text-align: center;
  max-width: 100%;
  letter-spacing: -2px;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 2px solid rgba(154,0,2,0.2);
  margin-top: 1.5rem;
  gap: 1rem;
}

.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.footer-links a {
  color: var(--c-bg);
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: 0.5rem 0.75rem; /* Generous touch padding */
}
.footer-links a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════
   FORMS — 16px minimum to prevent iOS auto-zoom
   ═══════════════════════════════════════════════ */
.form-group { margin-bottom: 1.25rem; width: 100%; }
.form-label {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  border: var(--border);
  background-color: transparent;
  color: var(--c-primary);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px; /* CRITICAL: prevents iOS zoom on focus */
  border-radius: var(--radius);
  box-shadow: inset 4px 4px 0px 0px rgba(0,0,0,0.2);
  min-height: var(--tap-min);
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
  -webkit-appearance: none; /* Removes iOS default styling */
  appearance: none;
}
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239A0002' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}
.form-control::placeholder { color: rgba(154,0,2,0.5); }
.form-control:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--c-primary);
  background-color: rgba(0,0,0,0.08);
}

/* Form row — stacked on mobile, side-by-side on tablet */
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

/* ═══════════════════════════════════════════════
   ANIMATIONS — Reduced on mobile for battery
   ═══════════════════════════════════════════════ */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.25,1,0.5,1), transform 0.6s cubic-bezier(0.25,1,0.5,1);
  will-change: opacity, transform;
}
.fade-up.is-visible { opacity: 1; transform: translateY(0); }

.delay-1 { transition-delay: 0.05s; }
.delay-2 { transition-delay: 0.1s; }
.delay-3 { transition-delay: 0.15s; }
.delay-4 { transition-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .fade-up { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════════
   TABLET — 768px+
   ═══════════════════════════════════════════════ */
@media (min-width: 768px) {
  main { padding-top: 90px; }
  .container { padding-left: 1.5rem; padding-right: 1.5rem; }
  .section { padding: 3rem 0; }

  p { font-size: 1.125rem; }

  .bento-grid, .bento-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    grid-auto-rows: minmax(280px, auto);
  }
  .bento-hero, .bento-text-lg, .bento-wide { grid-column: span 2; }
  .bento-card { padding: 2rem; min-height: 250px; }
  .portfolio-card { min-height: unset; }

  .btn { padding: 1rem 2rem; font-size: 1rem; }
  .form-row { grid-template-columns: 1fr 1fr; gap: 1rem; }
}

/* ═══════════════════════════════════════════════
   DESKTOP — 992px+
   ═══════════════════════════════════════════════ */
@media (min-width: 992px) {
  main { padding-top: 100px; }
  .section { padding: 4rem 0; }

  /* Nav: show inline menu, hide hamburger */
  .nav-wrapper {
    width: max-content;
    max-width: 95%;
    padding: 0;
    top: 1.5rem;
  }
  .nav {
    justify-content: center;
    gap: 3rem;
    border-radius: 100px;
    padding: 0.5rem 2.5rem;
  }
  .nav__logo {
    position: static;
    transform: none;
  }
  .nav__toggle { display: none; }
  .nav__menu {
    display: flex !important;
    position: static;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    flex-direction: row;
    box-shadow: none;
    gap: 0.5rem;
  }
  .nav__menu a {
    font-size: 0.85rem;
    padding: 0.5rem;
    min-height: var(--tap-min);
    min-width: var(--tap-min);
    white-space: nowrap;
  }
  .nav__menu a:hover, .nav__menu a:active { background-color: transparent; }

  .nav-logo-img { height: 38px; max-width: none; }

  /* Grids scale to full columns */
  .bento-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: minmax(280px, auto);
  }
  .bento-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(280px, auto);
  }
  .bento-hero { grid-column: span 4; min-height: 380px; }
  .bento-card { padding: 2.5rem; }
  .portfolio-card { min-height: unset; }

  .footer { padding: 4rem 0 2rem; margin-top: 4rem; }
  .footer-huge-text { font-size: clamp(3rem, 10vw, 8rem); }
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}
