/* Art direction: Bespoke software agency → Minimal & premium, boutique consultancy
   Palette: Cool slate/charcoal base with deep blue-green (deep sea) single accent. Restrained. Surfaces like high-quality paper.
   Typography: Gambarino (display, Fontshare) + Satoshi (body, Fontshare) — sophisticated but approachable
   Density: Spacious — generous whitespace, editorial breathing room */

/* ============================================================
   TYPE SCALE
   ============================================================ */
:root {
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);

  /* SPACING — 4px base */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* FONTS */
  --font-display: 'Gambarino', Georgia, serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;

  /* RADIUS */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* TRANSITIONS */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* CONTENT WIDTHS */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;
}

/* ============================================================
   LIGHT MODE — Cool slate surfaces, deep sea accent
   ============================================================ */
:root, [data-theme="light"] {
  /* Surfaces — cool slate with paper-like warmth */
  --color-bg:               #f4f5f7;
  --color-surface:          #f8f9fa;
  --color-surface-2:        #ffffff;
  --color-surface-offset:   #eceef1;
  --color-surface-offset-2: #e4e7eb;
  --color-surface-dynamic:  #dce0e5;
  --color-divider:          #d0d4da;
  --color-border:           #c4c9d1;

  /* Text — charcoal ink */
  --color-text:             #1a1e26;
  --color-text-muted:       #5c6370;
  --color-text-faint:       #9ca3af;
  --color-text-inverse:     #f4f5f7;

  /* Primary Accent — Deep Sea Blue-Green */
  --color-primary:          #1a5c5e;
  --color-primary-hover:    #134547;
  --color-primary-active:   #0e3234;
  --color-primary-highlight: #d0e3e3;

  /* Error */
  --color-error:            #b43a3a;
  --color-error-hover:      #8f2d2d;
  --color-error-active:     #6b2121;
  --color-error-highlight:  #f0d4d4;

  /* Success */
  --color-success:          #2a7a3e;
  --color-success-hover:    #1f5c2e;
  --color-success-active:   #154020;
  --color-success-highlight: #d2e8d6;

  /* Warning */
  --color-warning:          #9a6318;
  --color-warning-hover:    #7a4e12;
  --color-warning-active:   #5a3a0e;
  --color-warning-highlight: #f0e2c6;

  /* Shadows — cool-toned */
  --shadow-sm: 0 1px 2px oklch(0.2 0.01 240 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 240 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.01 240 / 0.12);
}

/* ============================================================
   DARK MODE — Deep charcoal, desaturated deep sea accent
   ============================================================ */
[data-theme="dark"] {
  --color-bg:               #111318;
  --color-surface:          #161820;
  --color-surface-2:        #1b1e26;
  --color-surface-offset:   #1a1c24;
  --color-surface-offset-2: #20232c;
  --color-surface-dynamic:  #282b34;
  --color-divider:          #252830;
  --color-border:           #353840;

  --color-text:             #d0d3da;
  --color-text-muted:       #7c818c;
  --color-text-faint:       #50555f;
  --color-text-inverse:     #1a1e26;

  --color-primary:          #4a9ea1;
  --color-primary-hover:    #2d8487;
  --color-primary-active:   #1d6a6d;
  --color-primary-highlight: #1e3234;

  --color-error:            #d06060;
  --color-error-hover:      #b84a4a;
  --color-error-active:     #9a3636;
  --color-error-highlight:  #3a2020;

  --color-success:          #5ab06a;
  --color-success-hover:    #3f9450;
  --color-success-active:   #2c783c;
  --color-success-highlight: #1e3024;

  --color-warning:          #c49540;
  --color-warning-hover:    #b07e2a;
  --color-warning-active:   #96681a;
  --color-warning-highlight: #352a18;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
}

/* System preference fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:               #111318;
    --color-surface:          #161820;
    --color-surface-2:        #1b1e26;
    --color-surface-offset:   #1a1c24;
    --color-surface-offset-2: #20232c;
    --color-surface-dynamic:  #282b34;
    --color-divider:          #252830;
    --color-border:           #353840;
    --color-text:             #d0d3da;
    --color-text-muted:       #7c818c;
    --color-text-faint:       #50555f;
    --color-text-inverse:     #1a1e26;
    --color-primary:          #4a9ea1;
    --color-primary-hover:    #2d8487;
    --color-primary-active:   #1d6a6d;
    --color-primary-highlight: #1e3234;
    --color-error:            #d06060;
    --color-error-hover:      #b84a4a;
    --color-error-active:     #9a3636;
    --color-error-highlight:  #3a2020;
    --color-success:          #5ab06a;
    --color-success-hover:    #3f9450;
    --color-success-active:   #2c783c;
    --color-success-highlight: #1e3024;
    --color-warning:          #c49540;
    --color-warning-hover:    #b07e2a;
    --color-warning-active:   #96681a;
    --color-warning-highlight: #352a18;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
  }
}

/* ============================================================
   GLOBAL STYLES
   ============================================================ */

/* Containers */
.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.container--narrow {
  max-width: var(--content-default);
}

/* Section spacing */
.section {
  padding-block: clamp(var(--space-12), 8vw, var(--space-32));
}

/* Typography utility */
.display-font {
  font-family: var(--font-display);
}

.body-font {
  font-family: var(--font-body);
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-bottom: 1px solid oklch(from var(--color-border) l c h / 0.3);
}

.header--scrolled {
  box-shadow: var(--shadow-sm);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-4);
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}

.header__logo-text {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-interactive);
}

.nav__link:hover {
  color: var(--color-text);
}

.nav__link--active {
  color: var(--color-text);
}

/* Mobile nav */
.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}

