:root {
  /* Colors */
  --color-text-primary: #121826;
  --color-text-secondary: #4d5562;
  --color-accent: #3662e3;
  --color-background: #f8fafc;
  --color-border: #e5e7eb;
  --color-popular: #121826;
  --color-popular-cta: #e9a23b;
  --color-white: #ffffff;

  /* Typography */
  --font-primary: "Be Vietnam Pro", serif;
  --font-size-base: 16px;
  --font-size-h1: clamp(1.75rem, 3vw, 2rem);
  --font-size-h2: clamp(2.5rem, 5vw, 4rem);
  --font-size-h3: 1rem;

  /* Spacing */
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: clamp(2rem, 4vw, 4rem);
  --space-xl: clamp(40px, 6vw, 60px);

  /* Layout */
  --container-max: 1200px;
  --border-radius-sm: 10px;
  --border-radius-lg: 20px;

  /* Transitions */
  --transition-standard: 0.2s ease-in-out;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Base styles */
html {
  font-size: var(--font-size-base);
  text-wrap: pretty;
}

body {
  font-family: var(--font-primary);
  font-weight: 400;
  font-style: normal;
  color: var(--color-text-primary);
  line-height: 1.5;
}

img {
  width: auto;
  height: 15px;
}

/* Header */
header {
  max-width: 100vw;
  background-color: var(--color-background);
  background-image: url(./images/bg-pattern.png);
  background-repeat: no-repeat;
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

header div {
  margin: 0 auto;
  padding-block: clamp(32px, 5vw, 52px);
  max-width: 500px;
  text-align: center;
}

header h1 {
  margin-bottom: var(--space-xs);
  font-size: var(--font-size-h1);
  font-weight: 700;
}

/* Container */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
}

/* Grid Layout */
.grid {
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  grid-template-areas:
    ".        enterprise-price  popular-price"
    "features enterprise        popular"
    ".        enterprise-footer popular-footer";
  padding-inline: var(--space-sm);
  padding-bottom: var(--space-sm);
}

.price p {
  color: var(--color-text-secondary);
  padding-bottom: 3rem;
}

/* Footer Components */
.footer {
  color: var(--color-accent);
  padding-block: var(--space-md);
}

.footer p {
  display: inline-block;
  margin: 0 auto;
  vertical-align: middle;
}

.footer img {
  vertical-align: middle;
  transition: transform var(--transition-standard);
}

.footer:hover {
  cursor: pointer;
}

.footer:hover img {
  transform: translateX(5px);
}

h2 {
  font-weight: 600;
  font-size: var(--font-size-h2);
  padding-bottom: 6px;
}

h3 {
  font-size: var(--font-size-h3);
  font-weight: 600;
  color: var(--color-accent);
  padding: var(--space-md) 0 var(--space-xs) 0;
}

/* Features List */
.features {
  grid-area: features;
  text-align: left;
  background-color: var(--color-background);
  border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
  overflow: clip;
}

.features li {
  padding-left: var(--space-xs);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

li {
  padding-block: var(--space-sm);
  border-bottom: 1px solid #4d556213;
}

ul {
  list-style: none;
}

/* Popular Plan Styling */
.popular-price {
  grid-area: popular-price;
  background-color: var(--color-popular);
  color: var(--color-white);
  border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}

.popular-price h3 {
  margin: var(--space-md) auto var(--space-xs);
  color: var(--color-white);
  background-color: var(--color-accent);
  border-radius: var(--border-radius-lg);
  width: fit-content;
  padding: 1px 10px;
}

.popular-price p,
.popular {
  color: var(--color-white);
}

.popular {
  grid-area: popular;
  background-color: var(--color-popular);
}

.popular-footer {
  grid-area: popular-footer;
  background-color: var(--color-popular-cta);
  color: var(--color-white);
  border-radius: 0 0 var(--border-radius-sm) var(--border-radius-sm);
}

/* Grid Areas */
.enterprise-price {
  grid-area: enterprise-price;
}
.enterprise {
  grid-area: enterprise;
}
.enterprise-footer {
  grid-area: enterprise-footer;
}
.free-price {
  grid-area: free-price;
}
.free {
  grid-area: free;
}
.free-footer {
  grid-area: free-footer;
}
.team-price {
  grid-area: team-price;
}
.team {
  grid-area: team;
}
.team-footer {
  grid-area: team-footer;
}

/* Hidden Elements */
.free-price,
.free,
.free-footer,
.team-price,
.team,
.team-footer {
  display: none;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

/* Responsive Layouts */
@media (max-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, minmax(100px, 1fr));
    grid-template-areas:
      ".        popular-price"
      "features popular"
      ".        popular-footer";
    padding-inline: var(--space-lg);
    padding-bottom: var(--space-lg);
  }

  .enterprise-price,
  .enterprise,
  .enterprise-footer {
    display: none;
  }
}

@media (max-width: 260px) {
  .grid {
    grid-template-columns: repeat(1, minmax(100px, 1fr));
    grid-template-areas:
      "popular-price"
      "popular"
      "popular-footer";
    padding-inline: var(--space-lg);
    padding-bottom: var(--space-lg);
  }

  .features {
    display: none;
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(4, minmax(100px, 1fr));
    grid-template-areas:
      ".        team-price  popular-price    enterprise-price"
      "features team        popular          enterprise"
      ".        team-footer popular-footer   enterprise-footer";
    padding-inline: var(--space-lg);
    padding-bottom: var(--space-lg);
  }

  .team-price,
  .team,
  .team-footer {
    display: block;
  }
}

@media (min-width: 1280px) {
  .grid {
    grid-template-columns: repeat(5, minmax(100px, 1fr));
    grid-template-areas:
      ".          free-price    team-price   popular-price    enterprise-price"
      "features   free          team         popular          enterprise"
      ".          free-footer   team-footer  popular-footer   enterprise-footer";
  }

  .free-price,
  .free,
  .free-footer {
    display: block;
  }
}
