@import "fonts.css";

/* ===========================
   CSS Custom Properties
   =========================== */
:root {
  /* jotti CI Theme — Light */
  --background: #f8fafc;
  --foreground: #0f172a;
  --card: #ffffff;
  --card-border: #e2e8f0;
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-light: #ede9fe;
  --secondary: #4f46e5;
  --accent: #ede9fe;
  --accent-foreground: #6d28d9;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --radius: 0.625rem;
  --section-gap: 6rem;
  --container-max: 1120px;

  @media (max-width: 640px) {
    --section-gap: 4rem;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family:
    Montserrat,
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--primary-light);
  color: var(--primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===========================
   Container
   =========================== */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ===========================
   Typography
   =========================== */
:is(h1, h2, h3) {
  line-height: 1.2;
  color: var(--foreground);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;

  @media (max-width: 640px) {
    font-size: 1.75rem;
  }
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.125rem;
  font-weight: 700;
}

p {
  color: var(--muted);
}

strong {
  color: var(--foreground);
}

/* ===========================
   Links
   =========================== */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;

  &:hover {
    color: var(--primary-hover);
  }
}

/* ===========================
   Buttons
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;

  @media (max-width: 640px) {
    text-align: center;
  }
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);

  &:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
  }
}

.btn-ghost {
  background: transparent;
  color: var(--foreground);
  border-color: var(--card-border);

  &:hover {
    background: var(--accent);
    border-color: var(--primary-light);
    color: var(--primary);
  }
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
  padding: 0.4rem 1rem;
  font-size: 0.8125rem;

  &:hover {
    background: var(--primary);
    color: #fff;
  }
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.0625rem;
}

/* ===========================
   Header
   =========================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.logo-link {
  display: flex;
  align-items: center;
}

.logo {
  height: 32px;
  width: auto;
}

/* Header brand group — logo + byline */
.header-brand {
  display: flex;
  align-items: center;
}

/* Header byline — "Entwickelt von" next to logo */
.header-byline {
  display: flex;
  align-items: center;
  padding-left: 1rem;
  border-left: 1px solid var(--card-border);
  margin-left: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted-light);
  white-space: nowrap;

  & a {
    color: var(--muted);
    font-weight: 600;
    margin-left: 0.25em;

    &:hover {
      color: var(--primary);
    }
  }

  @media (max-width: 960px) {
    display: none;
  }
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;

  & a:not(.btn) {
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;

    &:hover {
      color: var(--foreground);
    }
  }

  @media (max-width: 960px) {
    display: none;
  }
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;

  & span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--foreground);
    border-radius: 1px;
    transition: all 0.2s ease;
  }

  @media (max-width: 960px) {
    display: flex;
  }
}

/* Mobile nav overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: 4rem;
  z-index: 99;
  background: rgba(248, 250, 252, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1rem;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: min(100%, 26rem);
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow:
    0 18px 42px rgba(15, 23, 42, 0.1),
    0 4px 12px rgba(15, 23, 42, 0.06);

  & a {
    display: block;
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: calc(var(--radius) - 2px);
    background: #fff;
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
    line-height: 1.4;
    transition:
      border-color 0.15s ease,
      background-color 0.15s ease,
      color 0.15s ease;

    &:hover {
      border-color: var(--primary-light);
      background: var(--accent);
      color: var(--primary);
    }
  }
}

body.nav-open {
  overflow: hidden;

  & .mobile-nav-overlay {
    display: flex;
  }

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

/* ===========================
   Hero
   =========================== */
