.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: max(var(--container-padding), env(safe-area-inset-left));
  padding-right: max(var(--container-padding), env(safe-area-inset-right));
}

.container--wide {
  max-width: var(--container-wide);
}

section {
  position: relative;
  padding: var(--space-section) 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 900;
  margin-bottom: var(--space-lg);
}

/* Grid helpers */
.grid {
  display: grid;
  gap: var(--space-lg);
}

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

@media (max-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid--2,
  .grid--3 { grid-template-columns: 1fr; }

  section {
    padding: var(--space-xl) 0;
  }

  .section-label {
    font-size: 0.65rem;
    margin-bottom: var(--space-sm);
  }

  .section-title {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-md);
  }
}

/* Animated gradient text */
.text-shimmer {
  background: var(--gradient-accent);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s ease-in-out infinite alternate;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* Interactive glow orbs */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  z-index: 0;
  will-change: transform;
}

.glow-orb--lime {
  background: rgba(200, 255, 0, 0.12);
}

.glow-orb--indigo {
  background: rgba(91, 91, 255, 0.1);
}

/* ── Frame corners (cinematographic viewport) ── */
.frame-corners {
  position: absolute;
  inset: 1.5rem;
  pointer-events: none;
  z-index: 2;
}

.frame-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.frame-corner::before,
.frame-corner::after {
  content: '';
  position: absolute;
  background: var(--accent);
}

/* L shape: 2px lines */
.frame-corner::before { width: 2px; height: 0; transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s; }
.frame-corner::after  { height: 2px; width: 0; transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.25s; }

.frame-corner--tl { top: 0; left: 0; }
.frame-corner--tl::before { top: 0; left: 0; }
.frame-corner--tl::after  { top: 0; left: 0; }

.frame-corner--tr { top: 0; right: 0; }
.frame-corner--tr::before { top: 0; right: 0; }
.frame-corner--tr::after  { top: 0; right: 0; }

.frame-corner--bl { bottom: 0; left: 0; }
.frame-corner--bl::before { bottom: 0; left: 0; }
.frame-corner--bl::after  { bottom: 0; left: 0; }

.frame-corner--br { bottom: 0; right: 0; }
.frame-corner--br::before { bottom: 0; right: 0; }
.frame-corner--br::after  { bottom: 0; right: 0; }

/* Animation: when section visible */
.frame-corners.active .frame-corner { opacity: 1; }
.frame-corners.active .frame-corner::before { height: 28px; }
.frame-corners.active .frame-corner::after  { width: 28px; }

@media (max-width: 768px) {
  .frame-corners { inset: 0.6rem; }
  .frame-corner { width: 16px; height: 16px; }
  .frame-corners.active .frame-corner::before { height: 16px; }
  .frame-corners.active .frame-corner::after  { width: 16px; }
}

/* ── Global grain overlay ── */
.global-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 280px 280px;
  animation: grainShift 7s steps(8) infinite;
}

@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  10%  { transform: translate(-5%, -10%); }
  20%  { transform: translate(-15%, 5%); }
  30%  { transform: translate(7%, -25%); }
  40%  { transform: translate(-5%, 25%); }
  50%  { transform: translate(-15%, 10%); }
  60%  { transform: translate(15%, 0%); }
  70%  { transform: translate(0%, 15%); }
  80%  { transform: translate(3%, -15%); }
  90%  { transform: translate(-10%, 10%); }
  100% { transform: translate(0, 0); }
}

/* ── Global grid lines ── */
.global-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 90px 90px;
  opacity: 0.9;
}

@media (max-width: 768px) {
  .global-grid { background-size: 60px 60px; }
}

@media (prefers-reduced-motion: reduce) {
  .global-grain { animation: none; }
}

/* Subtle top border on non-hero sections */
section:not(.hero) {
  border-top: 1px solid var(--border);
}

/* Visually hidden */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
