:root {
  /* Common variables */
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 12px;
  --max: 1120px;
  --gap: 32px;

  /* Color Scheme - Dark (Default) */
  color-scheme: dark;
  --bg: #0e141f;          /* Navy Graphite solid */
  --surface: #141c2b;     /* Slightly lighter for cards */
  --card: #141c2b;
  --card-border: rgba(255,255,255,0.08);

  --text: #e2e8f0;        /* High contrast */
  --muted: #94a3b8;       /* Slate 400 */
  --muted2: #64748b;      /* Slate 500 */

  --accent: #0ea5e9;      /* Sky 500 - Primary */
  --accent-hover: #0284c7;
  --accent2: #3b82f6;     /* Blue 500 - Secondary */
  --success: #10b981;     /* Emerald 500 - Success only */

  --border: rgba(255,255,255,0.08);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);

  --header-bg: rgba(14, 20, 31, 0.95);
  --header-border: var(--border);

  --input-bg: rgba(0,0,0,0.2);
  --input-border: var(--border);
  --input-text: #fff;

  --badge-bg: rgba(255,255,255,0.05);
  --badge-border: rgba(255,255,255,0.1);

  --btn-secondary-bg: transparent;
  --btn-secondary-border: var(--border);
  --btn-secondary-hover-bg: rgba(255,255,255,0.03);

  --step-num-bg: rgba(14, 165, 233, 0.15);
  --step-num-color: var(--accent);

  /* Gradient for bg - dark */
  --bg-image: radial-gradient(circle at 50% 0%, rgba(14, 165, 233, 0.08), transparent 40%),
              linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f8fafc;          /* Slate 50 */
  --surface: #ffffff;     /* White */
  --card: #ffffff;
  --card-border: #e2e8f0; /* Slate 200 */

  --text: #0f172a;        /* Slate 900 */
  --muted: #475569;       /* Slate 600 */
  --muted2: #64748b;      /* Slate 500 */

  --accent: #0284c7;      /* Sky 600 - Darker for light mode contrast */
  --accent-hover: #0369a1;
  --accent2: #2563eb;     /* Blue 600 */
  --success: #059669;     /* Emerald 600 */

  --border: #e2e8f0;      /* Slate 200 */
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --header-bg: rgba(255, 255, 255, 0.95);
  --header-border: #e2e8f0;

  --input-bg: #f1f5f9;    /* Slate 100 */
  --input-border: #cbd5e1; /* Slate 300 */
  --input-text: #0f172a;

  --badge-bg: #f1f5f9;
  --badge-border: #cbd5e1;

  --btn-secondary-bg: #fff;
  --btn-secondary-border: #cbd5e1;
  --btn-secondary-hover-bg: #f1f5f9;

  --step-num-bg: rgba(2, 132, 199, 0.1);
  --step-num-color: var(--accent);

  /* Gradient for bg - light */
  --bg-image: radial-gradient(circle at 50% 0%, rgba(2, 132, 199, 0.05), transparent 40%);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--bg-image);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
}

a{ color: inherit; text-decoration: none; transition: color 0.2s; }
a:hover{ color: var(--accent); }
img{ max-width:100%; height:auto; display:block; }

.container{
  width: min(var(--max), calc(100% - 32px)); /* Increased side padding slightly for mobile */
  margin: 0 auto;
}

/* Header */
.header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--header-border);
  transition: background-color 0.3s, border-color 0.3s;
}
.header .wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 16px 0;
  gap: 12px; /* Reduced gap for mobile */
}
.brand{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 0; /* Allow shrinking on mobile */
  text-decoration: none;
  color: var(--text);
}
.brand .logo{
  width: 32px; /* Smaller logo on mobile */
  height: 32px;
  object-fit: contain;
}
.brand .logo.logo-large {
  width: 64px;
  height: 64px;
}
.brand .name{
  display:flex;
  flex-direction:column;
  line-height:1.2;
}
.brand .name strong{
  font-size: 15px; /* Slightly smaller */
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand .name span{
  font-size: 13px;
  color: var(--muted);
  display: none; /* Hide slogan on mobile to save space */
}

/* Navigation - Mobile First (Base) */
.nav{
  display:none; /* Hidden by default on mobile */
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--header-bg);
  flex-direction: column;
  padding: 24px;
  border-bottom: 1px solid var(--header-border);
  box-shadow: var(--shadow-lg);
}
.nav a{
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
  padding: 12px 0;
  display: block;
}
.nav a.active, .nav a:hover{
  color: var(--text);
  text-decoration:none;
}

/* Show menu when header has .open class */
.header.open .nav {
  display: flex;
}

.menu-toggle{
  display:block; /* Visible on mobile */
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  order: 2; /* Put toggle on the right */
  margin-left: 0;
}

/* Actions */
.actions{
  display:flex;
  align-items:center;
  gap: 8px;
  margin-left: auto; /* Push to right, next to brand (before toggle) */
  order: 1;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 8px 14px; /* Slightly smaller default padding */
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration:none;
  transition: all 0.2s ease;
  line-height: 1;
}
.btn.primary{
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
}
.btn.primary:hover{
  background: var(--accent-hover);
}
.btn.secondary{
  background: var(--btn-secondary-bg);
  border: 1px solid var(--btn-secondary-border);
  color: var(--text);
}
.btn.secondary:hover{
  background: var(--btn-secondary-hover-bg);
  border-color: var(--accent);
}
.btn.small{
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
}
.btn.small:hover{
  color: var(--text);
  background: rgba(125,125,125,0.1);
}