.hero {
  padding: 5rem 0 4rem;

  @media (max-width: 640px) {
    padding: 3rem 0 2.5rem;
  }
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;

  @media (max-width: 960px) {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.hero-text {
  max-width: 540px;

  @media (max-width: 960px) {
    max-width: 100%;
  }
}

.hero h1 {
  margin-bottom: 1.25rem;
}

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

.hero-sub {
  font-size: 1.125rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.hero-tags {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.02em;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;

  @media (max-width: 960px) {
    justify-content: center;
  }

  @media (max-width: 640px) {
    flex-direction: column;
    align-items: stretch;
  }
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;

  @media (max-width: 960px) {
    order: -1;
  }
}

.hero-screenshot {
  max-width: 320px;
  width: 100%;
  filter: drop-shadow(16px 32px 8px rgba(0, 0, 0, 0.22));
  transform: rotate(6deg);

  @media (max-width: 960px) {
    max-width: 200px;
    transform: rotate(3deg);
    filter: drop-shadow(8px 16px 4px rgba(0, 0, 0, 0.22));
  }
}

/* ===========================
   Sections (general)
   =========================== */
.section {
  padding: var(--section-gap) 0;
}

.section-title {
  text-align: center;
  margin-bottom: 0.75rem;
}

.section-subtitle {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3rem;
  font-size: 1.0625rem;
}

.subsection-title {
  text-align: center;
  margin: 3rem 0 1.25rem;
  font-size: 1.125rem;
}

/* Alternate section backgrounds */
:is(.problem, .features, .comparison, .tech) {
  background: #f1f5f9;
}

/* ===========================
   Card Grid
   =========================== */
.card-grid {
  display: grid;
  gap: 1.5rem;

  &.three-col {
    grid-template-columns: repeat(3, 1fr);

    @media (max-width: 960px) {
      grid-template-columns: repeat(2, 1fr);
    }

    @media (max-width: 640px) {
      grid-template-columns: 1fr;
    }
  }

  &.two-col {
    grid-template-columns: repeat(2, 1fr);

    @media (max-width: 640px) {
      grid-template-columns: 1fr;
    }
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.75rem;

  & .card-icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
  }

  & h3 {
    margin-bottom: 0.5rem;
  }

  & p {
    font-size: 0.9375rem;
    line-height: 1.6;
  }
}

.feature-card {
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;

  &:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 24px rgba(124, 58, 237, 0.08);
  }
}

/* ===========================
   Split Content (Solution / Security)
   =========================== */
.split-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;

  &.reverse {
    direction: rtl;

    & > * {
      direction: ltr;
    }
  }

  @media (max-width: 960px) {
    grid-template-columns: 1fr;

    &.reverse {
      direction: ltr;
    }
  }
}

.split-screenshot {
  width: 100%;
  max-width: 600px;
  filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.18))
    drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.split-text {
  & h2 {
    margin-bottom: 1.25rem;
  }

  & > p {
    margin-bottom: 1.25rem;
    font-size: 1.0625rem;
  }
}

/* ===========================
   Check List
   =========================== */
.check-list {
  list-style: none;
  padding: 0;

  & li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--muted);

    &::before {
      content: "✓";
      position: absolute;
      left: 0;
      color: var(--primary);
      font-weight: 700;
    }
  }
}

/* ===========================
   Steps (How it works)
   =========================== */
.how-it-works {
  background: linear-gradient(135deg, var(--primary-light) 0%, #f8fafc 100%);
}

.steps {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  justify-content: center;

  @media (max-width: 960px) {
    flex-direction: column;
    align-items: center;
  }
}

.step {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  text-align: center;
  flex: 1;
  max-width: 320px;

  & .step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
  }

  & h3 {
    margin-bottom: 0.5rem;
  }

  & p {
    font-size: 0.9375rem;
    line-height: 1.6;
  }

  @media (max-width: 960px) {
    max-width: 100%;
  }
}

.step-arrow {
  display: flex;
  align-items: center;
  padding-top: 3rem;
  font-size: 1.5rem;
  color: var(--muted-light);

  &::after {
    content: "→";
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--muted-light);
  }

  @media (max-width: 960px) {
    padding-top: 0;
    transform: rotate(90deg);
  }
}

/* ===========================
   Showcase
   =========================== */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;

  @media (max-width: 960px) {
    grid-template-columns: repeat(2, 1fr);
  }

  @media (max-width: 640px) {
    grid-template-columns: 1fr;
  }
}

.showcase-item {
  min-height: 280px;

  @media (max-width: 640px) {
    min-height: 200px;
  }
}

