/* ========================
   Root Variables
======================== */
:root {
  --color-bg: #f9f9f9;
  --color-text: #333;
  --color-white: #fff;
  --color-light: #eee;
  --color-mid: #555;
  --color-dark: #444;
  --color-accent: #222;
  --color-border: #ccc;

  --font-base: sans-serif;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 2rem;
}

/* ========================
   Base Styles
======================== */
html, body {
  height: 100%;
}

/* Prevent header shift from scrollbar appearing/disappearing */
html { scrollbar-gutter: stable; }

body {
  font-family: var(--font-base);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  background: var(--color-bg);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  overflow-y: scroll; /* keep layout width consistent even when page is shorter than viewport */
}

main { flex: 1; }

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

/* Accessibility: skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus,
.skip-link:focus-visible {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 0.75rem;
  background: #000;
  color: #fff;
  border-radius: 4px;
  z-index: 2000;
}

/* Keyboard focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px dashed #ffcc00;
  outline-offset: 2px;
}

/* ========================
   Layout Helpers
======================== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

.text-center { text-align: center; }

/* Thank You Page */
.thank-you-content {
  text-align: center;
  padding: 3rem 0 4rem;
}

.thank-you-heading {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.thank-you-icon {
  font-size: 2.5rem;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.thank-you-message {
  font-size: 1.125rem;
  color: var(--color-mid);
  margin-bottom: 2rem;
}

.thank-you-actions {
  margin-bottom: 2.5rem;
}

/* ========================
   Header
======================== */
header {
  background: var(--color-accent);
  color: var(--color-white);
  padding: 1rem 2rem;
  position: relative;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-white);
}

.logo-img { height: 80px; width: auto; }

.site-title {
  font-size: 1.25rem;
  font-weight: bold;
  white-space: nowrap;
}

/* ========================
   Navigation
======================== */
nav ul {
  list-style: none;
  padding: 0;
  margin-top: 0.5rem;
  display: flex;
  gap: 1rem;
}

nav a {
  color: var(--color-white);
  text-decoration: none;
  font-weight: bold;
}

nav a:hover { text-decoration: underline; }
/* ========================
   Hero Section
======================== */
/* ========================
   Hero Section (Hybrid height)
======================== */
.hero {
  /* Layout */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow: hidden;
  text-align: center;
  padding: 4rem 1rem;             /* tighter than 6rem for better vertical balance */
  min-height: 75vh;               /* fill most of the screen */
  max-height: 1000px;             /* cap on ultra-wide monitors */

  /* Background */
  background-color: #24201d;      /* instant paint fallback */
  background-image: url("/images/CodeForgedDigital_Banner.webp");
  background-repeat: no-repeat;
  background-position: center 35%;/* bias upward to keep key content in frame */
  background-size: cover;

  /* Text */
  color: var(--color-white);
}

.hero-cta {
  margin-top: auto;               /* keep CTA content near the bottom edge */
  margin-bottom: 2rem;            /* slight lift so it's not flush with bottom */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.hero-heading {
  flex: 1;                        /* take available vertical space */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Mobile refinement */
@media (max-width: 768px) {
  .hero {
    min-height: 60vh;             /* shorter on phones */
    padding: 3rem 1rem;           /* reduce vertical padding */
    background-position: center 40%; /* minor nudge for mobile crop */
  }
}

/* ========================
   Buttons
======================== */
.button,
button,
a.button-link {
  background: var(--color-accent);
  color: var(--color-white);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}

.button:hover,
button:hover,
a.button-link:hover {
  background: var(--color-dark);
}

/* ========================
   Forms
======================== */
form {
  background: var(--color-white);
  padding: 2rem;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

form label { display: block; margin-bottom: 0.5rem; }

form input,
form textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  margin-bottom: 1rem;
  font-family: inherit;
  font-size: var(--font-size-base);
}

form textarea { resize: vertical; }

.hp-trap {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ========================
   Footer
======================== */
footer {
  background: var(--color-accent);
  color: var(--color-white);
  padding: 1rem 2rem;
  font-size: 0.9rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left {
  flex: 1;
  font-weight: bold;
  text-align: left;
}

.footer-middle {
  flex: 1;
  text-align: center;
  font-style: italic;
}

.footer-right {
  flex: 1;
  text-align: right;
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  margin-top: 0.35rem;
}

/* Footer links: ensure contrast on dark background */
footer a {
  color: #f2f2f2;              /* lighter than default blue */
  text-decoration: none;
  font-weight: bold;
  transition: color 0.2s ease;
}

footer a:hover {
  color: #ffcc00;              /* gold on hover */
  text-decoration: underline;
}

/* ========================
   About Section
======================== */
.about-section { margin: 4rem auto; }

.section-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
}

.section-intro,
.section-outro {
  text-align: center;
  font-size: var(--font-size-lg);
  color: var(--color-mid);
  max-width: 700px;
  margin: 0 auto 2rem;
}

.about-content p {
  margin-bottom: 1.25rem;
  color: var(--color-dark);
}

.about-cta {
  text-align: center;
  margin: 1rem auto 3rem;
}

.about-cta p {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

/* ========================
   Portfolio (Updated)
======================== */
.portfolio-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: 0 auto;
  padding: 0 1rem;
  max-width: 900px;
}

.portfolio-item {
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  padding: 1.5rem;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  gap: 1rem;
}

.portfolio-item img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.portfolio-item h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0.5rem 0;
}

.portfolio-item p {
  color: var(--color-mid);
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .portfolio-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .portfolio-item img {
    width: 40%;
    max-width: 300px;
    margin-left: 2rem;
  }

  .portfolio-item h3,
  .portfolio-item p { text-align: left; }
}

/* ========================
   Mobile Enhancements
======================== */
@media (max-width: 600px) {
  .header-container {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  nav ul {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .hero { padding: 3rem 1rem; }

  .section-title { font-size: 1.5rem; }

  .section-intro,
  .section-outro { font-size: 1rem; }

  .footer-content {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .footer-left,
  .footer-middle,
  .footer-right {
    text-align: left;
    width: 100%;
  }

  .footer-links {
    align-items: flex-start;
  }
}

/* ========================
   Hamburger Menu
======================== */
.nav-toggle { display: none; }

.nav-toggle-label {
  display: none;
  cursor: pointer;
  width: 30px;
  height: 25px;
  position: absolute;
  top: 1.5rem;
  right: 1rem;
  z-index: 1000;
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  display: block;
  background: var(--color-white);
  height: 3px;
  width: 100%;
  position: absolute;
  transition: all 0.3s ease;
}

.nav-toggle-label span::before {
  content: "";
  top: -8px;
}

.nav-toggle-label span::after {
  content: "";
  top: 8px;
}

@media (max-width: 768px) {
  .nav-toggle-label { display: block; }

  nav {
    display: none;
    flex-direction: column;
    background-color: var(--color-accent);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 999;
    padding: 1rem 2rem;
  }

  .nav-toggle:checked + .nav-toggle-label + nav { display: flex; }

  nav ul {
    flex-direction: column;
    gap: 1rem;
    padding: 0;
    margin: 0;
  }

  nav ul li { padding: 0.5rem 0; }

  nav a {
    color: var(--color-white);
    font-size: 1.1rem;
  }
}
/* ========================
   Pricing Page (cleaned, no clip)
======================== */
.pricing-section { 
  margin: 3rem auto; 
}

.pricing-table-wrap {
  background: var(--color-white);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden; /* keeps rounded corners clean */
}

/* --- Desktop & tablet table --- */
.pricing-table {
  width: 100%;
  border-collapse: collapse;
}

.pricing-table th,
.pricing-table td {
  padding: 1rem;
  border: 1px solid var(--color-border);
  vertical-align: top;
  text-align: left;
  font-size: var(--font-size-base);
}

.pricing-table thead th {
  background: var(--color-accent);
  color: var(--color-white);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pricing-table tr:nth-child(even) {
  background: var(--color-light);
}

.pricing-table td strong {
  color: var(--color-accent);
}

/* =========================
   Mobile: stacked cards (≤640px)
   - Labels appear ABOVE values
   - No horizontal scroll or clipping
========================= */
@media (max-width: 640px) {
  /* Hide table header; labels come from data-label on each td */
  .pricing-table thead {
    position: absolute;
    left: -9999px;
    visibility: hidden;
  }

  /* Turn table into stacked blocks */
  .pricing-table,
  .pricing-table tbody,
  .pricing-table tr,
  .pricing-table td {
    display: block;
    width: 100%;
    border: 0; /* borders handled by card + row dividers */
  }

  .pricing-table tr {
    margin: 0 0 1rem 0;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-white);
    overflow: hidden;
  }

  /* Reset zebra striping inside cards */
  .pricing-table tr:nth-child(even) {
    background: var(--color-white);
  }

  .pricing-table td {
    display: block;                /* stack label + value */
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    white-space: normal;
    word-break: break-word;
  }

  .pricing-table td:last-child {
    border-bottom: 0;
  }

  /* Label above value */
  .pricing-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
    color: var(--color-dark);
    opacity: 0.95;
  }

  /* Make the first row field feel like a title */
  .pricing-table td[data-label="Service Type"] {
    font-weight: 700;              /* bold the value */
    font-size: 1.05rem;
  }
}
