/* Gatewaystack Hub — minimal distinctive theme */
:root {
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text: #1a2332;
  --color-text-muted: #5c6778;
  --color-accent: #2d6a6a;
  --color-accent-hover: #245656;
  --color-accent-light: #e8f4f4;
  --color-border: #e2e6eb;
  --color-error: #b83232;
  --color-success: #2d6a4f;
  --font-serif: 'Libre Baskerville', Georgia, serif;
  --font-sans: 'Source Sans 3', system-ui, sans-serif;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --radius: 4px;
  --shadow: 0 2px 12px rgba(26, 35, 50, 0.06);
  --max-width: 1120px;
  --header-height: 72px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover { color: var(--color-accent-hover); }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.25;
  margin-top: 0;
}

h1 { font-size: clamp(2rem, 5vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); margin-bottom: var(--space-md); }
h3 { font-size: 1.25rem; margin-bottom: var(--space-sm); }

p { margin: 0 0 var(--space-sm); }

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.logo span { color: var(--color-accent); }

.nav-desktop {
  display: flex;
  gap: var(--space-md);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-desktop a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}

.nav-desktop a:hover,
.nav-desktop a[aria-current="page"] {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  padding: var(--space-xs) var(--space-sm);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  border-radius: var(--radius);
}

.nav-mobile {
  display: none;
  position: absolute;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-md);
  box-shadow: var(--shadow);
}

.nav-mobile.is-open { display: block; }

.nav-mobile ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-mobile li { margin-bottom: var(--space-sm); }

.nav-mobile a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  display: block;
  padding: var(--space-xs) 0;
}

@media (max-width: 768px) {
  .nav-desktop { display: none; }
  .nav-toggle { display: block; }
}

/* Footer */
.site-footer {
  background: var(--color-text);
  color: #c8cdd4;
  padding: var(--space-xl) 0 var(--space-lg);
  margin-top: var(--space-2xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.site-footer h3 {
  color: #fff;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-sm);
}

.site-footer a { color: #a8d4d4; }
.site-footer a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-md);
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: space-between;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
}

.footer-legal a {
  color: #c8cdd4;
  text-decoration: none;
}

.footer-legal a:hover { color: #fff; text-decoration: underline; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-outline:hover {
  background: var(--color-accent-light);
  color: var(--color-accent-hover);
}

/* Hero variants */
.hero {
  padding: var(--space-2xl) 0;
}

.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.hero-split .hero-text { max-width: 540px; }

.hero-lead {
  font-size: 1.1875rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.hero-image {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  object-fit: cover;
  width: 100%;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

@media (max-width: 768px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero { padding: var(--space-xl) 0; }
}

/* Sections */
.section {
  padding: var(--space-xl) 0;
}

.section-alt { background: var(--color-surface); }

.section-header {
  max-width: 640px;
  margin-bottom: var(--space-lg);
}

.section-label {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.card:hover { box-shadow: var(--shadow); }

.card-image {
  aspect-ratio: 16/10;
  object-fit: cover;
  width: 100%;
}

.card-body { padding: var(--space-md); }

.card-body h3 { margin-top: 0; }

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-link:hover h3 { color: var(--color-accent); }

/* Testimonials */
.testimonial {
  background: var(--color-surface);
  border-left: 3px solid var(--color-accent);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.testimonial cite {
  display: block;
  margin-top: var(--space-sm);
  font-style: normal;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.story-block {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.story-block:last-child { border-bottom: none; }

/* Forms */
.form-group { margin-bottom: var(--space-md); }

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  font-size: 0.9375rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.form-error {
  color: var(--color-error);
  font-size: 0.875rem;
  margin-top: var(--space-xs);
  display: none;
}

.form-error.is-visible { display: block; }

.form-status {
  padding: var(--space-md);
  border-radius: var(--radius);
  margin-top: var(--space-md);
  display: none;
}

.form-status.is-visible { display: block; }

.form-status.success {
  background: #e8f5ee;
  color: var(--color-success);
  border: 1px solid #b8dcc8;
}

.form-status.error {
  background: #fce8e8;
  color: var(--color-error);
  border: 1px solid #e8b8b8;
}

.script-error {
  background: #fce8e8;
  color: var(--color-error);
  padding: var(--space-sm);
  border-radius: var(--radius);
  margin: var(--space-sm) 0;
  font-size: 0.875rem;
  display: none;
}

.script-error.is-visible { display: block; }

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-md);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  z-index: 1000;
  display: none;
}

.cookie-banner.is-visible { display: block; }

.cookie-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  justify-content: space-between;
}

.cookie-text {
  flex: 1;
  min-width: 240px;
  font-size: 0.9375rem;
  margin: 0;
}

.cookie-actions {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
}

/* Page headers */
.page-header {
  padding: var(--space-xl) 0 var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-lg);
}

.page-header h1 { margin-bottom: var(--space-sm); }

.page-header .lead {
  color: var(--color-text-muted);
  font-size: 1.125rem;
  max-width: 640px;
}

/* Pricing */
.pricing-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
}

.pricing-table th,
.pricing-table td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.pricing-table th {
  background: var(--color-accent-light);
  font-weight: 600;
}

.pricing-note {
  background: var(--color-accent-light);
  padding: var(--space-md);
  border-radius: var(--radius);
  margin: var(--space-md) 0;
}

/* Legal pages */
.legal-content h2 {
  font-size: 1.375rem;
  margin-top: var(--space-lg);
}

.legal-content ul { padding-left: var(--space-md); }

.legal-content li { margin-bottom: var(--space-xs); }

.cookies-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  margin: var(--space-md) 0;
}

.cookies-table th,
.cookies-table td {
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  text-align: left;
}

.cookies-table th { background: var(--color-accent-light); }

/* Blog */
.blog-meta {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.article-content h2 {
  font-size: 1.375rem;
  margin-top: var(--space-lg);
}

.article-content img {
  border-radius: var(--radius);
  margin: var(--space-md) 0;
}

.article-hero {
  aspect-ratio: 21/9;
  object-fit: cover;
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: var(--space-lg);
}

/* 404 */
.error-page {
  text-align: center;
  padding: var(--space-2xl) 0;
  min-height: 50vh;
}

.error-page h1 { font-size: 4rem; margin-bottom: var(--space-sm); }

/* Process timeline */
.process-steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
}

.process-steps li {
  position: relative;
  padding-left: 3rem;
  padding-bottom: var(--space-lg);
  border-left: 2px solid var(--color-border);
  margin-left: 1rem;
}

.process-steps li:last-child { border-left-color: transparent; }

.process-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: -1rem;
  top: 0;
  width: 2rem;
  height: 2rem;
  background: var(--color-accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Contact layout */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

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

.contact-info address {
  font-style: normal;
  line-height: 1.8;
}

.contact-info p { margin-bottom: var(--space-md); }

/* Utility */
.text-muted { color: var(--color-text-muted); }
.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }
