/* Main styles for todiia landing page */

/* ============================================================================
   CSS RESET
   ============================================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  /* Reserve space for the sticky header (~4rem) when jumping to an
     anchor. Without this, anchored sections land flush against the
     viewport top — the sticky header then covers their padding-top. */
  scroll-padding-top: 4rem;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.6;
  color: var(--color-on-surface);
  background-color: var(--color-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}

a:hover {
  text-decoration: underline;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  color: var(--color-on-surface);
}

h1 {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-xl);
}

h2 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-lg);
}

h3 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-md);
}

h4 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-md);
}

p {
  margin-bottom: var(--space-lg);
}

/* ============================================================================
   LAYOUT
   ============================================================================ */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-4xl) 0;
}

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

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-size: var(--text-md);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
  min-height: var(--size-interactive-min);
}

.btn:hover {
  text-decoration: none;
}

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

.btn--primary:hover {
  filter: brightness(1.1);
  box-shadow: var(--shadow-md);
}

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

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

.btn--large {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--text-lg);
}

/* ============================================================================
   HEADER
   ============================================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-outline);
  padding: var(--space-md) 0;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-on-surface);
  text-decoration: none;
}

.header__logo:hover {
  text-decoration: none;
}

.header__logo span {
  color: var(--color-primary);
}

.header__logo img {
  height: var(--icon-size-md);
  width: auto;
  /* Hard pixel cap as a defensive belt-and-braces against rem-unit
     edge cases in mobile browsers (text-size-adjust, accessibility
     zoom). Without this, an over-zoomed root font-size could blow
     the logo up to a fraction of the viewport — feedback #90. */
  max-height: 40px;
  max-width: 40px;
  /* Prevents the flex parent from stretching the logo if the row
     ever gets `align-items: stretch` by accident in a future edit. */
  flex-shrink: 0;
}

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

.header__nav-link {
  color: var(--color-on-surface);
  font-weight: var(--font-weight-medium);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  transition: background-color var(--duration-fast) var(--ease-standard);
}

.header__nav-link:hover {
  background-color: var(--color-surface-variant);
  text-decoration: none;
}

/* Mobile menu toggle */
.header__menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  color: var(--color-on-surface);
}

.header__menu-toggle svg {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-left: var(--space-md);
  padding-left: var(--space-md);
  border-left: 1px solid var(--color-outline);
}

.lang-switcher__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease-standard),
              transform var(--duration-fast) var(--ease-standard);
  opacity: 0.7;
}

.lang-switcher__link:hover {
  background-color: var(--color-surface-variant);
  text-decoration: none;
  opacity: 1;
  transform: scale(1.1);
}

.lang-switcher__link.is-active {
  opacity: 1;
  background-color: var(--color-surface-variant);
}

.lang-switcher__flag {
  font-size: var(--text-lg);
  line-height: 1;
}

/* ============================================================================
   HERO SECTION
   ============================================================================ */
.hero {
  /* Fill the viewport on first load so the call-to-action stands alone,
     then flow normally as the user scrolls. The header is sticky and
     ~64px tall (icon-size-md 40px + 2× space-md 12px + 1px border), so
     we subtract that to align the hero exactly with the visible area
     below the header. `100dvh` handles mobile browser chrome correctly. */
  min-height: calc(100dvh - 4rem);
  padding: var(--space-2xl) 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero__content {
  max-width: var(--content-max-lg);
  margin: 0 auto;
}

.hero__title {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-lg);
}

.hero__subtitle {
  font-size: var(--text-xl);
  color: var(--color-on-surface-muted);
  margin-bottom: var(--space-xl);
}

.hero__examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.hero__examples-label {
  font-size: var(--text-sm);
  color: var(--color-on-surface-muted);
  margin-right: var(--space-xs);
}

.hero__example {
  font-size: var(--text-sm);
  color: var(--color-on-surface-muted);
  text-decoration: none;
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px dashed var(--color-outline);
  transition: all var(--duration-fast) var(--ease-standard);
}

.hero__example:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  border-bottom-style: solid;
  text-decoration: none;
}

.hero__cta {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================================
   FEATURES SECTION
   ============================================================================ */
.features {
  padding: var(--space-4xl) 0;
}


.features__title {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--card-min-width), 1fr));
  gap: var(--space-2xl);
}

.feature-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-outline);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  transition: box-shadow var(--duration-normal) var(--ease-standard);
}

.feature-card:hover {
  box-shadow: var(--shadow-lg);
}

