/* ===================================================
   HOC Consulting — Shared Design System
   =================================================== */

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

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  hanging-punctuation: first last;
  scroll-padding-top: 5rem;
}

/* --- Design Tokens --- */
:root, [data-theme="light"] {
  /* Type Scale (fluid) */
  --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);

  /* 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: 'Cabinet Grotesk', 'Inter', sans-serif;
  --font-body:    'General Sans', 'Inter', sans-serif;

  /* Surfaces — warm light palette */
  --color-bg:              #F8F9FA;
  --color-surface:         #FFFFFF;
  --color-surface-2:       #F1F3F5;
  --color-surface-offset:  #E9ECEF;
  --color-border:          #DEE2E6;
  --color-divider:         #E9ECEF;

  /* Text */
  --color-text:        #1A1D23;
  --color-text-muted:  #6B7280;
  --color-text-faint:  #ADB5BD;
  --color-text-inverse:#FFFFFF;

  /* Primary — Teal/Cyan (tech, trustworthy) */
  --color-primary:         #0B7285;
  --color-primary-hover:   #095C6A;
  --color-primary-active:  #074652;
  --color-primary-subtle:  #E6F4F6;

  /* Semantic */
  --color-success: #2B8A3E;
  --color-warning: #E67700;
  --color-error:   #C92A2A;

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

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 250ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --color-bg:              #101114;
  --color-surface:         #1A1B1F;
  --color-surface-2:       #212226;
  --color-surface-offset:  #2A2B30;
  --color-border:          #33353A;
  --color-divider:         #2A2B30;

  --color-text:        #E4E5E7;
  --color-text-muted:  #8B8D94;
  --color-text-faint:  #55575E;
  --color-text-inverse:#101114;

  --color-primary:         #3BC9DB;
  --color-primary-hover:   #22B8CF;
  --color-primary-active:  #15AABF;
  --color-primary-subtle:  #162A2E;

  --color-success: #51CF66;
  --color-warning: #FFA94D;
  --color-error:   #FF6B6B;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:              #101114;
    --color-surface:         #1A1B1F;
    --color-surface-2:       #212226;
    --color-surface-offset:  #2A2B30;
    --color-border:          #33353A;
    --color-divider:         #2A2B30;
    --color-text:        #E4E5E7;
    --color-text-muted:  #8B8D94;
    --color-text-faint:  #55575E;
    --color-text-inverse:#101114;
    --color-primary:         #3BC9DB;
    --color-primary-hover:   #22B8CF;
    --color-primary-active:  #15AABF;
    --color-primary-subtle:  #162A2E;
    --color-success: #51CF66;
    --color-warning: #FFA94D;
    --color-error:   #FF6B6B;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  }
}

/* --- Body --- */
body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; line-height: 1.2; }
p, li, figcaption { text-wrap: pretty; max-width: 72ch; }

::selection {
  background: color-mix(in srgb, var(--color-primary) 25%, transparent);
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

button { cursor: pointer; background: none; border: none; }

a, button, [role="button"], input, textarea, select {
  transition: color var(--transition-fast),
              background var(--transition-fast),
              border-color var(--transition-fast),
              box-shadow var(--transition-fast),
              opacity var(--transition-fast);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
}

/* ===================================================
   HEADER & NAVIGATION
   =================================================== */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: color-mix(in srgb, var(--color-bg) 85%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
}

.site-header nav {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
  min-width: 0;
}

.logo-mark {
  width: 184px;
  height: 40px;
  flex-shrink: 0;
}

.logo-text {
  display: none;
}

/* Desktop nav */
.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-8);
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  position: relative;
  padding-block: var(--space-1);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width var(--transition-base);
  border-radius: 1px;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-text);
}

.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  width: 100%;
}

/* Header CTA */
.header-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

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

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  flex-shrink: 0;
}

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

/* Mobile hamburger */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  z-index: 1001;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-fast);
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-btn.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===================================================
   BUTTONS
   =================================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: transparent;
  color: var(--color-text);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1.5px solid var(--color-border);
  cursor: pointer;
}

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

/* ===================================================
   SECTIONS & LAYOUT
   =================================================== */
.section {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
  padding-inline: var(--space-6);
}

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

.container {
  max-width: var(--content-wide);
  margin: 0 auto;
}

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

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

/* Section headings */
.section-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
  text-align: inherit;
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 56ch;
  line-height: 1.7;
}

/* ===================================================
   HERO SECTION
   =================================================== */
.hero {
  padding-top: clamp(var(--space-32), 18vw, 12rem);
  padding-bottom: clamp(var(--space-16), 10vw, var(--space-24));
  padding-inline: var(--space-6);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, color-mix(in srgb, var(--color-primary) 6%, transparent) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-6);
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-8);
  max-width: 52ch;
  margin-inline: auto;
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

