:root {
  /* Dynamic Palette (Strictly No Blue - Lilac Lens Grid Style) */
  --bg-canvas: #f3f0fa; /* Pale lilac base */
  --bg-surface: #ffffff; /* White bento tiles */
  --bg-surface-hover: #faf8fc;
  --text-primary: #1c1917; /* Slate/Stone text, zero blue */
  --text-muted: #57534e; /* Lighter warm stone */
  --accent-primary: #86198f; /* Deep fuchsia */
  --accent-secondary: #d946ef; /* Bright fuchsia */
  --border-subtle: rgba(28, 25, 23, 0.15);
  
  /* Advanced UI Micro-Interactions & Depth */
  --ease-kinetic: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-elevation: 0 12px 32px -4px rgba(28, 25, 23, 0.15);
  --glow-accent: 0 0 24px -4px var(--accent-primary);
  --glass-backdrop: blur(16px) saturate(180%);
  
  --site-margin: 2vw;
}

@media (min-width: 1024px) {
  :root {
    --site-margin: 3vw;
  }
}

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

body {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.7;
  padding: var(--site-margin);
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
p { margin-bottom: 1.5rem; }
a { color: var(--accent-primary); text-decoration: none; transition: color 0.3s var(--ease-kinetic); }
a:hover { color: var(--accent-secondary); }
img { display: block; max-width: 100%; height: auto; border-radius: 0; object-fit: cover; }

/* The Exhibition Frame (Lilac Lens Grid rule) */
.site-frame {
  position: relative;
  background-color: var(--bg-canvas);
  border: 1px solid var(--text-primary);
  min-height: calc(100vh - (var(--site-margin) * 2));
  display: flex;
  flex-direction: column;
}

/* Header (Moves out of view, transparent over hero, turns solid via JS when scrolling) */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  padding: 1.5rem 2rem;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.4s var(--ease-kinetic), border-bottom 0.4s var(--ease-kinetic);
}

.site-header.scrolled {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Strict Left-Aligned Brand */
.brand {
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-primary);
  margin-right: auto; /* Forces left alignment */
}

/* Navigation */
.main-nav {
  display: none;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-primary);
}

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

@media (min-width: 768px) {
  .main-nav { display: block; }
  .mobile-toggle { display: none; }
}

/* Mobile 3-dot Nav */
.mobile-toggle {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0 0.5rem;
}

.mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: none;
  flex-direction: column;
  padding: 2rem;
  box-shadow: var(--shadow-elevation);
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  font-size: 1.2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-subtle);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-primary);
}

/* Buttons (Outlined, Square ends, Uppercase) */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border: 2px solid var(--accent-primary);
  background: transparent;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 0; /* Zero radius */
  transition: all 0.4s var(--ease-kinetic);
  text-align: center;
}

.btn:hover {
  background: var(--accent-primary);
  color: var(--bg-surface);
  transform: translateY(-2px);
  box-shadow: var(--glow-accent);
}

/* Layout Engine: The Bento Grid */
main {
  flex-grow: 1;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 4rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(300px, auto);
  }
  .bento-grid .span-2 { grid-column: span 2; }
  .bento-grid .span-3 { grid-column: span 3; }
  .bento-grid .span-4 { grid-column: span 4; }
  .bento-grid .row-2 { grid-row: span 2; }
}

/* Feature Cards (Zero radius, Colored label badge) */
.bento-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.5s var(--ease-kinetic), box-shadow 0.5s var(--ease-kinetic);
}

.bento-card:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: var(--shadow-elevation);
}

.card-img-wrapper {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: hidden;
}

.bento-card.row-2 .card-img-wrapper {
  height: 100%;
  flex-grow: 1;
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  transition: transform 0.8s var(--ease-kinetic);
}

.bento-card:hover .card-img-wrapper img {
  transform: scale(1.05);
}

.card-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  background: var(--accent-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  z-index: 2;
}

.card-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: center;
}

.card-content h3 {
  margin-bottom: 1rem;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(28,25,23,0.8) 0%, rgba(28,25,23,0.4) 100%);
}

.hero-bg img {
  width: 100%;
  height: 100%;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  color: #fff;
}

.hero-content h1 {
  color: #fff;
  text-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.hero-content p {
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
  opacity: 0.9;
}

.hero-content .btn {
  border-color: #fff;
  color: #fff;
}
.hero-content .btn:hover {
  background: #fff;
  color: var(--text-primary);
  box-shadow: 0 0 24px -4px #fff;
}

/* Editorial Content Structure (Reading width constraint) */
.article-header {
  padding: 8rem 2rem 4rem;
  text-align: center;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.article-content {
  max-width: 72ch;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.article-content h2, .article-content h3 {
  margin-top: 2.5rem;
}

.article-content img {
  margin: 2.5rem 0;
  border: 1px solid var(--border-subtle);
}

.article-content ul {
  margin: 1.5rem 0 1.5rem 2rem;
}
.article-content li {
  margin-bottom: 0.5rem;
}

/* Camera Profiler Form */
.tool-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 3rem;
  margin-top: 2rem;
}

.form-group {
  margin-bottom: 2rem;
}

.form-group label {
  display: block;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}

.form-control {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: inherit;
  border-radius: 0;
  transition: border-color 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.tool-output {
  margin-top: 2rem;
  display: none;
}

.tool-output.active {
  display: block;
}

.output-box {
  background: var(--text-primary);
  color: #fff;
  padding: 1.5rem;
  font-family: monospace;
  white-space: pre-wrap;
  margin-bottom: 1.5rem;
  border-radius: 0;
}

/* Table Wrappers */
.table-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 1rem;
  border: 1px solid var(--border-subtle);
  text-align: left;
}
th {
  background: var(--bg-surface-hover);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--text-primary);
  padding: 4rem 2rem 2rem;
  background: var(--bg-surface);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

.footer-col h4 {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.75rem;
}

.footer-col a {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.footer-col a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 4rem;
  margin-top: 4rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Kinetic Scroll Reveals */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-kinetic), transform 0.8s var(--ease-kinetic);
}

.reveal.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

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