/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
  /* Colors */
  --color-primary: #0d4f5c;
  --color-primary-light: #14768a;
  --color-primary-dark: #093a44;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f5f5;
  --color-text: #2d3e50;
  --color-text-muted: #5a6a7a;
  --color-text-light: #ffffff;
  --color-border: #ddd;
  --color-border-light: #e8e8e8;
  --color-footer-bg: #2d3e50;
  --color-footer-text: #ccd6e0;
  --color-focus: #0d4f5c;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --line-height: 1.7;

  /* Font sizes - fluid type scale */
  --size--1: clamp(0.833rem, 0.81rem + 0.1vw, 0.875rem);
  --size-0: clamp(1rem, 0.95rem + 0.23vw, 1.125rem);
  --size-1: clamp(1.2rem, 1.09rem + 0.55vw, 1.5rem);
  --size-2: clamp(1.44rem, 1.24rem + 1.02vw, 2rem);
  --size-3: clamp(1.728rem, 1.39rem + 1.7vw, 2.666rem);
  --size-4: clamp(2.074rem, 1.54rem + 2.69vw, 3.553rem);

  /* Spacing - fluid scale */
  --space-0: 0;
  --space-1: clamp(0.5rem, 0.45rem + 0.23vw, 0.75rem);
  --space-2: clamp(1rem, 0.9rem + 0.45vw, 1.5rem);
  --space-3: clamp(1.5rem, 1.3rem + 0.9vw, 2.5rem);
  --space-4: clamp(2rem, 1.6rem + 1.8vw, 4rem);
  --space-5: clamp(3rem, 2.4rem + 2.7vw, 6rem);

  /* Layout */
  --max-width: 75rem;
}


/* ==========================================================================
   Reset
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  font-size: var(--size-0);
  line-height: var(--line-height);
  color: var(--color-text);
  background-color: var(--color-bg);
}

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

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-2) 0;
  line-height: 1.3;
}

p {
  margin: 0 0 var(--space-2) 0;
}

ul, ol {
  margin: 0 0 var(--space-2) 0;
  padding-left: var(--space-3);
}


/* ==========================================================================
   Typography
   ========================================================================== */

h1 {
  font-size: var(--size-4);
  font-weight: 700;
  color: var(--color-primary);
}

h2 {
  font-size: var(--size-3);
  font-weight: 600;
  color: var(--color-primary);
}

h3 {
  font-size: var(--size-2);
  font-weight: 600;
  color: var(--color-text);
}

h4 {
  font-size: var(--size-1);
  font-weight: 600;
}


/* ==========================================================================
   Links
   ========================================================================== */

a {
  color: var(--color-primary);
  text-decoration: underline;
  transition: color 0.2s ease;
}

a:hover,
a:focus,
a:active {
  color: var(--color-primary-light);
}

a:focus {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}


/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-2);
}

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


/* ==========================================================================
   Skip Link
   ========================================================================== */

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-2);
  padding: var(--space-1) var(--space-2);
  background-color: var(--color-primary);
  color: var(--color-text-light);
  text-decoration: none;
  z-index: 1000;
  border-radius: 0 0 0.25rem 0.25rem;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  color: var(--color-text-light);
}


/* ==========================================================================
   Header
   ========================================================================== */

.header {
  background-color: var(--color-primary);
  color: var(--color-text-light);
  position: relative;
  z-index: 100;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.header__logo {
  text-decoration: none;
  color: var(--color-text-light);
  font-weight: 700;
  font-size: var(--size-1);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.header__logo:hover,
.header__logo:focus,
.header__logo:active {
  color: var(--color-text-light);
  opacity: 0.9;
}

.header__logo-prefix {
  font-weight: 300;
}


/* ==========================================================================
   Navigation
   ========================================================================== */

.nav {
  display: none;
}

.nav--open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--color-primary);
  padding: 0 var(--space-2) var(--space-2);
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nav__link {
  display: block;
  padding: var(--space-1) 0;
  color: var(--color-text-light);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.25rem;
  transition: text-decoration-color 0.2s ease;
  font-size: var(--size-0);
}

.nav__link:hover,
.nav__link:focus,
.nav__link:active {
  color: var(--color-text-light);
  text-decoration-color: var(--color-text-light);
}

.nav__link--active {
  text-decoration-color: var(--color-text-light);
  font-weight: 600;
}

/* Hamburger */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1);
  width: 2.75rem;
  height: 2.75rem;
}

.nav-toggle__bar {
  display: block;
  width: 1.5rem;
  height: 2px;
  background-color: var(--color-text-light);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle:focus {
  outline: 2px solid var(--color-text-light);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(0.425rem) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-0.425rem) rotate(-45deg);
}