/* ===================================================
   PAGE HERO (inner pages)
   =================================================== */
.page-hero {
  padding-top: clamp(var(--space-24), 14vw, 10rem);
  padding-bottom: clamp(var(--space-12), 6vw, var(--space-16));
  padding-inline: var(--space-6);
  text-align: center;
  position: relative;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.page-hero-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}

.page-hero-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 48ch;
  margin-inline: auto;
}

/* ===================================================
   CARDS
   =================================================== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
  box-shadow: var(--shadow-md);
}

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
  color: var(--color-primary);
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
}

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

/* ===================================================
   SERVICE CARDS (detailed)
   =================================================== */
.service-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.service-card:hover {
  border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
  box-shadow: var(--shadow-md);
}

.service-card .card-icon {
  width: 56px;
  height: 56px;
  margin-bottom: var(--space-6);
}

.service-card .card-icon svg {
  width: 28px;
  height: 28px;
}

.service-card .card-title {
  margin-bottom: var(--space-3);
}

.service-card .card-text {
  margin-bottom: var(--space-5);
}

.service-list {
  list-style: none;
  padding: 0;
}

.service-list li {
  position: relative;
  padding: var(--space-2) 0;
  padding-left: var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-divider);
}

.service-list li:last-child {
  padding-bottom: 0;
}

.service-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  background: var(--color-primary);
  border-radius: 50%;
  transform: translateY(-50%);
}

/* ===================================================
   GRIDS
   =================================================== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

/* ===================================================
   ABOUT LAYOUT
   =================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-10), 6vw, var(--space-16));
  align-items: center;
}

.about-text h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-6);
}

.about-text p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  line-height: 1.8;
}

.about-highlights {
  list-style: none;
  margin-top: var(--space-6);
  padding: 0;
}

.about-highlights li {
  position: relative;
  padding: var(--space-3) 0;
  padding-left: var(--space-8);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 500;
}

.about-highlights li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background: var(--color-primary-subtle);
  border-radius: var(--radius-sm);
}

.about-highlights li::after {
  content: '✓';
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 700;
}

.about-visual {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
}

/* ===================================================
   CONTACT FORM
   =================================================== */
.contact-form {
  background: var(--color-surface);
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

.form-group {
  margin-bottom: var(--space-5);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--text-sm);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 12%, transparent);
}

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

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

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
}

.submit-btn {
  width: 100%;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-3) var(--space-6);
  border: none;
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.01em;
}

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

.captcha-note {
  margin-top: var(--space-4);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.captcha-note svg {
  display: inline-block;
  width: 14px;
  height: 14px;
}

/* ===================================================
   CTA SECTION
   =================================================== */
.cta-band {
  text-align: center;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.cta-band h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}

.cta-band p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  font-size: var(--text-base);
}

/* ===================================================
   FOOTER
   =================================================== */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-8) var(--space-6);
  text-align: center;
}

.site-footer p {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  line-height: 1.6;
  margin: 0;
}

.footer-divider {
  opacity: 0.55;
}

.footer-link {
  color: inherit;
  text-decoration: none;
}

.footer-link:hover {
  color: var(--color-text-muted);
}

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 768px) {
  .nav-links,
  .header-cta {
    display: none;
  }

  .site-header nav {
    padding: var(--space-3) var(--space-4);
  }

  .logo {
    gap: var(--space-2);
  }

  .logo-mark {
    width: 156px;
    height: 34px;
  }

  .logo-text {
    display: none;
  }

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

  /* Mobile menu overlay */
  .mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
  }

  .mobile-nav.open {
    opacity: 1;
    pointer-events: all;
  }

  .mobile-nav a {
    text-decoration: none;
    color: var(--color-text);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
  }

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

  .grid-2,
  .grid-3,
  .grid-4,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-visual {
    order: -1;
    min-height: 240px;
  }

  .hero-title {
    font-size: clamp(1.75rem, 1rem + 3vw, 2.5rem);
  }

  .hero-subtitle {
    font-size: var(--text-base);
  }

  .contact-form {
    padding: var(--space-6);
  }
}

@media (max-width: 640px) {
  .logo-mark {
    width: 138px;
    height: 30px;
  }

  .logo-text {
    display: none;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .hero-actions .btn-primary,
  .hero-actions .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .site-footer {
    padding: var(--space-6) var(--space-4);
  }

  .site-footer p {
    max-width: 30ch;
    margin-inline: auto;
  }

  .footer-divider {
    display: none;
  }

  .footer-link {
    width: 100%;
  }
}
