/* Tapti Services — design foundation (enterprise elevation) */

:root {
  --bg: #f7f8f7;
  --surface: #ffffff;
  --ink: #12213c;
  --ink-soft: #4c5a6e;
  --ink-faint: #7a879a;
  --teal: #0e7c7b;
  --teal-deep: #0a5f5e;
  --teal-tint: #e7f3f1;
  --sand: #b5652c;
  --sand-tint: #fbede3;
  --border: #e2e5e4;
  --border-strong: #d0d5d4;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --maxw: 1160px;
  --maxw-wide: 1280px;
  --header-h: 72px;
  --shadow-xs: 0 1px 2px rgba(18, 33, 60, 0.04);
  --shadow-sm: 0 1px 2px rgba(18, 33, 60, 0.04), 0 4px 12px rgba(18, 33, 60, 0.04);
  --shadow-md: 0 4px 8px rgba(18, 33, 60, 0.04), 0 12px 28px rgba(18, 33, 60, 0.06);
  --shadow-lg: 0 8px 16px rgba(18, 33, 60, 0.05), 0 24px 48px rgba(18, 33, 60, 0.08);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 180ms;
  --duration-slow: 320ms;
  --focus-ring: 0 0 0 3px rgba(14, 124, 123, 0.28);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 88px;
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(14, 124, 123, 0.18);
  color: var(--ink);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 0.45em;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.15rem);
}

h3 {
  font-size: clamp(1.125rem, 1.6vw, 1.25rem);
  letter-spacing: -0.015em;
}

p {
  margin: 0 0 1em;
  color: var(--ink-soft);
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

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

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 640px) {
  .wrap {
    padding: 0 32px;
  }
}

@media (min-width: 1400px) {
  .wrap {
    max-width: var(--maxw-wide);
  }
}

/* Skip link — accessibility */
.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transform: translateY(-160%);
  transition: transform var(--duration) var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
  outline: none;
  box-shadow: var(--focus-ring);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-deep);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-weight: 500;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1.5px;
  background: var(--teal);
  border-radius: 1px;
}

/* Buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.2;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform var(--duration) var(--ease),
    background var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    color var(--duration) var(--ease);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
  background: var(--teal-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--ink);
  background: var(--surface);
}

.btn-ghost:hover {
  border-color: var(--ink-faint);
  background: var(--bg);
  transform: translateY(-1px);
}

.btn-teal {
  background: var(--teal);
  color: #fff;
}

.btn-teal:hover {
  background: var(--teal-deep);
  transform: translateY(-1px);
}

/* Soft ripple on press */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255, 255, 255, 0.22), transparent 45%);
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease);
  pointer-events: none;
}

.btn:active::after {
  opacity: 1;
}

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

.section-head h2 {
  margin-bottom: 12px;
}

.section-head p {
  font-size: 16.5px;
  line-height: 1.7;
  margin: 0;
  max-width: 54ch;
}

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

/* Global focus for interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}

/* Section rhythm helpers */
.section-pad {
  padding: var(--space-8) 0;
}

@media (min-width: 640px) {
  .section-pad {
    padding: var(--space-9) 0;
  }
}

.surface-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.ink-section {
  background: var(--ink);
  color: #fff;
}

.ink-section h1,
.ink-section h2,
.ink-section h3,
.ink-section h4 {
  color: #fff;
}

.ink-section p {
  color: #b7c1d1;
}

/* Subtle page atmosphere for heroes that opt in */
.hero-atmosphere {
  position: relative;
  overflow: hidden;
}

.hero-atmosphere::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 100% 0%, rgba(14, 124, 123, 0.1), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(18, 33, 60, 0.05), transparent 50%);
  pointer-events: none;
}

.hero-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(18, 33, 60, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 33, 60, 0.028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, #000 10%, transparent 85%);
  pointer-events: none;
  opacity: 0.9;
}

.hero-atmosphere > * {
  position: relative;
  z-index: 1;
}

/* Dark mode readiness — variables prepared, light theme remains default */
@media (prefers-color-scheme: dark) {
  :root {
    /* Reserved for a future opt-in dark theme; not activated */
    --dm-bg: #0f1724;
    --dm-surface: #172235;
    --dm-ink: #eef2f7;
    --dm-ink-soft: #a8b3c4;
    --dm-border: #2a364a;
    --dm-teal: #2bb5b3;
  }
}

html.theme-dark {
  /* Opt-in only: add class="theme-dark" on <html> to activate later */
  color-scheme: dark;
}

/* Touch-friendly minimum targets for primary controls */
.btn,
.menu-toggle,
.nav-drawer a,
.faq-accordion summary {
  min-height: 44px;
}

.menu-toggle {
  min-width: 44px;
}

/* Global print stylesheet */
@media print {
  .site-header,
  .site-footer,
  .skip-link,
  .menu-toggle,
  .nav-drawer,
  .navcta,
  .btn,
  .kg-panel,
  .ai-doc-grid,
  .home-hero-cta,
  .cta-band .cta-actions,
  .sa-nav {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
    line-height: 1.45;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    font-weight: 400;
  }

  .wrap {
    max-width: none;
    padding: 0;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }
}
