/* ============================================
   SENWAY TILE COMPANY — Design Tokens & Styles
   ============================================ */

/* --- Type Scale --- */
:root {
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);

  /* --- Spacing System (4px base) --- */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* --- Fonts --- */
  --font-display: 'Instrument Serif', 'Georgia', serif;
  --font-body: 'Switzer', 'Work Sans', 'Helvetica Neue', sans-serif;

  /* --- Radius --- */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* --- Transitions --- */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* --- Content Widths --- */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;
}

/* ============================================
   COLOR PALETTE — Luxury Tile / Architectural
   Warm off-whites, charcoal text, muted bronze accent
   ============================================ */

:root, [data-theme="light"] {
  /* Surfaces */
  --color-bg:             #FAFAF7;
  --color-surface:        #F5F4F0;
  --color-surface-2:      #EEEEE9;
  --color-surface-offset: #E8E7E2;
  --color-divider:        #D5D3CD;
  --color-border:         #C8C5BD;

  /* Text */
  --color-text:           #2B2926;
  --color-text-muted:     #6B6862;
  --color-text-faint:     #A8A59E;
  --color-text-inverse:   #FAFAF7;

  /* Primary Accent — Warm Bronze/Dark Gold */
  --color-primary:        #8B7355;
  --color-primary-hover:  #74604A;
  --color-primary-active: #5C4D3B;

  /* Secondary — Deep Charcoal */
  --color-secondary:      #3A3835;
  --color-secondary-hover:#2B2926;

  /* Shadows */
  --shadow-sm: 0 1px 2px oklch(0.2 0.01 60 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 60 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.01 60 / 0.12);
}

/* DARK MODE */
[data-theme="dark"] {
  --color-bg:             #1A1918;
  --color-surface:        #222120;
  --color-surface-2:      #2A2928;
  --color-surface-offset: #1E1D1C;
  --color-divider:        #333231;
  --color-border:         #3E3D3B;

  --color-text:           #E0DED9;
  --color-text-muted:     #9A9792;
  --color-text-faint:     #6A6763;
  --color-text-inverse:   #1A1918;

  --color-primary:        #C4A882;
  --color-primary-hover:  #D4BC9A;
  --color-primary-active: #B09670;

  --color-secondary:      #D0CEC9;
  --color-secondary-hover:#E0DED9;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #1A1918;
    --color-surface:        #222120;
    --color-surface-2:      #2A2928;
    --color-surface-offset: #1E1D1C;
    --color-divider:        #333231;
    --color-border:         #3E3D3B;
    --color-text:           #E0DED9;
    --color-text-muted:     #9A9792;
    --color-text-faint:     #6A6763;
    --color-text-inverse:   #1A1918;
    --color-primary:        #C4A882;
    --color-primary-hover:  #D4BC9A;
    --color-primary-active:  #B09670;
    --color-secondary:      #D0CEC9;
    --color-secondary-hover:#E0DED9;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.35);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.45);
  }
}

/* ============================================
   GLOBAL TYPOGRAPHY
   ============================================ */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
}

.section-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-primary);
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-4) var(--space-6);
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.header--scrolled {
  border-bottom-color: var(--color-divider);
  box-shadow: var(--shadow-sm);
}

.header__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}

.header__logo svg {
  width: 36px;
  height: 36px;
}

.header__logo-text {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.header__nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}

.header__nav-links a {
  font-size: var(--text-sm);
  font-weight: 450;
  color: var(--color-text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  position: relative;
}

.header__nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

.header__nav-links a:hover {
  color: var(--color-text);
}

.header__nav-links a:hover::after {
  width: 100%;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface);
}

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

.mobile-menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  background: var(--color-bg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
}

.mobile-nav.active {
  display: flex;
}

.mobile-nav a {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  text-decoration: none;
}

.mobile-nav a:hover {
  color: var(--color-primary);
}

@media (max-width: 768px) {
  .header__nav-links { display: none; }
  .theme-toggle { display: none; }
  .mobile-menu-btn { display: flex; }

  .header {
    padding: var(--space-3) var(--space-4);
  }
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    oklch(from var(--color-bg) l c h / 0.85) 0%,
    oklch(from var(--color-bg) l c h / 0.5) 50%,
    oklch(from var(--color-bg) l c h / 0.2) 100%
  );
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-32) var(--space-6) var(--space-16);
  width: 100%;
}

.hero__title {
  font-size: var(--text-3xl);
  font-weight: 400;
  line-height: 1.08;
  color: var(--color-text);
  max-width: 14ch;
  margin-bottom: var(--space-6);
}

.hero__subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 48ch;
  line-height: 1.7;
  margin-bottom: var(--space-8);
}

.hero__actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-interactive);
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  border: 1px solid var(--color-primary);
}

.btn--primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.btn--secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn--secondary:hover {
  border-color: var(--color-text-muted);
  background: var(--color-surface);
}

