/* akilli.tel — extends akilli.bot foundation tokens.
   Foundation-tokens.css remains the contract; this file adds .at-* primitives,
   landing-specific variables, and density variants downstream surfaces inherit. */

:root {
  /* Inherit iznik teal as --primary (set by foundation-tokens.css) */

  /* Typography — Inter Tight (display) + Inter (body), full TR coverage.
     The system-font fallback matches akilli.bot's existing chrome — kept as a
     Tweak option so family-consistency is one click away. */
  --font-display:
    'Inter Tight', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
  --font-body:
    'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Type scale (clamp() pairs are landing-only; dense surfaces use static sizes) */
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 22px;
  --text-3xl: clamp(24px, 2.4vw, 28px);
  --text-4xl: clamp(28px, 3.2vw, 36px);
  --text-5xl: clamp(34px, 4.4vw, 48px);
  --text-6xl: clamp(44px, 6.4vw, 72px);
  --text-display: clamp(48px, 7.4vw, 92px);

  /* Spacing scale (4px base) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 48px;
  --s-10: 64px;
  --s-11: 80px;
  --s-12: 96px;
  --s-13: 128px;

  /* Radius — inherits --radius (10px) from foundation. Adds extras. */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: var(--radius);
  --r-xl: 14px;
  --r-2xl: 20px;
  --r-full: 999px;

  /* Shadows — used sparingly. Cards, popovers, hero elevation. */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 24px 48px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.05);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 320ms;

  /* Landing surfaces */
  --hero-bg: linear-gradient(
    180deg,
    color-mix(in oklab, var(--primary) 4%, var(--background)) 0%,
    var(--background) 60%
  );
  --section-alt: oklch(0.985 0.003 230);
  --grid-line: color-mix(in oklab, var(--foreground) 6%, transparent);
  --code-bg: oklch(0.97 0.005 230);
}

.dark,
[data-theme='dark'] {
  --hero-bg: linear-gradient(
    180deg,
    color-mix(in oklab, var(--primary) 8%, var(--background)) 0%,
    var(--background) 60%
  );
  --section-alt: oklch(0.18 0.008 230);
  --grid-line: color-mix(in oklab, var(--foreground) 10%, transparent);
  --code-bg: oklch(0.22 0.008 230);
}

/* Surface — page-level wrapper. Sets font-family + smoothing. */
.at-surface {
  font-family: var(--font-body);
  font-feature-settings:
    'ss01' 1,
    'cv11' 1,
    'calt' 1;
  background: var(--background);
  color: var(--foreground);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
.at-surface *,
.at-surface *::before,
.at-surface *::after {
  box-sizing: border-box;
}

/* Display headings */
.at-h1 {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
  color: var(--foreground);
}
.at-h2 {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-wrap: balance;
  color: var(--foreground);
}
.at-h3 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.2;
  color: var(--foreground);
}
.at-h4 {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--foreground);
}

/* Eyebrow label — small caps, primary tone */
.at-eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}

/* Code / monospace inline accents (telemetry feel) */
.at-mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  letter-spacing: -0.01em;
}

/* Section padding — landing rhythm */
.at-section {
  padding: var(--s-12) var(--s-5);
}
.at-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.at-container-narrow {
  max-width: 880px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 768px) {
  .at-section {
    padding: var(--s-10) var(--s-4);
  }
}

/* Density — compact halves padding & tightens type. Yönetici tables will inherit. */
[data-density='compact'] .at-section {
  padding: var(--s-9) var(--s-5);
}
[data-density='compact'] .at-h1 {
  font-size: clamp(40px, 6vw, 72px);
}
[data-density='compact'] .at-h2 {
  font-size: clamp(28px, 3.6vw, 40px);
}

/* Buttons — alias the foundation .ab-btn family so akilli.tel surfaces don't
   leak the .ab- prefix. .at-btn === .ab-btn. */
.at-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: calc(var(--radius) - 2px);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  border: 1px solid transparent;
  transition:
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
  cursor: pointer;
}
.at-btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.at-btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}
.at-btn-primary:hover {
  background: color-mix(in oklab, var(--primary) 92%, black);
}
.at-btn-outline {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border);
}
.at-btn-outline:hover {
  background: var(--accent);
}
.at-btn-ghost {
  background: transparent;
  color: var(--foreground);
}
.at-btn-ghost:hover {
  background: var(--accent);
}
.at-btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}
.at-btn-lg {
  height: 48px;
  padding: 0 22px;
  font-size: 15px;
}
.at-btn-xl {
  height: 56px;
  padding: 0 28px;
  font-size: 16px;
  border-radius: calc(var(--radius));
}

