/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: 'SF Pro Text', 'PingFang SC', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  color: #F5F0EB;
  background-color: #2C2C2E;
  min-height: 100vh;
}
ul, ol {
  list-style: none;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  display: block;
  max-width: 100%;
}
button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}
:focus-visible {
  outline: 2px solid #007AFF;
  outline-offset: 2px;
  border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
  }
}

/* === CSS Variables === */
:root {
  --primary-100: #D4C9B8;
  --primary-200: #B8A99A;
  --primary-300: #9A8A7C;
  --primary-400: #7C6D60;
  --accent-100: #6B8E23;
  --accent-200: #556B2F;
  --accent-300: #8B4513;
  --accent-400: #D2691E;
  --bg-light: #F5F0EB;
  --bg-dark: #2C2C2E;
  --text-primary: #1C1C1E;
  --text-secondary: #636366;
  --border: #C7C7CC;
  --state-hover: #E5E5EA;
  --state-active: #007AFF;
  --font-heading: 'SF Pro Display', 'PingFang SC', system-ui, sans-serif;
  --font-body: 'SF Pro Text', 'PingFang SC', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Menlo', 'Cascadia Code', monospace;
  --container-max: 1200px;
  --gap: 2rem;
}

/* === Container === */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* === Skip Link === */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 2000;
  padding: 0.5rem 1rem;
  background: var(--bg-light);
  color: var(--text-primary);
  border-radius: 0 0 6px 6px;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* === Site Header & Capsule Nav === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  padding: 1rem 1.5rem 0;
  pointer-events: none;
}
.nav-capsule {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.5rem 1.5rem;
  background: rgba(245, 240, 235, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 2.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid rgba(154, 138, 124, 0.25);
  transition: box-shadow 0.2s, border-color 0.2s;
  width: auto;
  max-width: calc(100% - 2rem);
}
.nav-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.nav-logo::before {
  content: "⚡";
  margin-right: 0.3em;
  font-size: 1.1em;
  color: var(--accent-400);
}
.nav-tagline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  border-left: 1px solid var(--border);
  padding-left: 1rem;
  display: none;
}
@media (min-width: 640px) {
  .nav-tagline {
    display: inline;
  }
}
.nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}
.nav-link {
  display: block;
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  border-radius: 1.5rem;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.nav-link:hover,
.nav-link:focus-visible {
  background: var(--state-hover);
  border-color: var(--primary-300);
}
.nav-link[aria-current="page"] {
  color: var(--state-active);
  border-bottom: 2px solid var(--state-active);
  border-radius: 0;
  background: transparent;
  padding-bottom: calc(0.35rem - 2px);
}
.nav-cta {
  white-space: nowrap;
  margin-left: 0.25rem;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 2.25rem;
  height: 2.25rem;
  gap: 4px;
  padding: 0.25rem;
  border-radius: 50%;
  background: transparent;
  transition: background 0.2s;
}
.nav-toggle:hover {
  background: var(--state-hover);
}
.toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* === Mobile Nav === */
@media (max-width: 767px) {
  .site-header {
    padding: 0.75rem 1rem 0;
  }
  .nav-capsule {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 1.5rem;
    width: 100%;
    max-width: 100%;
  }
  .nav-toggle {
    display: flex;
    margin-left: auto;
  }
  .nav-list {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 0 0.5rem;
    border-top: 1px solid var(--border);
  }
  .nav-cta {
    display: none;
    width: 100%;
    margin-left: 0;
    text-align: center;
    padding: 0.5rem 0;
  }
  .nav-capsule[data-open="true"] .nav-list {
    display: flex;
  }
  .nav-capsule[data-open="true"] .nav-cta {
    display: block;
  }
  .nav-capsule[data-open="true"] .toggle-bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  .nav-capsule[data-open="true"] .toggle-bar:nth-child(2) {
    opacity: 0;
  }
  .nav-capsule[data-open="true"] .toggle-bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
  .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    width: 100%;
  }
  .nav-link[aria-current="page"] {
    border-bottom: none;
    border-left: 3px solid var(--state-active);
    padding-left: calc(0.75rem - 3px);
    background: var(--state-hover);
  }
  .nav-tagline {
    display: none;
  }
}