.feature-card__icon {
  width: var(--icon-size-lg);
  height: var(--icon-size-lg);
  margin-bottom: var(--space-lg);
  color: var(--color-primary);
}

.feature-card__title {
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
}

.feature-card__description {
  color: var(--color-on-surface-muted);
  margin-bottom: 0;
}

/* ============================================================================
   CTA SECTION
   ============================================================================ */
.cta {
  padding: var(--space-4xl) 0;
  text-align: center;
  background-color: var(--color-primary);
  color: var(--color-on-primary);
}

.cta h2,
.cta p {
  color: var(--color-on-primary);
}

.cta__content {
  max-width: var(--content-max-md);
  margin: 0 auto;
}

.cta .btn--secondary {
  color: var(--color-on-primary);
  border-color: var(--color-on-primary);
}

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

/* ============================================================================
   FOOTER
   ============================================================================ */
.footer {
  background-color: var(--color-surface-variant);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2xl);
}

.footer__brand {
  max-width: var(--content-max-sm);
}

.footer__brand-name {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-sm);
}

.footer__brand-description {
  color: var(--color-on-surface-muted);
  font-size: var(--text-sm);
  margin-bottom: 0;
}

.footer__links {
  display: flex;
  gap: var(--space-3xl);
}

.footer__column h4 {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-lg);
  color: var(--color-on-surface-muted);
}

.footer__column ul {
  list-style: none;
}

.footer__column li {
  margin-bottom: var(--space-sm);
}

.footer__column a {
  color: var(--color-on-surface);
  font-size: var(--text-sm);
}

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

.footer__bottom {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-outline);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.footer__copyright {
  font-size: var(--text-sm);
  color: var(--color-on-surface-muted);
}

/* ============================================================================
   COOKIE CONSENT BANNER
   ============================================================================ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-modal);
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-outline);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xl);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner__inner {
  max-width: var(--container-lg);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.cookie-banner__content {
  flex: 1;
  min-width: var(--content-max-sm);
}

.cookie-banner__title {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-sm);
}

.cookie-banner__text {
  font-size: var(--text-sm);
  color: var(--color-on-surface-muted);
  margin-bottom: 0;
}

.cookie-banner__text a {
  color: var(--color-primary);
}

.cookie-banner__actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.cookie-banner__actions .btn {
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--text-sm);
}

/* Cookie settings panel */
.cookie-settings {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-outline);
}

.cookie-settings[hidden] {
  display: none;
}

.cookie-category {
  margin-bottom: var(--space-md);
}

.cookie-category label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  cursor: pointer;
}

.cookie-category input[type="checkbox"] {
  margin-top: var(--space-xs);
}

.cookie-category input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */
@media (max-width: 768px) { /* --container-md */
  h1 {
    font-size: var(--text-3xl);
  }

  h2 {
    font-size: var(--text-2xl);
  }

  .hero__title {
    font-size: var(--text-3xl);
  }

  .hero__subtitle {
    font-size: var(--text-lg);
  }

  /* Mobile-tighter logo. On desktop the horizontal nav balances the
     logo visually; on mobile the nav collapses behind a burger and
     the logo dominates the otherwise-empty header — feedback #90.
     Drops the icon to a smaller size so it sits comfortably alongside
     the "todiia" wordmark + menu toggle. */
  .header__logo img {
    height: var(--icon-size-sm);
    max-height: 24px;
    max-width: 24px;
  }

  .header__logo {
    /* Tighten the wordmark too so the whole logo unit reads as one
       compact element on narrow viewports. */
    font-size: var(--text-lg);
  }

  /* Mobile navigation */
  .header__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-outline);
    padding: var(--space-lg);
    gap: var(--space-sm);
  }

  .header__nav.is-open {
    display: flex;
  }

  .header__menu-toggle {
    display: block;
  }

  .header__nav-link {
    width: 100%;
    text-align: left;
    padding: var(--space-md);
  }

  /* Mobile language switcher */
  .lang-switcher {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    padding-top: var(--space-md);
    margin-top: var(--space-sm);
    border-top: 1px solid var(--color-outline);
    justify-content: center;
  }

  .footer__inner {
    flex-direction: column;
  }

  .footer__links {
    flex-direction: column;
    gap: var(--space-2xl);
  }

  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }

  .cookie-banner__inner {
    flex-direction: column;
    text-align: center;
  }

  .cookie-banner__actions {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================================
   UTILITIES
   ============================================================================ */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--color-on-surface-muted);
}

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

.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;
}
