/* ==========================================================================
   Technologies Touraine — Concept B: Nordic Architectural (Warm Minimalist CSS)
   ========================================================================== */

/* --- Custom Variables & Architectural Tokens --- */
:root {
  --bg: #F7F6F3;              /* Warm Chalk/Bone White */
  --surface: #FFFFFF;         /* Plain White */
  --surface-alt: #EFEFEA;     /* Slightly darker warm tone */

  --border: #121212;          /* Bold solid charcoal black borders */
  --border-subtle: #C5C3BB;   /* Soft stone outline border */

  --text: #121212;            /* Absolute charcoal black */
  --text-secondary: #4A4640;  /* Warm stone charcoal */
  --text-muted: #827E74;      /* Dim stone gray */

  --primary: #004F34;         /* Rich Deep Forest Emerald Accent */
  --primary-hover: #003623;
  --accent: #B45309;          /* Warning Amber */
  --green-glow: #15803d;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Playfair Display", Georgia, serif;
  --font-mono: "JetBrains Mono", monospace;

  --radius: 0px;              /* Sharp, 100% geometric square edges for architectural feel */
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  background-color: var(--bg);
  overflow-x: hidden;
}

/* Architectural Scrollbars */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
  border-left: 1.5px solid var(--border);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* --- Core Utilities --- */
a {
  color: var(--text);
  text-decoration: underline;
  transition: all 0.15s ease;
}
a:hover {
  color: var(--primary);
  text-shadow: none;
}

em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
}

.text-stone { color: var(--text-secondary); }
.text-green { color: var(--green-glow); }
.text-center { text-align: center; }
.font-mono { font-family: var(--font-mono); }

/* --- Structural Section Layouts --- */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 100px 32px;
}
.section-alt {
  background-color: var(--surface-alt);
  border-top: 1.5px solid var(--border);
  border-bottom: 1.5px solid var(--border);
  max-width: 100%;
}
.section-alt > div,
.section-alt > section {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  margin-bottom: 64px;
  max-width: 800px;
  border-left: 3px solid var(--border);
  padding-left: 24px;
}
.section-header.text-center {
  margin-left: auto;
  margin-right: auto;
  border-left: none;
  padding-left: 0;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 32px;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 8px;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 680px;
}

/* --- Header System --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 48px);
  min-height: 80px;
  height: auto;
  padding: 14px clamp(28px, 4vw, 56px);
  background-color: var(--bg);
  border-bottom: 1.5px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 1 auto;
  min-width: 0;
  text-decoration: none;
}
.brand-box {
  width: 14px;
  height: 14px;
  background-color: var(--border);
  flex: 0 0 14px;
}
.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.serif-brand {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(18px, 2.4vw, 36px);
  flex: 0 1 auto;
  margin-left: auto;
  min-width: 0;
}

.nav a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.nav a:hover {
  color: var(--primary);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 20px;
  background-color: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.header-cta:hover {
  background-color: var(--border);
  color: var(--bg);
}

@media (max-width: 1020px) {
  .site-header {
    padding: 14px 32px;
  }

  .nav {
    display: none;
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: 14px 24px;
    min-height: 70px;
  }
}

@media (max-width: 420px) {
  .site-header {
    gap: 14px;
    padding: 14px 18px;
  }

  .brand {
    gap: 10px;
  }

  .brand-name {
    font-size: 1rem;
  }

  .brand-tech {
    display: none;
  }

  .header-cta {
    min-height: 42px;
    padding: 0 16px;
  }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 28px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-black {
  background-color: var(--border);
  color: var(--bg);
  border: 1.5px solid var(--border);
}
.btn-black:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-outline {
  background-color: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  background-color: var(--border);
  color: var(--bg);
}

.btn-block {
  display: flex;
  width: 100%;
}

/* --- Hero Section --- */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 120px 32px 100px;
}

.hero-content {
  max-width: 900px;
}

.hero-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 24px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}

.hero-sub {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 780px;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 20px;
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
  }
}

/* --- Services (MODULE_01) --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px;
  margin-top: 16px;
}

.service-card {
  background-color: var(--surface);
  border: 1.5px solid var(--border);
  padding: 48px 36px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}
.service-card:hover {
  transform: translateY(-2px);
  box-shadow: 6px 6px 0px var(--border);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 24px;
}
.service-index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.service-card h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.service-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
  flex-grow: 1;
}

/* Technical Specification Ledger Accordion */
.tech-spec-drawer {
  border: 1.5px solid var(--border);
  background-color: var(--bg);
}
.tech-spec-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}
.tech-spec-trigger::-webkit-details-marker {
  display: none;
}
.trigger-icon {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.tech-spec-drawer[open] .trigger-icon {
  transform: rotate(-135deg);
}

.tech-spec-content {
  padding: 20px;
  border-top: 1.5px solid var(--border);
  font-size: 0.85rem;
  background-color: var(--surface);
}
.tech-spec-content ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tech-spec-content li {
  line-height: 1.6;
  list-style: square;
  margin-left: 16px;
}
.tech-spec-content strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* --- Proprietary R&D Lab (MODULE_02) --- */
.lab-container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: start;
  padding: 80px 32px;
}

