:root {
  color-scheme: dark;
  --bg: #0b1020;
  --surface: #111a31;
  --surface-soft: #1b2848;
  --text: #f0f4fa;
  --text-soft: #c0cadf;
  --accent: #7dd3fc;
  --accent-strong: #38bdf8;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.container {
  width: min(1100px, 92vw);
  margin-inline: auto;
}

/* ── Header ── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(16px) saturate(1.4);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease;
}

.nav {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

.nav-links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links > li > a,
.nav-links > li > .nav-dropdown-trigger,
.nav-links > li > .nav-contact-trigger {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-links > li > a:hover,
.nav-links > li > a:focus-visible,
.nav-links > li > .nav-dropdown-trigger:hover,
.nav-links > li > .nav-dropdown-trigger:focus-visible,
.nav-links > li > .nav-contact-trigger:hover,
.nav-links > li > .nav-contact-trigger:focus-visible {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* ── Dropdowns ── */

.has-dropdown {
  position: relative;
}

.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.5rem;
  list-style: none;
  margin: 0;
  opacity: 0;
  translate: 0 -6px;
  transition: opacity 0.2s ease, translate 0.2s ease;
}

.dropdown.is-open {
  display: block;
  opacity: 1;
  translate: 0 0;
}

.dropdown li a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  transition: background 0.15s ease;
}

.dropdown li a:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

.dropdown-empty {
  padding: 0.55rem 0.75rem;
  color: var(--text-soft);
  font-size: 0.85rem;
  font-style: italic;
}

/* ── Hero / Gallery ── */

.hero {
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: end start;
  overflow: clip;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.1) contrast(1.03);
  transition: opacity 1s ease-in-out;
}

.hero-img--front {
  opacity: 1;
  z-index: 1;
}

.hero-img--back {
  opacity: 0;
  z-index: 0;
}

.hero-media.is-crossfade .hero-img--front {
  opacity: 0;
}

.hero-media.is-crossfade .hero-img--back {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--bg) 0%, transparent 40%),
    linear-gradient(to bottom, color-mix(in srgb, var(--bg) 30%, transparent) 0%, transparent 25%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 0 0 4rem;
  width: min(1100px, 92vw);
  margin-inline: auto;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  line-height: 1.15;
  margin: 0 0 0.85rem;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  max-width: 14ch;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}

.hero-caption {
  margin: 0 0 1.5rem;
  color: var(--text-soft);
  font-size: 0.95rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.gallery-counter {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--text-soft);
  min-width: 4ch;
  text-align: center;
}

.cta-btn,
.ghost-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.cta-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #001018;
  backdrop-filter: none;
}

.cta-btn:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.ghost-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}


/* ── Contact Overlay ── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}

.overlay-panel {
  position: relative;
  width: min(520px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 2rem;
  transform: translateY(16px);
  transition: transform 0.3s ease;
}

.overlay.is-open .overlay-panel {
  transform: translateY(0);
}

.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.overlay-header h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  margin: 0;
}

.overlay-close {
  background: none;
  border: none;
  color: var(--text-soft);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  line-height: 1;
  transition: color 0.2s ease, background 0.2s ease;
}

.overlay-close:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.overlay-subtitle {
  color: var(--text-soft);
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
}

#contact-form {
  max-width: none;
}

.overlay-panel--wide {
  width: min(680px, 92vw);
}

.overlay-panel h3 {
  font-size: 1rem;
  margin: 1.5rem 0 0.4rem;
}

.overlay-panel h3:first-of-type {
  margin-top: 0.75rem;
}

.overlay-panel p {
  margin: 0 0 0.6rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-soft);
}

.overlay-source {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-soft);
  opacity: 0.6;
}

.footer-link {
  background: none;
  border: none;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--accent);
}

.form-row {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

label {
  font-weight: 600;
  font-size: 0.9rem;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.form-feedback {
  min-height: 1.2rem;
  margin-top: 0.8rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}

/* ── Footer ── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2.5rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--text-soft);
  font-size: 0.88rem;
}

/* ── Mobile ── */

