/* ============================================
   DESIGN TOKENS
   ============================================ */

/* Color Primitives */
:root {
  --peri: #cbdceb;
  --pippin: #ffe3e3;
  --old-lace: #fdf5e6;
  --nile-blue: #1b3c53;
}

/* Brand Colors - Light Mode */
:root {
  --background-bg-main: var(--old-lace);
  --background-bg-card: var(--pippin);
  --background-bg-nav: var(--nile-blue);
  --background-bg-footer: var(--nile-blue);
  --text-text-primary: var(--nile-blue);
  --text-text-inverse: var(--peri);
  --text-text-muted: var(--peri);
  --accent-accent-primary: var(--peri);
  --accent-accent-soft: var(--pippin);
}

/* Typography */
:root {
  --font-family-body: "Open Sans", sans-serif;
  --font-family-heading: "Playfair Display", serif;
  
  --font-size-text-sm: 0.875rem;    /* 14px */
  --font-size-text-md: 1rem;        /* 16px */
  --font-size-text-lg: 1.5rem;      /* 24px */
  --font-size-text-xl: 2.25rem;     /* 36px */
  
  --font-weight-regular: 400;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  --spacing-space-2: 0.5rem;   /* 8px */
  --spacing-space-4: 1rem;     /* 16px */
  --spacing-space-6: 1.5rem;   /* 24px */
  --spacing-space-8: 2rem;     /* 32px */
  --spacing-space-12: 3rem;    /* 48px */
  
  --max-width: 1100px;
}

/* ============================================
   BASE STYLES
   ============================================ */

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

/* dark mode */
[data-theme="dark"] {
  --background-bg-main: #1b3c53;
  --background-bg-card: #cbdceb;
  --background-bg-nav: #ffe3e3;
  --background-bg-footer: #ffe3e3;
  --text-text-primary: #fdf5e6;
  --text-text-inverse: #1b3c53;
  --text-text-muted: #cbdceb;
  --accent-accent-primary: #cbdceb;
  --accent-accent-soft: #ffe3e3;
}

h1 {
  font-family: var(--font-family-heading);
  color: var(--text-text-primary);
  font-size: 3rem;
  font-weight: var(--font-weight-bold);
}

h2 {
  font-family: var(--font-family-body);
  font-size: var(--font-size-text-lg);
  font-weight: var(--font-weight-semibold);
}

h3 {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-text-md);
  font-weight: var(--font-weight-semibold);
}

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

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-space-6) var(--spacing-space-8);
  padding-top: 40px;
}

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

.hero {
  min-height: 60vh;
  background-color: var(--background-bg-main);
  background-size: cover;
  background-position: bottom;
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: var(--spacing-space-8);
  color: var(--text-text-primary);
}

.hero-image {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* ============================================
   ABOUT SECTION
   ============================================ */

.about {
  padding-top: var(--spacing-space-6);
  padding-bottom: 2.5rem;
}

.about-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--spacing-space-12);
  text-align: left;
}

.about-image {
  flex: 0 0 420px;
}

.about-image img {
  width: 100%;
  height: auto;
  border-radius: 28px;
  object-fit: cover;
  display: block;
}

.about-text h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.about-text p {
  margin: 0;
  max-width: 520px;
  font-size: 1.05rem;
  line-height: 1.7;
}

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

.site-header {
  background-color: var(--background-bg-nav);
  color: var(--text-text-inverse);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.nav-bar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem var(--spacing-space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: var(--spacing-space-6);
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-family: var(--font-family-body);
  text-transform: uppercase;
  text-align: center;
  font-size: var(--font-size-text-sm);
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--text-text-inverse);
  font-weight: var(--font-weight-regular);
}

.nav-links a:hover,
.nav-link:hover {
  text-decoration: underline;
}

/* ============================================
   THEME TOGGLE PILL
   ============================================ */

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;

  padding: 0.35rem 0.75rem;
  border-radius: 999px;

  background-color: var(--background-bg-card);
  border: 1px solid rgba(0, 0, 0, 0.1);

  cursor: pointer;
  transition: background-color 200ms ease;
}

.theme-toggle .icon {
  font-size: 1rem;
  line-height: 1;
  padding: 0.35rem;
  border-radius: 50%;

  opacity: 0.4;
  transition: opacity 200ms ease, background-color 200ms ease, transform 200ms ease;
}

/* Active state: highlight correct icon */
html[data-theme="light"] .theme-toggle .sun {
  opacity: 1;
  background-color: var(--accent-accent-primary);
}

html[data-theme="dark"] .theme-toggle .moon {
  opacity: 1;
  background-color: var(--accent-accent-primary);
}

/* ============================================
   PROJECTS SECTION
   ============================================ */

.products {
  padding-top: var(--spacing-space-8);
}

.section-title {
  margin-bottom: var(--spacing-space-8);
}

.product-card {
  display: flex;
  gap: var(--spacing-space-8);
  margin-bottom: 2.75rem;
  background-color: var(--background-bg-card);
  border-radius: 18px;
  padding: 1.75rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
}

.hidden-project {
  display: none;
}

/* Alternating layout */
.product-card:nth-of-type(odd) {
  flex-direction: row-reverse;
}

.product-card:nth-of-type(even) {
  flex-direction: row;
}

/* Project card hover */
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.16);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.product-text,
.product-image {
  flex: 1;
}

.product-text h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.product-text p {
  margin: 0;
  font-size: 0.95rem;
}

.product-text a {
  color: var(--text-text-primary);
  font-weight: var(--font-weight-semibold);
  text-decoration: underline;
}

.product-image img {
  width: 100%;
  display: block;
  border-radius: 14px;
  object-fit: cover;
}

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

.site-footer {
  background-color: var(--background-bg-footer);
  color: var(--text-text-inverse);
  padding: var(--spacing-space-8) var(--spacing-space-4);
  font-family: var(--font-family-body);
  font-size: var(--font-size-text-sm);
  margin-top: var(--spacing-space-8);
}

.site-footer p {
  margin: 0;
  opacity: 0.85;
  letter-spacing: 0.3px;
}

/* ============================================
   MEDIA QUERIES
   ============================================ */

@media (max-width: 768px) {
  main {
    padding: 4.5rem var(--spacing-space-4) var(--spacing-space-12);
  }

  .hero {
    min-height: auto;
    padding: var(--spacing-space-8) var(--spacing-space-6) 2.5rem;
    align-items: flex-end;
  }

  .hero h1 {
    font-size: 3rem;
    margin-top: 0;
  }

  .about-inner {
    flex-direction: column;
    text-align: center;
  }

  .about-text p {
    max-width: 100%;
  }

  .product-card {
    flex-direction: column;
  }

  .product-card:nth-of-type(odd),
  .product-card:nth-of-type(even) {
    flex-direction: column;
  }

  .product-card:hover {
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