@media (max-width: 960px) {
  .lab-container {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

.lab-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.lab-badge {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  padding: 6px 14px;
  letter-spacing: 0.05em;
  background-color: var(--surface);
}

.lab-lead {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--text);
  line-height: 1.5;
}

.compliance-card {
  margin-top: 16px;
  background-color: var(--surface);
  border: 1.5px solid var(--accent);
  padding: 28px;
}
.compliance-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}
.compliance-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Monochrome Technical Telemetry Dashboard */
.lab-telemetry {
  background-color: var(--surface);
  border: 1.5px solid var(--border);
  padding: 32px;
  box-shadow: 6px 6px 0px var(--border);
}

.telemetry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 24px;
}
.telemetry-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
}
.telemetry-state {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  padding: 2px 8px;
}

.telemetry-metrics {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.metric-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border-subtle);
  padding-bottom: 8px;
}
.metric-key {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.metric-val {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.telemetry-log {
  background-color: var(--surface-alt);
  border: 1.5px solid var(--border);
  height: 120px;
  padding: 16px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.log-line {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  color: var(--text-secondary);
  animation: slide-up-log 10s linear infinite;
}
.log-index {
  color: var(--text-muted);
  margin-right: 6px;
}

.telemetry-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 60px;
  margin-top: 24px;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 4px;
}
.chart-line {
  width: 10%;
  height: var(--val);
  background-color: var(--border-subtle);
}
.chart-line:nth-child(odd) {
  background-color: var(--primary);
}
.animate-bar {
  animation: dance-bars-nordic 2s ease-in-out infinite alternate;
}

/* --- Protocols (MODULE_03) --- */
.protocols-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 40px;
}

.protocol-card {
  background-color: var(--surface);
  border: 1.5px solid var(--border);
  padding: 40px 32px;
  transition: all 0.2s ease;
}
.protocol-card:hover {
  transform: translateY(-2px);
  box-shadow: 4px 4px 0px var(--border);
}

.protocol-index {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 1.5px solid var(--primary);
  padding-bottom: 4px;
  margin-bottom: 24px;
}

.protocol-card h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}
.protocol-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --- Contact Secure Gateway (MODULE_04) --- */
.contact-gateway {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  background-color: var(--surface);
  border: 1.5px solid var(--border);
  padding: 48px;
  box-shadow: 8px 8px 0px var(--border);
}

@media (max-width: 860px) {
  .contact-gateway {
    grid-template-columns: 1fr;
    padding: 32px;
    gap: 40px;
  }
}

.gateway-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.gateway-badge {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  padding: 4px 12px;
}

.gateway-info h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.gateway-info p {
  font-size: 1rem;
  color: var(--text-secondary);
}

.gateway-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 12px;
}
.gateway-details div {
  border-bottom: 1.5px solid var(--surface-alt);
  padding-bottom: 12px;
}
.gateway-details dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.gateway-details dd {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

/* Parameters container */
.gateway-parameters {
  background-color: var(--surface-alt);
  border: 1.5px solid var(--border-subtle);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.gateway-parameters h3 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--primary);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-form label span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  border: 1.5px solid var(--border-subtle);
  background-color: var(--surface);
  color: var(--text);
  font: inherit;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.contact-form textarea {
  min-height: 160px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--border);
  box-shadow: 3px 3px 0px var(--border);
  outline: none;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-muted);
}

.contact-form select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--border) 50%),
    linear-gradient(135deg, var(--border) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.trap-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cf-turnstile {
  min-height: 65px;
}

.form-status {
  min-height: 24px;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
}

.form-note {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

@media (max-width: 620px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .gateway-parameters {
    padding: 24px;
  }
}

/* --- Footer System --- */
.site-footer {
  max-width: var(--max-width);
  margin: 60px auto 0;
  padding: 32px;
  border-top: 1.5px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .site-footer {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

.footer-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.footer-divider {
  opacity: 0.3;
}

.back-to-top {
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
}
.back-to-top:hover {
  color: var(--primary);
}

/* --- Animations & Keyframes --- */
@keyframes slide-up-log {
  0% { transform: translateY(0); }
  100% { transform: translateY(-80px); }
}

@keyframes dance-bars-nordic {
  0% { height: 10%; }
  33% { height: 75%; }
  66% { height: 35%; }
  100% { height: 95%; }
}
