/**
 * Fudo web design system
 *
 * Canonical sources:
 * - mobile/src/theme/colors.ts
 * - mobile/src/theme/spacing.ts
 * - mobile/src/theme/designTokens.ts
 * - mobile/src/theme/surfaceTokens.ts
 *
 * This file loads after legacy feature CSS and owns shared typography,
 * controls, surfaces, shell geometry, and public-page hierarchy. Feature CSS
 * may own layout and data visualization, but must not redefine these tokens.
 */

@font-face {
  font-family: "Fudo Inter";
  src: url("/product-assets/fudo-inter-regular.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Fudo Inter";
  src: url("/product-assets/fudo-inter-semibold.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 600;
}

@font-face {
  font-family: "Fudo Inter";
  src: url("/product-assets/fudo-inter-bold.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 700;
}

@font-face {
  font-family: "Fudo Inter";
  src: url("/product-assets/fudo-inter-extrabold.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 800 900;
}

:root {
  /* Mirrors mobile textStyles and controlSize. */
  --web-font: "Fudo Inter", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --web-screen-title-size: 1.75rem;
  --web-screen-title-line: 2.125rem;
  --web-hero-size: 3rem;
  --web-hero-line: 3.25rem;
  --web-metric-size: 1.375rem;
  --web-metric-line: 1.6875rem;
  --web-section-title-size: 1.125rem;
  --web-section-title-line: 1.4375rem;
  --web-compact-title-size: 0.9375rem;
  --web-body-size: 0.875rem;
  --web-body-line: 1.25rem;
  --web-body-small-size: 0.8125rem;
  --web-body-small-line: 1.125rem;
  --web-meta-size: 0.75rem;
  --web-control-height: 2.75rem;
  --web-control-compact-height: 2.5rem;
  --web-field-height: 3rem;

  /* Mirrors surfaceSectionPanel / surfaceMetricTile on the light canvas. */
  --web-section-surface: color-mix(in srgb, var(--theme-background) 62%, var(--theme-surface));
  --web-metric-surface: color-mix(in srgb, var(--theme-background) 45%, var(--theme-surface));
  --web-on-card-surface: color-mix(in srgb, var(--theme-card) 48%, var(--theme-surface));
  --web-hairline: color-mix(in srgb, var(--theme-text) 8%, transparent);
}

html {
  scroll-padding-top: 4.75rem;
}

body {
  font-family: var(--web-font);
  font-size: var(--web-body-size);
  line-height: var(--web-body-line);
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
h4,
.button {
  letter-spacing: -0.015em;
}

p {
  text-wrap: pretty;
}

.container {
  max-width: 1120px;
  padding-inline: clamp(var(--spacing-lg), 3vw, 2rem);
}

.app-gradient,
.is-marketing-home .app-gradient,
.is-product-vision .app-gradient {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--theme-primary-soft) 48%, transparent), transparent 22rem),
    var(--theme-background);
}

.app-nav,
.is-marketing-home .app-nav {
  border-bottom: 1px solid var(--web-hairline);
  background: color-mix(in srgb, var(--theme-card) 96%, transparent);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.nav-inner {
  min-height: 3.75rem;
  padding-block: var(--spacing-sm);
}

.brand,
.landing-lockup {
  gap: var(--spacing-sm);
}

.brand-copy strong,
.is-public-page .brand-copy strong,
.landing-lockup span {
  font-family: var(--web-font);
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.25rem;
}

.nav-link,
.is-public-page .nav-link {
  min-height: var(--web-control-compact-height);
  padding: var(--spacing-sm) var(--spacing-md);
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--theme-muted);
  font-size: var(--web-body-small-size);
  font-weight: 600;
  line-height: var(--web-body-small-line);
}

.nav-link:hover,
.nav-link.is-active,
.is-public-page .nav-link:hover,
.is-public-page .nav-link.is-active {
  border: 0;
  background: var(--web-section-surface);
  box-shadow: none;
  color: var(--theme-text);
}

.nav-login,
.nav-signout {
  font-size: var(--web-body-small-size);
  font-weight: 600;
}

.button,
.is-public-page .button {
  min-height: var(--web-control-height);
  padding: var(--spacing-sm) var(--spacing-lg);
  border: 0;
  border-radius: var(--radius-sm);
  box-shadow: none;
  font-family: var(--web-font);
  font-size: var(--web-body-size);
  font-weight: 700;
  line-height: 1.125rem;
}

.button-large,
.is-public-page .button-large {
  min-height: var(--web-control-height);
  padding-inline: var(--spacing-lg);
  font-size: var(--web-body-size);
}

.button:hover,
.is-public-page .button:hover {
  box-shadow: none;
  filter: none;
  opacity: 0.82;
  transform: none;
}

.button.secondary {
  border: 0;
  background: var(--web-section-surface);
}

input,
select,
textarea,
.fudo-app-page input,
.fudo-app-page select,
.fudo-app-page textarea,
.auth-panel input {
  min-height: var(--web-field-height);
  border: 1px solid var(--theme-border);
  border-radius: var(--radius-sm);
  background: var(--theme-card);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px var(--theme-primary-soft);
  outline: 0;
}

.app-main,
.is-app-page .app-main {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.is-public-page .app-main,
.is-marketing-home .app-main,
.is-product-vision .app-main {
  max-width: 1120px;
  padding-top: 2rem;
  padding-bottom: 4rem;
}

/* Shared public hierarchy */

.landing-kicker,
.product-kicker,
.eyebrow,
.vision-stage,
.business-center-eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04375rem;
  line-height: 0.9375rem;
}

.public-page-hero,
.public-detail-hero,
body .tool-page-header.public-detail-hero,
body .country-hero.public-detail-hero,
body .region-hero.public-detail-hero,
body .detail-hero.public-detail-hero,
.business-center-hero,
.auth-panel {
  border: 0;
  border-radius: var(--radius-md);
  background: var(--web-section-surface);
  box-shadow: none;
}

.public-page-hero,
.business-center-hero {
  padding: clamp(var(--spacing-xl), 5vw, 3rem);
}

.public-page-hero h1,
.public-page-hero h2,
.public-detail-hero h1,
.public-detail-hero h2,
body .tool-page-header.public-detail-hero h2,
body .country-hero.public-detail-hero h1,
body .region-hero.public-detail-hero h1,
body .detail-hero.public-detail-hero h2,
.business-center-hero h1,
.auth-panel h1 {
  max-width: 18ch;
  font-size: clamp(2.25rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.public-page-hero-copy > p:last-of-type,
.public-detail-hero > p,
body .tool-page-header.public-detail-hero > p:last-child,
body .country-hero.public-detail-hero .country-hero-overview,
body .region-hero.public-detail-hero .region-hero-country,
.business-center-hero > div > p {
  color: var(--theme-muted);
  font-size: var(--web-body-size);
  line-height: var(--web-body-line);
}

.public-page-lens,
.public-index-card,
.public-use-card,
.public-app-bridge,
.business-center-principle,
.business-sidebar-section,
.business-center-section,
.business-profile-link,
.business-claim-result,
.tool-panel,
.wheel-panel,
.kpi-card,
.region-card,
.highlight-card,
.legal-document {
  border: 0;
  border-radius: var(--radius-md);
  background: var(--web-section-surface);
  box-shadow: none;
}

.public-page-lens,
.public-use-card,
.public-index-card,
.business-center-principle,
.business-sidebar-section,
.business-center-section {
  padding: var(--spacing-card);
}

.public-index-card {
  min-height: 13rem;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.public-index-card:hover {
  border: 0;
  background: var(--web-metric-surface);
  transform: none;
}

.public-index-card h3 {
  font-size: var(--web-compact-title-size);
  font-weight: 700;
  line-height: 1.25rem;
}

.public-index-card > p,
.public-page-lens p,
.public-use-card p {
  font-size: var(--web-body-small-size);
  line-height: var(--web-body-small-line);
}

.public-section-heading h2,
.public-app-bridge h2,
.business-center-section .section-heading h2,
.business-center-welcome h2 {
  font-size: clamp(1.75rem, 3vw, 2.125rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.public-app-bridge {
  background: var(--theme-primary);
}

/* Marketing home: app-scale type, app surfaces, less theatrical whitespace. */

.landing-home {
  gap: 4rem;
}

.landing-hero {
  min-height: 0;
  gap: 2rem;
}

.landing-card {
  gap: var(--spacing-lg);
  padding: clamp(var(--spacing-xl), 4vw, 2rem);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--web-section-surface);
  box-shadow: none;
}

.landing-lockup img {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
}

.landing-card h1 {
  max-width: 11ch;
  font-size: clamp(3rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.03;
}

.landing-lede {
  font-size: var(--web-body-size);
  line-height: var(--web-body-line);
}

.landing-descriptor li {
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--web-metric-surface);
  font-size: var(--web-meta-size);
  font-weight: 600;
}

.landing-screen-deck {
  height: clamp(30rem, 48vw, 36rem);
}

.landing-inside {
  gap: 2rem;
}

.landing-section-heading h2,
.landing-personal h2 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.landing-feature-list article {
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: var(--spacing-lg);
  padding-block: var(--spacing-xl);
  border-color: var(--web-hairline);
}

.landing-feature-list h3 {
  font-size: var(--web-section-title-size);
  line-height: var(--web-section-title-line);
}

.landing-feature-list p,
.landing-section-heading > p:last-child,
.landing-personal > p {
  font-size: var(--web-body-size);
  line-height: var(--web-body-line);
}

.landing-personal {
  gap: 2rem;
  padding: clamp(var(--spacing-xl), 5vw, 3rem);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--web-section-surface);
}

/* Vision: current product and direction remain distinct without billboard type. */

.vision-page {
  gap: 4rem;
}

.vision-hero {
  gap: var(--spacing-xl);
  max-width: 52rem;
  padding-block: 2rem;
}

.vision-hero h1 {
  max-width: 12ch;
  font-size: clamp(3rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.03;
}

.vision-hero-lede {
  font-size: 1rem;
  line-height: 1.5rem;
}

.vision-manifesto {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.625rem;
}

.vision-section {
  gap: 2rem;
}

.vision-section-heading {
  gap: var(--spacing-lg);
}

.vision-section-heading h2,
.vision-ai h2,
.vision-closing h2 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.vision-cards {
  gap: var(--spacing-md);
  border: 0;
}

.vision-cards article,
.vision-principles article {
  min-height: 0;
  padding: var(--spacing-card);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--web-section-surface);
}

.vision-cards h3,
.vision-principles h3 {
  font-size: var(--web-compact-title-size);
  line-height: 1.25rem;
}

.vision-cards p,
.vision-principles p,
.vision-ai-copy p,
.vision-closing > p:not(.landing-kicker),
.vision-section-heading > p:last-child {
  font-size: var(--web-body-size);
  line-height: var(--web-body-line);
}

.vision-direction {
  padding: clamp(var(--spacing-xl), 5vw, 3rem);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--web-section-surface);
}

.vision-questions {
  border-color: var(--web-hairline);
}

.vision-questions p {
  padding-block: var(--spacing-lg);
  border-color: var(--web-hairline);
  font-size: var(--web-body-size);
  font-weight: 700;
}

.vision-ai {
  gap: 3rem;
}

.vision-principles {
  gap: var(--spacing-md);
}

.vision-closing {
  gap: var(--spacing-xl);
  padding: clamp(var(--spacing-xl), 5vw, 3rem);
  border-radius: var(--radius-md);
  background: var(--theme-text);
}

.marketing-footer {
  border-color: var(--web-hairline);
}

/* Support and legal use the app's screen-title/body hierarchy. */

.legal-page {
  max-width: 46rem;
  gap: var(--spacing-xl);
}

.legal-nav {
  border-color: var(--web-hairline);
  font-size: var(--web-meta-size);
}

.legal-document {
  padding: clamp(var(--spacing-xl), 4vw, 2rem);
}

.legal-document > .eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04375rem;
}

.legal-document h1 {
  margin: var(--spacing-sm) 0;
  font-size: var(--web-screen-title-size);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: var(--web-screen-title-line);
}

.legal-meta {
  margin-bottom: 2rem;
  font-size: var(--web-body-small-size);
  line-height: var(--web-body-small-line);
}

.legal-document h2 {
  margin: 2rem 0 var(--spacing-sm);
  font-size: var(--web-section-title-size);
  font-weight: 700;
  line-height: var(--web-section-title-line);
}

.legal-document p,
.legal-document li {
  font-size: var(--web-body-size);
  line-height: var(--web-body-line);
}

@media (max-width: 900px) {
  .landing-hero {
    gap: 2rem;
  }

  .landing-screen-deck {
    height: clamp(27rem, 82vw, 34rem);
  }
}

@media (max-width: 700px) {
  .container {
    padding-inline: var(--spacing-lg);
  }

  .is-public-page .nav-inner {
    min-height: 3.75rem;
  }

  .is-public-page .nav-actions .button {
    min-height: var(--web-control-compact-height);
    padding-inline: var(--spacing-md);
  }

  .is-public-page .app-main,
  .is-marketing-home .app-main,
  .is-product-vision .app-main {
    padding-top: var(--spacing-xl);
    padding-bottom: 3rem;
  }

  .public-page-hero,
  .public-detail-hero,
  body .tool-page-header.public-detail-hero,
  body .country-hero.public-detail-hero,
  body .region-hero.public-detail-hero,
  body .detail-hero.public-detail-hero {
    padding: var(--spacing-xl);
  }

  .public-page-hero h1,
  .public-page-hero h2,
  .public-detail-hero h1,
  .public-detail-hero h2,
  body .tool-page-header.public-detail-hero h2,
  body .country-hero.public-detail-hero h1,
  body .region-hero.public-detail-hero h1,
  body .detail-hero.public-detail-hero h2,
  .business-center-hero h1,
  .auth-panel h1 {
    font-size: 2.25rem;
    line-height: 2.625rem;
  }

  .landing-home,
  .vision-page {
    gap: 3rem;
  }

  .landing-card {
    padding: var(--spacing-xl);
    background: var(--web-section-surface);
  }

  .landing-card h1,
  .vision-hero h1 {
    font-size: 2.75rem;
    line-height: 3rem;
  }

  .landing-screen-deck {
    height: clamp(25rem, 112vw, 31rem);
  }

  .landing-screen-map {
    left: 1%;
    transform: rotate(-3deg);
  }

  .landing-screen-analysis {
    right: 1%;
    transform: rotate(3deg);
  }

  .landing-personal,
  .vision-direction,
  .vision-closing {
    padding: var(--spacing-xl);
  }

  .landing-section-heading h2,
  .landing-personal h2,
  .vision-section-heading h2,
  .vision-ai h2,
  .vision-closing h2 {
    font-size: var(--web-screen-title-size);
    line-height: var(--web-screen-title-line);
  }

  .vision-hero {
    padding-block: var(--spacing-lg);
  }

  .vision-manifesto {
    font-size: var(--web-section-title-size);
    line-height: var(--web-section-title-line);
  }

  .vision-ai {
    gap: 2rem;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
