/* ==========================================================================
   MEDA MIDULA STUDIO — ARCHITECTURE & ENGINEERING
   Design System: Tropical Modernism × Editorial Architecture
   
   Influenced by:
   - Geoffrey Bawa's Tropical Modernism (restraint, proportion, light/shadow)
   - Kandyan art motifs (liyavela vine, lotus, warm ochre/terracotta)
   - 2026 architecture website conventions (photography-first, editorial grid)
   ========================================================================== */

/* ---- Design Tokens ---- */
:root {
  /* Warm Linen Palette — inspired by whitewashed Sri Lankan walls,
     polished cement, timber, and terracotta tiles */
  --bg-primary: #FAF8F5;
  --bg-warm: #F3EDE4;
  --bg-card: #FFFFFF;
  --bg-dark: #1A1612;
  --bg-dark-warm: #2A241E;

  --text-primary: #1A1612;
  --text-secondary: #5C5347;
  --text-tertiary: #8A7E72;
  --text-inverse: #FAF8F5;

  /* Terracotta / Burnished Bronze accent —
     drawn from Kandyan art's ochre-red palette */
  --accent: #A45A3D;
  --accent-hover: #8B4830;
  --accent-soft: rgba(164, 90, 61, 0.1);
  --accent-border: rgba(164, 90, 61, 0.25);

  /* Olive Green — tropical canopy & courtyard gardens */
  --olive: #6B7C5E;
  --olive-soft: rgba(107, 124, 94, 0.1);

  /* UI */
  --border: rgba(26, 22, 18, 0.08);
  --border-hover: rgba(26, 22, 18, 0.18);
  --shadow-sm: 0 1px 3px rgba(26, 22, 18, 0.06);
  --shadow-md: 0 8px 30px rgba(26, 22, 18, 0.08);
  --shadow-lg: 0 20px 60px rgba(26, 22, 18, 0.12);

  /* Typography */
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  /* Sinhala — pairs with the display serif for the studio's local name */
  --font-sinhala: 'Noto Serif Sinhala', 'Iskoola Pota', serif;

  /* Layout */
  --max-width: 1320px;
  --section-gap: 140px;
  --radius: 4px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.4s;
}

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

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}

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

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

button {
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
  background: none;
}

ul {
  list-style: none;
}

/* ---- Typography Scale ---- */
.t-display {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5.5vw, 5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.t-heading {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.t-subheading {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

.t-body-lg {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.t-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.t-caption {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

/* ---- Layout ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 60px);
}

.section {
  padding: var(--section-gap) 0;
}

.divider {
  width: 60px;
  height: 1px;
  background: var(--accent);
  margin: 24px 0;
}

/* ---- Scroll Reveal (CSS Scroll-Driven Animation) ---- */
@supports (animation-timeline: view()) {
  .reveal {
    animation: reveal-up var(--duration) var(--ease) both;
    animation-timeline: view();
    animation-range: entry 0% cover 30%;
  }
}

/* Fallback for unsupported browsers */
@supports not (animation-timeline: view()) {
  .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  }
  .reveal.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  transition: all var(--duration) var(--ease);
}

.btn-fill {
  background: var(--accent);
  color: var(--text-inverse);
  padding: 16px 36px;
  border-radius: var(--radius);
}

.btn-fill:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(164, 90, 61, 0.25);
}

.btn-outline {
  border: 1px solid var(--text-primary);
  color: var(--text-primary);
  padding: 15px 35px;
  border-radius: var(--radius);
}

.btn-outline:hover {
  background: var(--text-primary);
  color: var(--text-inverse);
}

.btn-text {
  color: var(--accent);
  padding: 0;
  border-bottom: 1px solid transparent;
}

.btn-text:hover {
  border-bottom-color: var(--accent);
}

/* ========================================================================
   HEADER / NAVIGATION
   Quiet, editorial. Disappears on scroll, reappears on scroll-up.
   ======================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.35s var(--ease);
}

.header--hidden {
  transform: translateY(-100%);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Logo lockup: Liyavela mark with the Sinhala name set beneath it */
.nav-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

/* Liyavela-inspired SVG vine ornament for brand mark */
.nav-logo svg {
  width: 30px;
  height: 30px;
  display: block;
}

.nav-logo-sinhala {
  font-family: var(--font-sinhala);
  font-size: 0.58rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--accent);
  opacity: 0.8;
  white-space: nowrap;
  transition: opacity var(--duration) var(--ease);
}

.nav-brand:hover .nav-logo-sinhala {
  opacity: 1;
}

.nav-wordmark {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.25s;
}

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

.nav-cta {
  margin-left: 12px;
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text-primary);
  transition: all 0.3s var(--ease);
}

/* ========================================================================
   HERO
   Full-bleed photography with editorial text overlay.
   Inspired by David Chipperfield / Foster + Partners website conventions.
   ======================================================================== */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    180deg,
    rgba(26, 22, 18, 0.10) 0%,
    rgba(26, 22, 18, 0.25) 50%,
    rgba(26, 22, 18, 0.70) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 80px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  max-width: 780px;
  margin-bottom: 24px;
}