@media (max-width: 700px) {
  html {
    font-size: 16px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle {
    min-width: 48px;
    min-height: 48px;
    padding: 12px;
  }

  .nav-toggle span {
    width: 26px;
    height: 3px;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 0.5rem 0;
    gap: 0;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links > li > a,
  .nav-links > li > .nav-dropdown-trigger,
  .nav-links > li > .nav-contact-trigger {
    min-height: 52px;
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    width: 100%;
    text-align: left;
    font-size: 1.15rem;
  }

  .dropdown {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    padding: 0 0 0.5rem 1rem;
    background: transparent;
  }

  .dropdown li a {
    min-height: 48px;
    padding: 0.85rem 1.25rem;
    font-size: 1.1rem;
  }

  .dropdown-empty {
    padding: 0.85rem 1.25rem;
    font-size: 1.1rem;
  }

  .dropdown.is-open {
    translate: 0;
  }

  h1 {
    font-size: clamp(1.6rem, 5.5vw, 2.4rem);
  }

  .hero-content {
    padding-bottom: 3rem;
  }

  .overlay-panel {
    padding: 1.5rem;
    max-height: 85vh;
    overflow-y: auto;
  }

  .overlay-panel p {
    font-size: 1rem;
    line-height: 1.6;
  }

  #contact-form input,
  #contact-form textarea {
    font-size: 16px;
  }

  .ghost-btn,
  .cta-btn {
    min-height: 44px;
    padding: 0.65rem 1.25rem;
  }
}

@media (max-width: 700px) and (orientation: landscape) {
  h1 {
    font-size: clamp(1.4rem, 4vw, 2rem);
  }

  .hero-content {
    padding-bottom: 2rem;
  }
}

@media (max-width: 480px) {
  .brand {
    font-size: 1.2rem;
  }

  .hero-content {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }
}

@media (max-width: 400px) {
  .footer-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .footer-link {
    padding: 0.5rem 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* ── JS-based mobile detection (for framed viewports) ── */

.is-mobile {
  font-size: 16px;
}

.is-mobile .nav-toggle {
  display: flex;
  min-width: 48px;
  min-height: 48px;
  padding: 12px;
}

.is-mobile .nav-toggle span {
  width: 26px;
  height: 3px;
}

.is-mobile .nav-links {
  display: none;
  flex-direction: column;
  align-items: stretch;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 0.5rem 0;
  gap: 0;
}

.is-mobile .nav-links.is-open {
  display: flex;
}

.is-mobile .nav-links > li > a,
.is-mobile .nav-links > li > .nav-dropdown-trigger,
.is-mobile .nav-links > li > .nav-contact-trigger {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  width: 100%;
  text-align: left;
  font-size: 1.15rem;
}

.is-mobile .dropdown {
  position: static;
  transform: none;
  box-shadow: none;
  border: none;
  padding: 0 0 0.5rem 1rem;
  background: transparent;
}

.is-mobile .dropdown li a {
  min-height: 48px;
  padding: 0.85rem 1.25rem;
  font-size: 1.1rem;
}

.is-mobile .dropdown-empty {
  padding: 0.85rem 1.25rem;
  font-size: 1.1rem;
}

.is-mobile .dropdown.is-open {
  translate: 0;
}

.is-mobile h1 {
  font-size: clamp(1.6rem, 5.5vw, 2.4rem);
}

.is-mobile .hero-content {
  padding-bottom: 3rem;
}

.is-mobile .overlay-panel {
  padding: 1.5rem;
  max-height: 85vh;
  overflow-y: auto;
}

.is-mobile .overlay-panel p {
  font-size: 1rem;
  line-height: 1.6;
}

.is-mobile #contact-form input,
.is-mobile #contact-form textarea {
  font-size: 16px;
}

.is-mobile .ghost-btn,
.is-mobile .cta-btn {
  min-height: 44px;
  padding: 0.65rem 1.25rem;
}

.is-mobile .brand {
  font-size: 1.2rem;
}
