:root {
  --color-zanah: oklch(91.6% 0.086 134.7);
  --color-pizzaz: oklch(73.5% 0.175 64.7);
  --color-cruose: oklch(0.5735 0.1702 148.6);
  --color-parsley: oklch(0.3838 0.1061 144.06);
  --color-white: oklch(100% 0 0);
  --color-black: oklch(0% 0 0);

  --color-pizzaz-text: oklch(55% 0.175 64.7);

  --bg-page: var(--color-zanah);
  --bg-card: var(--color-white);
  --text-main: var(--color-parsley);
  --text-body: oklch(20% 0 0);
  --shadow-color: oklch(32.8% 0.106 148.6 / 10%);
}

body {
  font-family: "Josefin Sans", system-ui, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-body);
  margin: 0;
  padding: 0;

  /* LAYOUT FIX: Flex column ensures footer stays at bottom */
  /* TODO: MAKE FOOTER NOT SCROLLABLE */
  /* TODO: MAKE FOOTER NOT SCROLLABLE */
  display: flex;
  flex-direction: column;
  min-height: 100vh;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* New wrapper to handle content spacing and pushing footer down */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
}

.site-footer {
  /* Reverted to relative flow, no fixed positioning */
  width: 100%;
  background-color: var(--color-cruose);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.footer-container {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  gap: 10px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-icon {
  width: 90px;
  height: auto;
  transition: transform 0.2s ease;
}

.footer-icon:hover {
  transform: scale(1.1);
  opacity: 0.8;
}

#company-result {
  container-type: inline-size;
  container-name: card;
  width: 100%;
  max-width: 650px;
  margin-block-start: 60px;
  position: relative;
  z-index: 1;
}

/* Card Styles */
.company-card {
  background-color: var(--bg-card);
  border-radius: 24px;
  padding: 40px;

  box-shadow:
    0 4px 6px -1px var(--shadow-color),
    0 10px 15px -3px var(--shadow-color),
    0 0 0 2px var(--color-white) inset;

  border: 1px solid color-mix(in oklch, var(--color-zanah), white 50%);

  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "logo title"
    "desc desc"
    "details details";
  gap: 0 32px;
  align-items: center;
  text-align: left;
  opacity: 0;
  animation: fade-up 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.company-logo {
  grid-area: logo;
  width: 80px;
  height: 80px;
  object-fit: contain;
  background-color: oklch(98% 0 0);
  border-radius: 12px;
}

.company-card h2 {
  grid-area: title;
  font-weight: 700;
  font-size: clamp(2rem, 5cqw, 2.625rem);
  color: var(--text-main);
  margin: 0;
  line-height: 1.1;
  text-wrap: balance;
}

.company-description {
  grid-area: desc;
  font-weight: 300;
  font-size: 1.125rem;
  line-height: 1.6;
  margin-block-start: 24px;
  margin-block-end: 32px;
  color: var(--text-body);
  max-width: 60ch;
}

.company-details {
  grid-area: details;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  border-top: 2px solid var(--color-zanah);
  padding-block-start: 24px;
}

.detail-item {
  display: flex;
  flex-direction: column;
}

.detail-item strong {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-pizzaz-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.detail-item {
  font-weight: 300;
  font-size: 1.25rem;
  color: var(--text-main);
}

.detail-item a {
  color: var(--text-main);
  text-decoration: none;
  border-bottom: 2px solid var(--color-pizzaz);
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
  width: fit-content;
  border-radius: 2px;
}

.detail-item a:hover {
  background-color: var(--color-pizzaz);
  color: var(--color-white);
}

.detail-item a:focus-visible {
  outline: 2px solid var(--color-pizzaz);
  outline-offset: 4px;
}

#company-result > p {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 80px;
  animation: pulse 2s infinite ease-in-out;
}

.error {
  background-color: oklch(97% 0.02 14);
  border: 1px solid oklch(85% 0.15 20);
  border-radius: 16px;
  padding: 30px;
  text-align: center;
}

.error h3 {
  color: oklch(45% 0.2 20);
  font-size: 1.5rem;
  margin-top: 0;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

@container card (max-width: 450px) {
  .company-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "logo"
      "title"
      "desc"
      "details";
    text-align: center;
    gap: 16px;
    /* REDUCED PADDING: Optimized for mobile screens */
    padding: 24px;
  }

  .company-logo {
    justify-self: center;
  }

  .company-details {
    grid-template-columns: 1fr;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .company-card,
  #company-result > p {
    animation: none;
    transition: none;
  }
}