/* Cards */
.at-card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
}

/* Quiet card — used inside hero panels, light shadow */
.at-card-elevated {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-lg);
}

/* Inputs */
.at-input {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--input);
  border-radius: var(--radius);
  font: inherit;
  font-size: var(--text-base);
  transition:
    border-color var(--duration-fast),
    box-shadow var(--duration-fast);
}
.at-input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 20%, transparent);
}
.at-input::placeholder {
  color: var(--muted-foreground);
}
.at-textarea {
  min-height: 120px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}
.at-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}

/* Link primitives — body links underline; nav/footer links handled per-component */
.at-link {
  color: var(--foreground);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--muted-foreground) 60%, transparent);
  text-underline-offset: 3px;
  transition:
    color var(--duration-fast),
    text-decoration-color var(--duration-fast);
}
.at-link:hover {
  color: var(--primary);
  text-decoration-color: var(--primary);
}
a.at-btn {
  text-decoration: none;
}

/* Pill / chip */
.at-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: 500;
  background: color-mix(in oklab, var(--primary) 6%, transparent);
  border: 1px solid color-mix(in oklab, var(--primary) 18%, transparent);
  color: var(--foreground);
}
.at-pill-quiet {
  background: var(--secondary);
  border-color: var(--border);
  color: var(--muted-foreground);
}

/* Chip — smaller pill, used for tag/keyword listings inside cards */
.at-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted-foreground);
  background: var(--secondary);
  border: 1px solid var(--border);
  letter-spacing: 0.005em;
  white-space: nowrap;
}

/* Glyph: akıllı vs insan distinction (allowed by brief) */
.at-glyph {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}
.at-glyph-akilli {
  background: var(--primary);
  transform: rotate(45deg);
  border-radius: 1px;
}
.at-glyph-insan {
  border: 1.5px solid var(--muted-foreground);
  border-radius: 50%;
}

/* Brand mark — akilli.tel wordmark presentation */
.at-wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.018em;
  font-size: 18px;
  color: var(--foreground);
}
.at-wordmark .tld {
  color: var(--muted-foreground);
  font-weight: 500;
}

/* Eyebrow + section heading rhythm — uniform across every section */
.at-section-head {
  margin: 0 0 56px 0;
}
.at-section-head .at-eyebrow {
  margin-bottom: var(--s-3);
  display: block;
}
.at-section-head h2 {
  margin: 0 0 var(--s-4) 0;
}
.at-section-head .at-section-sub {
  font-size: var(--text-xl);
  color: var(--muted-foreground);
  line-height: 1.55;
  max-width: 720px;
  margin: 0;
}
.at-section-head[data-align='center'] {
  text-align: center;
}
.at-section-head[data-align='center'] .at-section-sub {
  margin: 0 auto;
}

/* ─── Rhythm helpers ───────────────────────────────────────────────────── */
/* Every section uses the same vertical breath, container width, and grid gaps */
.at-section {
  padding: 120px 24px;
}
@media (max-width: 768px) {
  .at-section {
    padding: 80px 20px;
  }
}

.at-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: stretch;
}
@media (max-width: 920px) {
  .at-two-col {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }
}

.at-card-stack {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Panel header — used by every demo card (transcript, multilingual, scenario, etc.)
   so the header height is identical row to row and columns line up perfectly. */
.at-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--primary) 4%, var(--card));
  flex-shrink: 0;
}
.at-panel-head .at-panel-head-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}
.at-panel-head .at-panel-head-meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-foreground);
}
.at-panel-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--secondary);
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.5;
  flex-shrink: 0;
}

/* Subtle grid backgrounds — used behind the workflow canvas */
.at-grid-bg {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Footer link styles (used by LandingFooter) */
.footer-link {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color var(--duration-fast);
}
.footer-link:hover {
  color: var(--foreground);
  text-decoration: underline;
}

/* Scrollbar polish for transcript panes */
.at-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.at-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.at-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in oklab, var(--muted-foreground) 30%, transparent);
  border-radius: 4px;
}

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