/* ============================================
   SECTION LAYOUT
   ============================================ */

.section {
  padding: clamp(var(--space-12), 8vw, var(--space-24)) var(--space-6);
}

.section__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
}

.section__header {
  text-align: center;
  margin-bottom: clamp(var(--space-8), 4vw, var(--space-16));
}

.section__title {
  font-size: var(--text-2xl);
  color: var(--color-text);
  margin-top: var(--space-3);
}

.section__subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 52ch;
  margin: var(--space-4) auto 0;
}

/* ============================================
   PRODUCT CATEGORIES GRID
   ============================================ */

.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

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

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

.category-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
  group: card;
}

.category-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-card:hover .category-card__img {
  transform: scale(1.04);
}

.category-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    oklch(0.1 0 0 / 0.75) 0%,
    oklch(0.1 0 0 / 0.1) 60%,
    oklch(0.1 0 0 / 0) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-6);
  transition: background 0.3s ease;
}

.category-card:hover .category-card__overlay {
  background: linear-gradient(
    to top,
    oklch(0.1 0 0 / 0.85) 0%,
    oklch(0.1 0 0 / 0.2) 60%,
    oklch(0.1 0 0 / 0) 100%
  );
}

.category-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: #fff;
  margin-bottom: var(--space-1);
}

.category-card__info {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.02em;
}

.category-card__desc {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.6);
  margin-top: var(--space-2);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
}

.category-card:hover .category-card__desc {
  max-height: 80px;
  opacity: 1;
  margin-top: var(--space-2);
}

/* ============================================
   WHY SENWAY SECTION
   ============================================ */

.why-section {
  background: var(--color-surface);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

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

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

.why-card {
  padding: var(--space-8) var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.why-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.why-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  color: var(--color-primary);
  margin-bottom: var(--space-5);
}

.why-card__icon svg {
  width: 24px;
  height: 24px;
}

.why-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.why-card__text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ============================================
   SPECIFICATIONS TABLE
   ============================================ */

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

.specs-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-divider);
  background: var(--color-surface);
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.specs-table thead {
  background: var(--color-secondary);
}

.specs-table th {
  padding: var(--space-4) var(--space-6);
  text-align: left;
  font-weight: 500;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-inverse);
  white-space: nowrap;
}

[data-theme="dark"] .specs-table thead {
  background: var(--color-surface-2);
}

[data-theme="dark"] .specs-table th {
  color: var(--color-text);
}

.specs-table td {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-divider);
  color: var(--color-text);
  white-space: nowrap;
}

.specs-table tbody tr:last-child td {
  border-bottom: none;
}

.specs-table tbody tr:hover {
  background: var(--color-surface-offset);
}

.specs-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
}

.specs-badge--pass {
  background: oklch(0.45 0.15 145 / 0.12);
  color: #437a22;
}

[data-theme="dark"] .specs-badge--pass {
  background: oklch(0.45 0.15 145 / 0.2);
  color: #6daa45;
}

/* ============================================
   CERTIFICATIONS
   ============================================ */

.certs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-10);
  flex-wrap: wrap;
  margin-top: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-divider);
}

.cert-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
}

.cert-item__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  color: var(--color-primary);
}

.cert-item__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  max-width: 140px;
}

/* ============================================
   CONTACT SECTION
   ============================================ */

.contact-section {
  background: var(--color-surface);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: start;
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

.contact-info__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.contact-info__text {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  max-width: 44ch;
  line-height: 1.7;
}

.contact-detail {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.contact-detail__icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-primary);
}

.contact-detail__label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-1);
}

.contact-detail__value {
  font-size: var(--text-sm);
  color: var(--color-text);
}

.contact-form {
  background: var(--color-bg);
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-divider);
}

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

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-group--full {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-group input,
.form-group textarea {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: var(--text-sm);
  color: var(--color-text);
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-text-faint);
}

.contact-form .btn {
  width: 100%;
  justify-content: center;
  margin-top: var(--space-4);
  padding: var(--space-4) var(--space-6);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  padding: var(--space-12) var(--space-6) var(--space-8);
  border-top: 1px solid var(--color-divider);
  background: var(--color-bg);
}

.footer__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: var(--space-10);
}

@media (max-width: 768px) {
  .footer__inner {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.footer__brand-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}

.footer__brand-logo svg {
  width: 28px;
  height: 28px;
}

.footer__brand-name {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer__brand-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 36ch;
  line-height: 1.7;
}

.footer__col-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer__links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer__links a:hover {
  color: var(--color-primary);
}

.footer__bottom {
  max-width: var(--content-wide);
  margin: var(--space-10) auto 0;
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer__copyright {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer__legal {
  display: flex;
  gap: var(--space-6);
}

.footer__legal a {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-decoration: none;
}

.footer__legal a:hover {
  color: var(--color-text-muted);
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ============================================
   UTILITY
   ============================================ */

.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