/* Hero */
.hero{
  padding: 48px 0;
}
.hero .grid{
  display:grid;
  grid-template-columns: 1fr; /* Stacked on mobile */
  gap: 32px;
  align-items: center;
}
.hero h1{
  margin: 0 0 16px;
  font-size: clamp(2rem, 5vw, 3rem); /* 32px to 48px */
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text);
}
.hero p{
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}
.hero .actions{
  margin-top: 24px;
  margin-left: 0; /* Reset actions margin in hero */
}

/* Cards & Panels */
.panel, .card{
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.panel h3, .card h3{
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.panel ul, .card ul{
  margin: 0;
  padding: 0 0 0 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}
.panel li, .card li{ margin: 8px 0; }

.card:hover{
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.card .link{
  display:inline-flex;
  margin-top: 16px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  align-items: center;
  gap: 4px;
}
.card .link:hover{
  text-decoration: underline;
}

/* Sections */
.section{
  padding: 48px 0;
}
.section h2{
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3vw, 1.8rem); /* 24px to ~29px */
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.section .lead{
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 16px;
  max-width: 70ch;
}

.cards{
  display:grid;
  grid-template-columns: 1fr; /* Mobile: 1 col */
  gap: var(--gap);
}

/* Steps */
.steps{
  display:grid;
  grid-template-columns: 1fr; /* Mobile: 1 col */
  gap: var(--gap);
}
.step{
  padding: 0;
  border: none;
  background: transparent;
}
.step .num{
  width: 32px; height: 32px;
  border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  background: var(--step-num-bg);
  color: var(--step-num-color);
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 14px;
}
.step h3{
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
}
.step p{
  font-size: 14px;
  color: var(--muted);
}

/* Lists & Split Layouts */
.split{
  display:grid;
  grid-template-columns: 1fr; /* Mobile: 1 col */
  gap: var(--gap);
  align-items: start;
}
.list{
  background: transparent;
  border: none;
  padding: 0;
}
.list h3{
  font-size: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 16px;
  color: var(--text);
}
.list ul {
  padding-left: 20px;
  color: var(--muted);
}
.list li {
  margin-bottom: 8px;
}
.list strong {
  color: var(--text);
}

/* Footer */
.footer{
  margin-top: 60px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 32px 0;
  transition: background-color 0.3s, border-color 0.3s;
}
.footer .wrap{
  display:flex;
  flex-direction: column; /* Stacked on mobile */
  justify-content:space-between;
  align-items: flex-start;
  gap: 24px;
  color: var(--muted2);
  font-size: 14px;
}
.footer a:hover{ color: var(--accent); }

/* Forms */
.form{
  display:grid;
  gap: 16px;
}
.field label{
  display:block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 500;
}
.field input, .field textarea, .field select{
  width:100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--input-text);
  outline: none;
  font-family: var(--font);
  transition: border-color 0.2s, background-color 0.3s, color 0.3s;
}
.field input:focus, .field textarea:focus{
  border-color: var(--accent);
}
.field textarea{ min-height: 120px; resize: vertical; }

.notice{
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 8px;
  padding: 16px;
  color: var(--text);
  font-size: 14px;
}
.notice a{ color: var(--accent); font-weight: 500; }

.badge{
  display:inline-flex;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  font-size: 12px;
  color: var(--muted);
}

.group .grid{
  display:grid;
  grid-template-columns: 1fr; /* Mobile: 1 col */
  gap: var(--gap);
}

/* Utilities */
.kpis{
  display:flex;
  flex-wrap:wrap;
  gap: 16px;
  margin-top: 24px;
}
.kpi{
  font-size: 14px;
  color: var(--muted);
  display:flex;
  gap: 6px;
  align-items: center;
}
.kpi strong{ color: var(--text); font-weight: 600; }
.kpi::before{
  content: "";
  display:block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* --- Media Queries --- */

/* Tablet (>= 768px) */
@media (min-width: 768px) {
  .container {
    width: min(var(--max), calc(100% - 48px));
  }

  .header .wrap {
    gap: 24px;
  }

  .brand .logo {
    width: 40px;
    height: 40px;
  }
  .brand .logo.logo-large {
    width: 80px;
    height: 80px;
  }

  .brand .name strong {
    font-size: 16px;
  }

  .brand .name span {
    display: block; /* Show slogan */
  }

  .hero .grid {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }

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

  .split {
    grid-template-columns: 1fr 1fr;
  }

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

  .footer .wrap {
    flex-direction: row;
    align-items: center;
  }
}

/* Desktop (>= 1024px) */
@media (min-width: 1024px) {
  .brand {
    min-width: 200px;
  }

  .hero .grid {
    grid-template-columns: 1.1fr 0.9fr;
  }

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

  .steps {
    grid-template-columns: repeat(4, 1fr);
  }

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

  /* Desktop Menu */
  .menu-toggle {
    display: none;
  }

  .nav {
    display: flex;
    position: static;
    flex-direction: row;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    width: auto;
    gap: 24px;
  }

  .nav a {
    padding: 4px 0;
    font-size: 14px;
  }

  .actions {
    margin-left: 0;
    order: 0;
    gap: 16px;
  }

  .btn {
    padding: 10px 18px; /* Restore desktop padding */
  }
}
