@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   Design System Tokens (Editorial Minimalism)
   ========================================================================== */
:root {
  /* Core Palette */
  --bg-surface: #f9f9f9;
  --primary: #000000;
  --secondary: #5c5f60;
  --surface-lowest: #ffffff;
  --surface-high: #e8e8e8;
  --on-surface: #1a1c1c;

  /* Typography */
  --font-family: 'Inter', sans-serif;
  
  /* Spacing */
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 48px;
  --spacing-xl: 96px;
}

/* ==========================================================================
   Base Reset & Typography
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-surface);
  color: var(--on-surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* guard against accidental horizontal scroll on small screens */
}

/* Strict B&W Enforcement on Images */
img {
  filter: grayscale(100%);
  max-width: 100%;
  display: block;
}

/* Typography Hierarchy */
.display-lg {
  font-size: clamp(2.25rem, 8vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--primary);
  line-height: 1.1;
}

.display-md {
  font-size: clamp(1.9rem, 6vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--primary);
  line-height: 1.15;
}

.title-md {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--primary);
}

.body-lg {
  font-size: 1rem;
  font-weight: 400;
}

.body-md {
  font-size: 0.875rem;
  font-weight: 400;
}

.label-sm {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}

/* ==========================================================================
   Layout & Grid
   ========================================================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.section {
  padding: var(--spacing-xl) 0;
}

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

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

/* Asymmetrical Grids */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
}

/* ==========================================================================
   Components
   ========================================================================== */
/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}
.btn-primary:hover {
  background-color: #333333;
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-secondary:hover {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-tertiary {
  background-color: transparent;
  color: var(--primary);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.btn-tertiary:hover {
  color: var(--secondary);
}

/* Input Fields */
.input-field {
  width: 100%;
  padding: 16px 20px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 1rem;
  background-color: var(--surface-lowest);
  color: var(--on-surface);
  transition: all 0.2s ease;
}
.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

/* Signature Component: Fluid Insight Card */
.fluid-insight-card {
  background-color: var(--surface-lowest);
  padding: var(--spacing-lg);
  border-radius: 12px 24px 12px 12px; /* 24px Top-right asymmetrical flick */
  box-shadow: 0 20px 40px rgba(26, 28, 28, 0.04); /* Ambient shadow */
}

/* ==========================================================================
   Navigation (Glassmorphism)
   ========================================================================== */
.header-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  z-index: 1000;
  transition: all 0.3s ease;
  background-color: var(--bg-surface);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.brand {
  display: flex;
  align-items: center;
}

.brand img {
  mix-blend-mode: multiply;
}

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
  gap: var(--spacing-md);
}

.nav-links a {
  text-decoration: none;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 500;
}

.nav-links a.btn-primary {
  color: #ffffff;
}

.nav-links a:not(.btn):hover {
  color: var(--secondary);
}

/* Hamburger toggle — hidden on desktop, revealed in the mobile media query */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
  transition: transform 0.3s ease, opacity 0.2s ease;
}

.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding-top: 180px;
  padding-bottom: 220px;
  background-color: var(--bg-surface);
}

.hero-content {
  max-width: 600px;
}

.hero-label {
  display: block;
  margin-bottom: var(--spacing-sm);
  color: var(--secondary);
}

.hero h1 {
  margin-bottom: var(--spacing-md);
}

.hero-tagline {
  color: var(--secondary);
  max-width: 500px;
  margin-bottom: var(--spacing-lg);
}

.hero-actions {
  display: flex;
  gap: var(--spacing-sm);
}

/* Hero Visual Layout - Asymmetrical Placement */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
}

.hero-floating-card {
  width: 100%;
  max-width: 400px;
  border: 1px solid rgba(0,0,0,0.05);
}

/* ==========================================================================
   Chat Simulator
   ========================================================================== */
.simulator-container {
  max-width: 800px;
  margin: var(--spacing-lg) auto 0;
}

.simulator-device {
  background-color: var(--surface-lowest);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(26, 28, 28, 0.04);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.05);
}