/* ===========================
   Comparison Table
   =========================== */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--card-border);
  font-size: 0.9375rem;

  & :is(th, td) {
    padding: 0.875rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
  }

  & thead th {
    background: #f1f5f9;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);

    &.highlight-col {
      color: var(--primary);
    }
  }

  & tbody {
    & td {
      color: var(--muted);

      &:first-child {
        font-weight: 600;
        color: var(--foreground);
      }
    }

    & tr:last-child td {
      border-bottom: none;
    }
  }

  & .highlight-col {
    background: var(--primary-light);
    color: var(--foreground);
  }

  @media (max-width: 640px) {
    font-size: 0.8125rem;

    & :is(th, td) {
      padding: 0.625rem 0.75rem;
    }
  }
}

/* ===========================
   Tags
   =========================== */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  justify-content: center;
}

.tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--accent-foreground);
  padding: 0.375rem 0.875rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ===========================
   Pricing
   =========================== */
.pricing-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--card);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  overflow: hidden;
}

.pricing-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff;
  padding: 2rem;
  text-align: center;
}

.pricing-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}

.pricing-price {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.1;

  @media (max-width: 640px) {
    font-size: 2.75rem;
  }
}

.pricing-period {
  font-size: 1.125rem;
  font-weight: 400;
  opacity: 0.85;
}

.pricing-features {
  padding: 2rem;

  & li {
    margin-bottom: 0.625rem;
  }
}

.pricing-note {
  background: #f8fafc;
  border-top: 1px solid var(--card-border);
  padding: 1.5rem 2rem;

  & p {
    margin-bottom: 1rem;
    font-size: 0.9375rem;
  }
}

.hosting-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hosting-option {
  font-size: 0.875rem;
  color: var(--muted);
}

/* ===========================
   Tech Section
   =========================== */
.tech-card {
  height: auto;
}

.tech-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tech-row {
  display: flex;
  gap: 1rem;
  font-size: 0.9375rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--card-border);

  &:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  & .tech-label {
    font-weight: 700;
    color: var(--foreground);
    min-width: 100px;
  }

  & span:last-child {
    color: var(--muted);
  }
}

.quickstart-box {
  background: var(--foreground);
  border-radius: var(--radius);
  padding: 2rem;
  margin-top: 1.5rem;

  & h3 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1rem;
  }

  & pre {
    background: #1e293b;
    border-radius: calc(var(--radius) - 2px);
    padding: 1.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  & code {
    font-family:
      "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
    font-size: 0.875rem;
    color: #e2e8f0;
    line-height: 1.8;
  }

  @media (max-width: 640px) {
    padding: 1.25rem;

    & pre {
      padding: 1rem;
    }
    & code {
      font-size: 0.75rem;
    }
  }
}

.code-comment {
  color: var(--muted-light);
}

.architecture-card {
  margin-top: 1.5rem;
}

/* ===========================
   CTA Section
   =========================== */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  text-align: center;

  & h2 {
    color: #fff;
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  }

  & p {
    color: rgba(255, 255, 255, 0.85);
    max-width: 480px;
    font-size: 1.0625rem;
  }

  & .btn-primary {
    background: #fff;
    color: var(--primary);
    border-color: #fff;
    margin-top: 0.5rem;

    &:hover {
      background: var(--primary-light);
      border-color: var(--primary-light);
    }
  }
}

.cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.cta-icon {
  border-radius: 16px;
}

/* ===========================
   Footer
   =========================== */
.site-footer {
  border-top: 1px solid var(--card-border);
  padding: 2.5rem 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);

  & img {
    border-radius: 4px;
  }
}

.footer-links {
  display: flex;
  gap: 1.5rem;

  & a {
    font-size: 0.875rem;
    color: var(--muted);
    font-weight: 600;

    &:hover {
      color: var(--primary);
    }
  }
}

.footer-copy {
  font-size: 0.8125rem;
  color: var(--muted-light);

  & a {
    color: var(--muted);
    font-weight: 600;

    &:hover {
      color: var(--primary);
    }
  }
}

/* ===========================
   Placeholder Images
   =========================== */
.placeholder-img {
  background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 100%);
  border: 2px dashed var(--muted-light);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  min-height: 300px;
  text-align: center;

  & .placeholder-icon {
    font-size: 3rem;
  }

  & span {
    font-size: 0.8125rem;
    color: var(--muted);
    max-width: 240px;
    line-height: 1.5;
    font-style: italic;
  }
}