@media (max-width: 768px) {
  .nav__toggle { display: flex; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-4);
    gap: var(--space-2);
    box-shadow: var(--shadow-md);
  }
  .nav--open { display: flex; }
  .nav__link {
    padding: var(--space-3) var(--space-4);
    width: 100%;
    border-radius: var(--radius-md);
  }
  .nav__link:hover, .nav__link:active {
    background: var(--color-surface-offset);
  }
}

/* Theme toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: color var(--transition-interactive),
              background var(--transition-interactive);
}

.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-offset);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding-block: clamp(var(--space-16), 12vw, var(--space-32));
  position: relative;
  overflow: hidden;
}

.hero__content {
  max-width: 800px;
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--color-text);
  margin-bottom: var(--space-6);
  line-height: 1.1;
}

.hero__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  max-width: 60ch;
  line-height: 1.5;
}

.hero__actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.hero__pattern {
  position: absolute;
  top: 50%;
  right: -5%;
  transform: translateY(-50%);
  width: 500px;
  height: 500px;
  opacity: 0.06;
  pointer-events: none;
}

@media (max-width: 768px) {
  .hero__pattern { display: none; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-interactive),
              color var(--transition-interactive),
              box-shadow var(--transition-interactive),
              transform var(--transition-interactive);
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }

.btn--primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.btn--primary:hover {
  background: var(--color-primary-hover);
}

.btn--secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn--secondary:hover {
  background: var(--color-surface-offset);
  border-color: var(--color-text-muted);
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.section-desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 60ch;
  line-height: 1.6;
}

/* ============================================================
   PROBLEM SECTION
   ============================================================ */
.problem {
  background: var(--color-surface);
}

.problem__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: var(--space-6);
  margin-top: var(--space-10);
}

.problem__card {
  padding: var(--space-6);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  border: 1px solid oklch(from var(--color-border) l c h / 0.5);
}

.problem__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-highlight);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  color: var(--color-primary);
}

.problem__metric {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-primary);
  margin-bottom: var(--space-2);
  line-height: 1.2;
}

.problem__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.problem__text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ============================================================
   SERVICES SECTION
   ============================================================ */
.services__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-10);
}

@media (min-width: 768px) {
  .services__grid {
    grid-template-columns: repeat(3, 1fr);
  }
  /* Last two cards span 1.5 columns each using subgrid-like positioning */
  .services__grid .service-card:nth-child(4) {
    grid-column: 1 / 2;
  }
  .services__grid .service-card:nth-child(5) {
    grid-column: 2 / 3;
  }
}

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

.service-card {
  padding: var(--space-6);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid oklch(from var(--color-border) l c h / 0.3);
  transition: box-shadow var(--transition-interactive),
              border-color var(--transition-interactive);
}

.service-card:hover {
  box-shadow: var(--shadow-md);
  border-color: oklch(from var(--color-border) l c h / 0.6);
}

.service-card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-highlight);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  color: var(--color-primary);
}

.service-card__title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.service-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: var(--space-4);
}

.service-card__metric {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  padding: var(--space-1) var(--space-3);
  background: var(--color-primary-highlight);
  border-radius: var(--radius-full);
  display: inline-block;
}

/* ============================================================
   ROI / METRICS STRIP
   ============================================================ */
.roi {
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}

.roi__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
  text-align: center;
}

@media (max-width: 768px) {
  .roi__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }
}

@media (max-width: 480px) {
  .roi__grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

.roi__item {}

.roi__value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  margin-bottom: var(--space-1);
  line-height: 1.2;
}

.roi__label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ============================================================
   HOW WE WORK
   ============================================================ */
.process__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  margin-top: var(--space-10);
}

@media (max-width: 768px) {
  .process__grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

.process-step {
  position: relative;
}

.process-step__number {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-primary);
  opacity: 0.4;
  margin-bottom: var(--space-3);
  line-height: 1;
}

.process-step__title {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.process-step__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ============================================================
   INDUSTRIES
   ============================================================ */
.industries__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: var(--space-6);
  margin-top: var(--space-10);
}

.industry-card {
  padding: var(--space-6);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid oklch(from var(--color-border) l c h / 0.3);
}

.industry-card__icon {
  width: 40px;
  height: 40px;
  margin-bottom: var(--space-4);
  color: var(--color-primary);
}

.industry-card__title {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.industry-card__text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ============================================================
   CONTACT SECTION
   ============================================================ */
.contact {
  background: var(--color-surface);
}

.contact__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: start;
}

@media (max-width: 768px) {
  .contact__inner {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-group label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}

.form-group input,
.form-group textarea {
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: var(--color-text);
  transition: border-color var(--transition-interactive),
              box-shadow var(--transition-interactive);
}

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

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.15);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.contact__note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding-block: var(--space-12);
  border-top: 1px solid var(--color-divider);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.footer__logo-text {
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
}

.footer__info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.footer__info a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-interactive);
}

.footer__info a:hover {
  color: var(--color-primary);
}

@media (max-width: 768px) {
  .footer__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .footer__info {
    align-items: center;
  }
}

/* ============================================================
   SCROLL ANIMATIONS
   ============================================================ */
.fade-in {
  opacity: 1;
}

@supports (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
}

@keyframes reveal-fade {
  to { opacity: 1; }
}

/* Staggered fade for grids */
.fade-in-stagger > * {
  opacity: 1;
}

@supports (animation-timeline: scroll()) {
  .fade-in-stagger > * {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
}

/* ============================================================
   SKIP LINK
   ============================================================ */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  z-index: 100;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-4);
}

/* Decorative geometric pattern */
.geo-pattern {
  opacity: 0.04;
  pointer-events: none;
}