.hero-lead {
  font-size: 1.15rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  max-width: 560px;
  margin-bottom: 40px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-cta .btn-fill {
  background: #fff;
  color: var(--text-primary);
}

.hero-cta .btn-fill:hover {
  background: var(--accent);
  color: #fff;
}

.hero-cta .btn-outline {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.hero-cta .btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
}

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 28px;
  right: clamp(20px, 4vw, 60px);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero-scroll span {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  writing-mode: vertical-rl;
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  width: 100%;
  height: 100%;
  background: #fff;
  animation: scroll-pulse 2s var(--ease) infinite;
}

@keyframes scroll-pulse {
  0% { top: -100%; }
  50% { top: 0; }
  100% { top: 100%; }
}

/* ========================================================================
   PHILOSOPHY
   Bawa's principles articulated with restraint.
   ======================================================================== */
.philosophy {
  background: var(--bg-warm);
}

.philosophy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.philosophy-text .divider {
  margin: 20px 0 28px;
}

.philosophy-principles {
  display: grid;
  gap: 28px;
  margin-top: 40px;
}

.principle {
  display: flex;
  gap: 20px;
}

.principle-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 1.1rem;
}

.principle h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.principle p {
  font-size: 0.88rem;
  color: var(--text-tertiary);
  line-height: 1.6;
}

.philosophy-image {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.philosophy-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 3 / 4;
}

/* ========================================================================
   SERVICES / PACKAGES
   Clean editorial cards. No flashy gradients — let restraint speak.
   ======================================================================== */
.services {
  background: var(--bg-primary);
}

.services-header {
  max-width: 600px;
  margin-bottom: 60px;
}

.packages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.package-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 40px 36px;
  position: relative;
  transition: all var(--duration) var(--ease);
  display: flex;
  flex-direction: column;
}

.package-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.package-card.featured {
  border-color: var(--accent);
}

.package-label {
  position: absolute;
  top: -12px;
  right: 24px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: var(--radius);
}

.package-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.package-price {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.package-desc {
  font-size: 0.88rem;
  color: var(--text-tertiary);
  margin-bottom: 28px;
  line-height: 1.6;
}

.package-features {
  flex-grow: 1;
  margin-bottom: 32px;
}

.package-features li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.package-features li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ========================================================================
   PORTFOLIO — Full-bleed editorial gallery
   Photography as the foundation. Let work speak.
   ======================================================================== */
.portfolio {
  background: var(--bg-dark);
  color: var(--text-inverse);
}

.portfolio .t-subheading {
  color: rgba(250, 248, 245, 0.5);
}

.portfolio-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 60px;
}

.portfolio-filters {
  display: flex;
  gap: 8px;
}

.filter-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  padding: 8px 20px;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.25s var(--ease);
}

.filter-btn:hover,
.filter-btn.active {
  border-color: #fff;
  color: #fff;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: pointer;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.portfolio-item:hover img {
  transform: scale(1.05);
}

.portfolio-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(26, 22, 18, 0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}

.portfolio-item:hover .portfolio-item-overlay {
  opacity: 1;
}

.portfolio-item-overlay h4 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: #fff;
  margin-bottom: 4px;
}

.portfolio-item-overlay p {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.65);
}

/* ========================================================================
   PROCESS — Bawa's theatrical unfolding of space
   ======================================================================== */
.process {
  background: var(--bg-primary);
}

.process-timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  position: relative;
}

/* The connecting line */
.process-timeline::before {
  content: '';
  position: absolute;
  top: 27px;
  left: 27px;
  right: 27px;
  height: 1px;
  background: var(--border);
}