/* Desktop nav */
@media (min-width: 50rem) {
  .nav {
    display: flex;
  }

  .nav__list {
    flex-direction: row;
    gap: var(--space-3);
  }

  .nav__link {
    padding: var(--space-1) 0;
  }

  .nav-toggle {
    display: none;
  }
}


/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  background-color: var(--color-bg-alt);
  padding: var(--space-4) 0;
  text-align: center;
}

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

.hero__subtitle {
  font-size: var(--size-1);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}


/* ==========================================================================
   Interactive SVG House
   ========================================================================== */

.house-svg {
  max-width: 50rem;
  margin: 0 auto var(--space-3);
}

.house-svg svg {
  width: 100%;
  height: auto;
}

.house-svg__zone {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.house-svg__zone:hover,
.house-svg__zone:focus {
  opacity: 0.8;
}

.house-svg__zone:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.house-svg__label {
  font-size: 0.8125rem;
  font-family: var(--font-family);
  fill: var(--color-primary);
  letter-spacing: 0.04em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.house-svg__zone:hover + .house-svg__label,
.house-svg__zone:focus + .house-svg__label,
.house-svg__zone:hover .house-svg__label,
.house-svg__zone:focus .house-svg__label {
  opacity: 1;
}


/* ==========================================================================
   Sections
   ========================================================================== */

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

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

.section__title {
  text-align: center;
  margin-bottom: var(--space-4);
}

.section__intro {
  text-align: center;
  max-width: 45rem;
  margin: 0 auto var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--size-1);
}


/* ==========================================================================
   Contact Layout
   ========================================================================== */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 50rem) {
  .contact-layout {
    grid-template-columns: 1fr 1fr;
  }
}


/* ==========================================================================
   Product Cards (homepage)
   ========================================================================== */

.product-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 40rem) {
  .product-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.product-card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: 0.5rem;
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.product-card:hover,
.product-card:focus,
.product-card:active {
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.1);
  transform: translateY(-0.125rem);
  color: var(--color-text);
}

.product-card:focus {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.product-card__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.product-card__body {
  padding: var(--space-2);
}

.product-card__title {
  font-size: var(--size-1);
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: var(--color-primary);
}

.product-card__desc {
  color: var(--color-text-muted);
  font-size: var(--size--1);
  margin: 0;
}


/* ==========================================================================
   Product Detail (product pages)
   ========================================================================== */

.product {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.product:last-of-type {
  border-bottom: none;
}

.product__header {
  margin-bottom: var(--space-3);
}

.product__title {
  font-size: var(--size-3);
  margin-bottom: var(--space-1);
}

.product__desc {
  font-size: var(--size-1);
  color: var(--color-text-muted);
  max-width: 50rem;
}

.product__content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 50rem) {
  .product__content {
    grid-template-columns: 1fr 1fr;
  }
}

.image {
  border-radius: 0.5rem;
  max-width: 100%;
  height: auto;
}

.product__specs {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}


/* ==========================================================================
   Tech Spec Tables
   ========================================================================== */

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--size--1);
  margin-bottom: var(--space-2);
}

.spec-table caption {
  text-align: left;
  font-weight: 600;
  font-size: var(--size-0);
  margin-bottom: var(--space-1);
  color: var(--color-text);
}

.spec-table th,
.spec-table td {
  padding: var(--space-1);
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

.spec-table th {
  background-color: var(--color-bg-alt);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

.spec-table td {
  color: var(--color-text-muted);
}

.spec-table tbody tr:hover {
  background-color: var(--color-bg-alt);
}

.spec-table__note {
  font-size: var(--size--1);
}

/* Spec list (key-value pairs) */
.spec-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.spec-list li {
  display: flex;
  justify-content: space-between;
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: var(--size--1);
}

.spec-list__label {
  font-weight: 600;
  color: var(--color-text);
}

.spec-list__value {
  color: var(--color-text-muted);
  text-align: right;
}


/* ==========================================================================
   Benefits Grid
   ========================================================================== */

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

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

.benefits__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

@media (min-width: 35rem) {
  .benefits__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 60rem) {
  .benefits__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.benefit {
  background-color: var(--color-bg-alt);
  padding: var(--space-3);
  border-radius: 0.5rem;
  text-align: center;
}

.benefit__icon {
  width: var(--size-3);
  height: var(--size-3);
  margin-bottom: var(--space-1);
  margin-inline: auto;
  display: block;
  color: var(--color-primary);
}

.benefit__title {
  font-size: var(--size-0);
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: var(--color-primary);
}

.benefit__desc {
  font-size: var(--size--1);
  color: var(--color-text-muted);
  margin: 0;
}


/* ==========================================================================
   Options / Colors section
   ========================================================================== */

.options-section__title {
  font-size: var(--size-1);
  margin-bottom: var(--space-1);
}

.options-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-2) 0;
}

.options-list li {
  position: relative;
  padding-left: var(--space-3);
  margin-bottom: var(--space-1);
  color: var(--color-text-muted);
}

.options-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 0.4rem;
  height: 0.4rem;
  background-color: var(--color-primary);
  border-radius: 50%;
}