/* === Site Footer === */
.site-footer {
  background: var(--bg-dark);
  border-top: 1px solid rgba(154, 138, 124, 0.3);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: 4rem;
  color: var(--primary-100);
}
.footer-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 768px) {
  .footer-content {
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
  }
}
.footer-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--bg-light);
  display: inline-block;
  margin-bottom: 0.5rem;
}
.footer-tagline {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--primary-300);
  margin-bottom: 0.75rem;
}
.footer-trust {
  font-size: 0.8rem;
  color: var(--primary-300);
  line-height: 1.5;
  max-width: 28em;
}
.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-link {
  font-size: 0.875rem;
  color: var(--primary-100);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
  display: inline-block;
  padding: 0.15rem 0;
}
.footer-link:hover,
.footer-link:focus-visible {
  color: var(--bg-light);
  border-bottom-color: var(--accent-400);
}
.footer-contact p {
  font-size: 0.8rem;
  color: var(--primary-200);
  margin-bottom: 0.35rem;
  line-height: 1.5;
}
.footer-bottom {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(154, 138, 124, 0.2);
  font-size: 0.75rem;
  color: var(--primary-400);
  font-family: var(--font-mono);
}
@media (max-width: 767px) {
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  .footer-content {
    text-align: center;
  }
  .footer-links ul {
    align-items: center;
  }
  .footer-trust {
    margin-left: auto;
    margin-right: auto;
  }
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: 1px solid var(--primary-300);
  border-radius: 2rem;
  background: transparent;
  color: var(--text-primary);
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
  cursor: pointer;
  text-align: center;
  line-height: 1.4;
}
.btn:hover,
.btn:focus-visible {
  border-color: var(--accent-400);
  background: rgba(210, 105, 30, 0.06);
}
.btn-primary {
  background: var(--accent-400);
  border-color: var(--accent-400);
  color: var(--bg-light);
  font-weight: 700;
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent-300);
  border-color: var(--accent-300);
  color: var(--bg-light);
  box-shadow: 0 2px 12px rgba(139, 69, 19, 0.3);
}

/* === Section Numbering === */
.section-number {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  color: var(--accent-100);
  line-height: 1;
  display: block;
  margin-bottom: 0.25rem;
  opacity: 0.85;
  letter-spacing: -0.03em;
}
.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--bg-light);
  margin: 0 0 0.75rem;
  line-height: 1.25;
}

/* === Breadcrumb === */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--primary-300);
  padding: 0.75rem 0;
}
.breadcrumb a {
  color: var(--primary-100);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  border-bottom-color: var(--accent-400);
  color: var(--bg-light);
}
.breadcrumb span {
  color: var(--primary-400);
}

/* === Content Grid === */
.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}
@media (min-width: 640px) {
  .content-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .content-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* === Image Container (base) === */
.img-container {
  position: relative;
  overflow: hidden;
  background: var(--primary-400);
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  border: 1px solid var(--primary-300);
}
.img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* === Frame View (base for framed hero) === */
.frame-view {
  position: relative;
  border: 1px solid var(--primary-300);
  padding: 2rem;
  background: rgba(44, 44, 46, 0.7);
  border-radius: 4px;
}
.frame-view::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 24px;
  height: 24px;
  border-top: 2px solid var(--accent-400);
  border-left: 2px solid var(--accent-400);
  border-radius: 2px 0 0 0;
}
.frame-view::after {
  content: "";
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 24px;
  height: 24px;
  border-bottom: 2px solid var(--accent-400);
  border-right: 2px solid var(--accent-400);
  border-radius: 0 0 2px 0;
}

/* === Scroll Progress Bar === */
[data-progress-bar] {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-100), var(--state-active));
  z-index: 3000;
  transition: width 0.1s linear;
  pointer-events: none;
  will-change: width;
}
@media (prefers-reduced-motion: reduce) {
  [data-progress-bar] {
    display: none;
  }
}

/* === Generic Text Helpers === */
.text-body {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--primary-100);
  line-height: 1.7;
}
.text-mono {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--primary-200);
}
.text-secondary {
  color: var(--primary-300);
  font-size: 0.9rem;
}