.simulator-header {
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.simulator-avatar {
  width: 40px;
  height: 40px;
  background-color: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.simulator-title h4 {
  font-size: 0.875rem;
  color: var(--primary);
  margin-bottom: 2px;
}

.simulator-title p {
  font-size: 0.6875rem;
  color: var(--secondary);
}

.simulator-body {
  padding: var(--spacing-md);
  height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  background-color: var(--bg-surface);
}

.chat-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
}

.chat-bubble-bot {
  background-color: var(--surface-lowest);
  color: var(--on-surface);
  border: 1px solid rgba(0,0,0,0.05);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-bubble-user {
  background-color: var(--primary);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-prompt-tags {
  padding: var(--spacing-md);
  background-color: var(--surface-lowest);
  border-top: 1px solid rgba(0,0,0,0.05);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-btn {
  background-color: var(--surface-high);
  border: none;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--primary);
  transition: background-color 0.2s;
  font-family: var(--font-family);
}
.tag-btn:hover {
  background-color: #d0d0d0;
}

/* ==========================================================================
   Visuals & Features
   ========================================================================== */
.feature-showcase-row {
  margin-bottom: var(--spacing-xl);
}

.showcase-cover-img {
  width: 100%;
  border-radius: 12px;
  filter: grayscale(100%);
}

.mockup-weather-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* ==========================================================================
   Footer
   ========================================================================== */
#website-footer {
  padding: var(--spacing-lg) 0;
  background-color: var(--surface-lowest);
  border-top: 1px solid rgba(0,0,0,0.05);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
}

.footer-links {
  display: flex;
  list-style: none;
  gap: var(--spacing-md);
  margin-top: var(--spacing-sm);
}

.footer-links a {
  text-decoration: none;
  color: var(--secondary);
  font-size: 0.875rem;
}

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

.copyright {
  font-size: 0.75rem;
  color: var(--secondary);
  margin-top: var(--spacing-md);
}

/* Utilities */
.card-label {
  display: block;
  margin-bottom: var(--spacing-sm);
}

.card-title {
  margin-bottom: var(--spacing-sm);
}

.card-description {
  color: var(--secondary);
}

.subscribe-section {
  display: flex;
  justify-content: center;
}

.subscribe-card {
  width: 100%;
  max-width: 800px;
  text-align: center;
}

.subscribe-form {
  display: flex;
  gap: var(--spacing-sm);
  max-width: 500px;
  margin: 0 auto;
}

.success-message {
  display: none;
  color: var(--primary);
  margin-top: var(--spacing-sm);
  font-size: 0.875rem;
}

.weather-badge {
  background-color: var(--primary);
  color: var(--surface-lowest);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* ==========================================================================
   Responsive — Tablet & Mobile
   ========================================================================== */

/* Tablet and below: collapse asymmetric grids, switch nav to hamburger */
@media (max-width: 900px) {
  /* Navigation → hamburger + slide-down panel */
  .header-nav {
    height: 72px;
  }

  #nav-brand-icon {
    height: 56px !important; /* override the 100px inline desktop logo size */
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
    background-color: var(--bg-surface);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
    max-height: calc(100vh - 72px);
    overflow-y: auto;
    transform: translateY(-150%);
    transition: transform 0.3s ease;
  }

  .nav-links.is-open {
    transform: translateY(0);
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a:not(.btn) {
    display: block;
    padding: 14px 4px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  .nav-links a.btn-primary {
    width: 100%;
    margin-top: var(--spacing-sm);
  }

  /* Hero spacing trimmed for shorter viewports */
  .hero {
    padding-top: 112px;
    padding-bottom: 64px;
  }

  /* Asymmetric grids stack to a single column */
  .grid-2 {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }

  /* Keep the headline leading both feature rows once stacked */
  #blueprint > div:first-child {
    padding-right: 0 !important;
  }

  #weather-risk > div:nth-child(1) {
    order: 0 !important;
    padding-left: 0 !important;
  }

  #weather-risk > div:nth-child(2) {
    order: 1 !important;
  }

  /* Tighter vertical rhythm */
  .section {
    padding: var(--spacing-lg) 0;
  }

  .feature-showcase-row {
    margin-bottom: var(--spacing-lg);
  }

  .hero-floating-card {
    margin-top: var(--spacing-md) !important;
  }
}

/* Phones: single-column cards, stacked actions, comfortable padding */
@media (max-width: 600px) {
  .container {
    padding: 0 var(--spacing-sm);
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  /* Full-width stacked CTAs */
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  /* Newsletter input + button stack */
  .subscribe-form {
    flex-direction: column;
  }

  .subscribe-form .btn {
    width: 100%;
  }

  /* Card padding scaled down so content isn't cramped */
  .fluid-insight-card {
    padding: var(--spacing-md);
  }

  #mockup-dashboard-card {
    padding: var(--spacing-md) !important;
  }

  /* Let the pet/risk header wrap instead of overflowing */
  .mockup-status-bar {
    flex-wrap: wrap;
  }

  .simulator-body {
    height: 260px;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: var(--spacing-xs);
  }
}