/* ==========================================================================
   Contact Form
   ========================================================================== */

.contact-form {
  max-width: 35rem;
}

.form-group {
  margin-bottom: var(--space-2);
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-1);
  font-size: var(--size--1);
  color: var(--color-text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-family);
  font-size: var(--size-0);
  color: var(--color-text);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-primary);
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.form-group textarea {
  min-height: 8rem;
  resize: vertical;
}

.form-group__optional {
  font-weight: 400;
  color: var(--color-text-muted);
}


/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
  padding: var(--space-2);
  border-radius: 0.25rem;
  margin-bottom: var(--space-2);
  font-size: var(--size--1);
}

.alert p {
  margin: 0 0 var(--space-1) 0;
}

.alert p:last-child {
  margin-bottom: 0;
}

.alert--success {
  background-color: #e8f5e9;
  border: 1px solid #4caf50;
  color: #2e7d32;
}

.alert--error {
  background-color: #fbe9e7;
  border: 1px solid #e53935;
  color: #c62828;
}


/* ==========================================================================
   Contact Info
   ========================================================================== */

.contact-info {
  font-style: normal;
}

.contact-info__item {
  margin-bottom: var(--space-2);
}

.contact-info__label {
  display: block;
  font-weight: 600;
  font-size: var(--size--1);
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.contact-info__value {
  color: var(--color-text-muted);
}


/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: var(--size-0);
  font-family: var(--font-family);
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn:focus {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

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

.btn--primary:hover,
.btn--primary:focus,
.btn--primary:active {
  background-color: var(--color-primary-light);
  color: var(--color-text-light);
}

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

.btn--outline:hover,
.btn--outline:focus,
.btn--outline:active {
  background-color: var(--color-primary);
  color: var(--color-text-light);
}


/* ==========================================================================
   CTA
   ========================================================================== */

.cta {
  text-align: center;
  padding: var(--space-4) 0;
}

.cta__title {
  margin-bottom: var(--space-1);
}

.cta__desc {
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}


/* ==========================================================================
   Page Header (product pages)
   ========================================================================== */

.page-header {
  background-color: var(--color-primary);
  color: var(--color-text-light);
  padding: var(--space-4) 0;
}

.page-header__title {
  color: var(--color-text-light);
  margin-bottom: var(--space-1);
}

.page-header__desc {
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--size-1);
  max-width: 40rem;
  margin: 0;
}


/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background-color: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: var(--space-4) 0;
}

.footer__content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

@media (min-width: 50rem) {
  .footer__content {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.footer__title {
  color: var(--color-text-light);
  font-size: var(--size-0);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.footer__text {
  font-size: var(--size--1);
  color: var(--color-footer-text);
  margin: 0 0 var(--space-1) 0;
}

.footer__nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer__nav li {
  margin-bottom: var(--space-1);
}

.footer__nav a {
  color: var(--color-footer-text);
  text-decoration: underline;
  font-size: var(--size--1);
}

.footer__nav a:hover,
.footer__nav a:focus,
.footer__nav a:active {
  color: var(--color-text-light);
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: var(--space-2);
  text-align: center;
}

.footer__bottom p {
  font-size: var(--size--1);
  color: var(--color-footer-text);
  margin: 0;
}

.footer__bottom a {
  color: var(--color-footer-text);
  text-decoration: underline;
}

.footer__bottom a:hover,
.footer__bottom a:focus,
.footer__bottom a:active {
  color: var(--color-text-light);
}


/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .header,
  .page-header {
    background: #fff;
    color: #000;
  }

  .header__logo,
  .page-header__title {
    color: #000;
  }

  .nav-toggle,
  .skip-link {
    display: none;
  }

  .footer {
    background: #fff;
    color: #000;
    border-top: 1px solid #000;
  }

  .footer__title,
  .footer__text,
  .footer__nav a,
  .footer__bottom p,
  .footer__bottom a {
    color: #000;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href^="http"]::after,
  a[href^="mailto"]::after {
    content: " (" attr(href) ")";
  }

  h1, h2, h3, h4 {
    color: #000;
  }

  p, li, td {
    color: #333;
  }

  .btn {
    border: 1px solid #000;
    background: #fff;
    color: #000;
  }

  .product-card {
    border: 1px solid #000;
    break-inside: avoid;
  }

  .benefit {
    background: #f5f5f5;
    break-inside: avoid;
  }

  .spec-table th {
    background: #eee;
  }
}