.step {
  text-align: center;
  position: relative;
}

.step-marker {
  width: 54px;
  height: 54px;
  margin: 0 auto 20px;
  border: 1px solid var(--border-hover);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--bg-primary);
  position: relative;
  z-index: 2;
  transition: all 0.3s var(--ease);
}

.step:hover .step-marker {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.step h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.step p {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  line-height: 1.5;
  max-width: 180px;
  margin: 0 auto;
}

/* ========================================================================
   EXPAT HUB
   ======================================================================== */
.expat {
  background: var(--bg-warm);
}

.expat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.expat-countries {
  display: flex;
  gap: 12px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.country-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
}

.expat-countries-note {
  font-size: 0.86rem;
  line-height: 1.68;
  color: var(--text-secondary);
  margin: -6px 0 28px;
  max-width: 46ch;
}

.expat-features {
  display: grid;
  gap: 20px;
}

.expat-feature {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.feature-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 8px;
}

.expat-feature h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.expat-feature p {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.expat-image {
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.expat-image img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

/* ========================================================================
   ABOUT — The Team
   ======================================================================== */
.about {
  background: var(--bg-primary);
}

/* ---- Brand meaning: the studio's Sinhala name and its origin ---- */
.brand-meaning {
  max-width: 680px;
  margin: 0 0 72px;
  padding-left: 28px;
  border-left: 2px solid var(--accent-border);
}

.brand-meaning-sinhala {
  font-family: var(--font-sinhala);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--accent);
  margin-bottom: 12px;
}

.brand-meaning-text {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.brand-meaning-text em {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.12em;
  color: var(--text-primary);
}

@media (max-width: 720px) {
  .brand-meaning {
    padding-left: 20px;
    margin-bottom: 48px;
  }
  .brand-meaning-sinhala {
    font-size: 1.6rem;
  }
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 48px 40px;
  transition: all var(--duration) var(--ease);
}

.about-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.about-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.about-card-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 4px;
}

.about-card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.about-card p {
  font-size: 0.9rem;
  color: var(--text-tertiary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.about-card ul li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.about-card ul li::before {
  content: '—';
  color: var(--accent);
  font-weight: 700;
}

/* ========================================================================
   CONSULTATION MODAL
   ======================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 22, 18, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  /* Flex + `margin: auto` on .modal centres the card when it fits and lets the
     overlay scroll when it does not. The previous `grid` + `place-items: center`
     clipped anything taller than the viewport with no way to reach it. */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 32px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-card);
  width: 100%;
  max-width: 560px;
  padding: 48px 44px;
  position: relative;
  margin: auto;
  box-shadow: var(--shadow-lg);
}

@media (max-width: 720px) {
  .modal-overlay {
    padding: 20px 12px;
  }

  .modal {
    padding: 36px 22px;
  }
}

/* Short laptop windows: trim vertical padding rather than push the submit
   button off-screen. */
@media (max-height: 760px) {
  .modal {
    padding: 34px 30px;
  }
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 1.5rem;
  color: var(--text-tertiary);
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-intro {
  margin-bottom: 28px;
}



.form-group {
  margin-bottom: 15px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.25s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
}

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

/* Two columns collapse below 560px — at 360px they were rendering 103px wide. */
@media (max-width: 560px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* Optional-field marker in labels */
.form-optional {
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-tertiary);
  opacity: 0.7;
}

/* Honeypot — visually removed, still reachable by bots scanning the DOM */
.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Submission feedback */
.form-status {
  margin-top: 14px;
  font-size: 0.88rem;
  line-height: 1.55;
  text-align: center;
  min-height: 0;
}

.form-status:empty {
  margin-top: 0;
}

.form-status[data-tone="success"] {
  color: var(--olive);
}

.form-status[data-tone="error"] {
  color: var(--accent);
}

.form-status[data-tone="info"] {
  color: var(--text-secondary);
}

.form-fallback {
  margin-top: 16px;
  font-size: 0.85rem;
  line-height: 1.6;
  text-align: center;
  color: var(--text-tertiary);
}

/* ---- Post-submission success panel ---- */
.form-success {
  text-align: center;
  padding: 8px 0 4px;
}

.form-success[hidden] {
  display: none;
}

.form-success-mark {
  width: 60px;
  height: 60px;
  margin: 0 auto 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(107, 124, 94, 0.12);
  border: 1px solid rgba(107, 124, 94, 0.35);
  color: var(--olive);
  font-size: 1.6rem;
  line-height: 1;
}

.form-success-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0 0 14px;
}

.form-success-text {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin: 0 auto 28px;
  max-width: 40ch;
}

.form-success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-success-actions .btn {
  width: 100%;
  justify-content: center;
}

.form-fallback a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-fallback a:hover {
  color: var(--accent-hover);
}

/* ========================================================================
   FOOTER — quiet, minimal
   ======================================================================== */
.footer {
  background: var(--bg-dark);
  color: rgba(250, 248, 245, 0.5);
  padding: 60px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(250, 248, 245, 0.8);
  letter-spacing: 0.04em;
}

.footer-brand-sinhala {
  font-family: var(--font-sinhala);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(250, 248, 245, 0.45);
  margin-left: 6px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
}

.footer-links a {
  font-size: 0.82rem;
  color: rgba(250, 248, 245, 0.4);
  transition: color 0.25s;
}

.footer-links a:hover {
  color: rgba(250, 248, 245, 0.8);
}

.footer-copy {
  font-size: 0.78rem;
  color: rgba(250, 248, 245, 0.3);
}

/* ========================================================================
   RESPONSIVE
   ======================================================================== */
@media (max-width: 1024px) {
  :root {
    --section-gap: 100px;
  }

  .packages-grid,
  .portfolio-grid {
    grid-template-columns: 1fr 1fr;
  }

  .process-timeline {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  
  .process-timeline::before {
    display: none;
  }
}

@media (max-width: 768px) {
  :root {
    --section-gap: 80px;
  }

  /* Nav */
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 24px clamp(20px, 4vw, 60px);
    gap: 16px;
  }

  /* Hero */
  .hero { min-height: 500px; }
  .hero-scroll { display: none; }

  /* Grids */
  .philosophy-grid,
  .expat-grid,
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .packages-grid,
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .process-timeline {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .portfolio-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .portfolio-filters {
    flex-wrap: wrap;
  }

  /* Footer */
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 18px;
  }

  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 22px;
  }

  /* Long lines (email link, copyright) must wrap rather than force
     the page wider than the viewport. */
  .footer-copy {
    max-width: 100%;
  }
}

/* ---- Small phones ---- */
@media (max-width: 480px) {
  /* Keep the logo lockup from crowding the nav toggle */
  .nav-logo svg {
    width: 26px;
    height: 26px;
  }

  .nav-logo-sinhala {
    font-size: 0.5rem;
  }

  .nav-wordmark {
    font-size: 1rem;
  }

  .nav-brand {
    gap: 10px;
  }

  /* 48px is too heavy at 320-480px — it runs to five lines */
  .hero-title {
    font-size: clamp(2.25rem, 8vw, 3rem);
  }

  .hero-lead {
    font-size: 1rem;
  }
}

/* ==========================================================================
   MOBILE FORM — must stay LAST so it beats the base .form-input rules
   ========================================================================== */
@media (max-width: 560px) {
  .modal-overlay {
    padding: 0;
    align-items: flex-start;
  }

  /* Full-bleed sheet: a 1013px form has no business sitting in a 366px card
     with 22px gutters on a 390px phone. */
  .modal {
    width: 100%;
    max-width: none;
    min-height: 100%;
    margin: 0;
    padding: 56px 20px 40px;
  }

  /* The sheet scrolls, so keep the dismiss control reachable at all times. */
  .modal-close {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
  }

  /* 16px is the floor: below it iOS Safari zooms the page on focus and the
     form looks broken mid-tap. */
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px;
    padding: 14px;
    border-radius: 0;
  }

  .form-select {
    /* Native arrow sits too close to the edge at 16px type. */
    padding-right: 40px;
  }

  .form-textarea {
    min-height: 104px;
  }

  .form-label {
    font-size: 0.7rem;
    letter-spacing: 0.07em;
    margin-bottom: 7px;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .modal-intro {
    font-size: 0.95rem;
    margin-bottom: 22px;
  }

  #fsubmit {
    padding: 16px;
    font-size: 0.95rem;
  }

  .form-fallback {
    font-size: 0.82rem;
    margin-top: 18px;
  }
}
