/* ─────────────────────────────────────────
   Design System Tokens
   ───────────────────────────────────────── */

:root {
  /* Grayscale */
  --noir: #111111;
  --anthracite: #2C2C2C;
  --graphite: #555555;
  --gris: #8C8C8C;
  --argent: #B8B8B8;
  --perle: #E5E5E5;
  --neige: #F7F7F5;
  --blanc: #FFFFFF;

  /* Accent */
  --olive: #6B6B3C;
  --olive-mid: #8A8A52;

  /* Danger */
  --danger: #9B3B3B;

  /* Fonts */
  --font-display: 'EB Garamond', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-2xl: 80px;

  /* Layout */
  --header-h: 44px;
  --max-w: 1080px;
  --max-w-narrow: 640px;
}

/* ─────────────────────────────────────────
   Reset
   ───────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-md));
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--noir);
  background: var(--blanc);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ─────────────────────────────────────────
   Layout
   ───────────────────────────────────────── */

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

.container--narrow {
  max-width: var(--max-w-narrow);
}

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

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

.section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: var(--space-xl);
  text-align: center;
}

/* ─────────────────────────────────────────
   Header
   ───────────────────────────────────────── */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--blanc);
  border-bottom: 1px solid var(--perle);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  color: var(--noir);
  position: relative;
}

.wordmark::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--olive);
}

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

.nav-link {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--graphite);
  transition: color 0.15s;
}

.nav-link:hover {
  color: var(--noir);
}

.nav-link--cta {
  color: var(--olive);
  font-weight: 500;
}

.nav-link--cta:hover {
  color: var(--olive-mid);
}

/* Hamburger */

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 24px;
  height: 18px;
  position: relative;
  z-index: 110;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--noir);
  position: absolute;
  left: 0;
  transition: transform 0.2s, opacity 0.2s;
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 8px; }
.hamburger span:nth-child(3) { top: 16px; }

.hamburger.is-active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.is-active span:nth-child(2) {
  opacity: 0;
}

.hamburger.is-active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ─────────────────────────────────────────
   Hero
   ───────────────────────────────────────── */

.hero {
  padding: calc(var(--header-h) + var(--space-2xl)) 0 var(--space-2xl);
  text-align: center;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 400;
  color: var(--graphite);
  margin-bottom: var(--space-sm);
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  color: var(--gris);
  margin-bottom: var(--space-xl);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

/* ─────────────────────────────────────────
   Buttons
   ───────────────────────────────────────── */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s;
  border: none;
}

.btn:hover {
  opacity: 0.85;
}

.btn-primary {
  background: var(--olive);
  color: var(--blanc);
  padding: 8px 18px;
}

.btn-ghost {
  background: transparent;
  color: var(--graphite);
  padding: 8px 0;
  text-decoration: underline;
  font-weight: 400;
}

.btn-ghost:hover {
  color: var(--noir);
  opacity: 1;
}

/* ─────────────────────────────────────────
   Features
   ───────────────────────────────────────── */

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

.feature-card {
  padding: var(--space-lg);
  border: 1px solid var(--perle);
}

.feature-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: var(--space-sm);
}

.feature-desc {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--graphite);
  line-height: 1.5;
}

/* ─────────────────────────────────────────
   Screenshots
   ───────────────────────────────────────── */

.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.screenshot {
  margin: 0;
}

.screenshot img {
  width: 100%;
  border: 1px solid var(--perle);
  cursor: pointer;
  transition: opacity 0.15s;
}

.screenshot img:hover {
  opacity: 0.85;
}

.screenshot figcaption {
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--gris);
  margin-top: var(--space-sm);
  text-align: center;
}

.screenshots-grid > .screenshot:last-child:nth-child(2n + 1) {
  grid-column: 1 / -1;
  max-width: 50%;
  justify-self: center;
}

/* ─────────────────────────────────────────
   Screenshot Modal
   ───────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(17, 17, 17, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  cursor: pointer;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-img {
  max-width: 100%;
  max-height: 90vh;
  border: 1px solid var(--graphite);
  cursor: default;
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-lg);
  background: none;
  border: none;
  color: var(--blanc);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.modal-close:hover {
  opacity: 1;
}

/* ─────────────────────────────────────────
   Contact Form
   ───────────────────────────────────────── */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.form-field {
  display: flex;
  flex-direction: column;
}

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

.form-field label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: var(--space-xs);
  color: var(--graphite);
}

.required {
  color: var(--danger);
}

.form-field input,
.form-field textarea {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 300;
  padding: 10px 14px;
  border: 1px solid var(--perle);
  border-radius: 2px;
  background: var(--blanc);
  color: var(--noir);
  outline: none;
  transition: border-color 0.15s;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--olive);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--argent);
}

.form-field textarea {
  resize: vertical;
  min-height: 100px;
}

.form-field input.is-invalid,
.form-field textarea.is-invalid {
  border-color: var(--danger);
}

.form-actions {
  margin-top: var(--space-lg);
  display: flex;
  justify-content: flex-end;
}

/* Thank you state */

.thankyou {
  text-align: center;
  padding: var(--space-xl) 0;
}

.thankyou-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: var(--space-sm);
}

.thankyou-text {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--graphite);
  margin-bottom: var(--space-lg);
}

/* ─────────────────────────────────────────
   Footer
   ───────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--perle);
  padding: var(--space-lg) 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--gris);
}

.footer-link {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--olive);
  transition: opacity 0.15s;
}

.footer-link:hover {
  opacity: 0.7;
}

/* ─────────────────────────────────────────
   Responsive
   ───────────────────────────────────────── */

/* Tablet */
@media (max-width: 1023px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

}

/* Mobile */
@media (max-width: 767px) {
  .hamburger {
    display: block;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -240px;
    width: 240px;
    height: 100vh;
    background: var(--blanc);
    border-left: 1px solid var(--perle);
    flex-direction: column;
    align-items: flex-start;
    padding: calc(var(--header-h) + var(--space-lg)) var(--space-lg) var(--space-lg);
    gap: var(--space-md);
    transition: right 0.25s ease;
    z-index: 105;
  }

  .nav.is-open {
    right: 0;
  }

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

  .screenshots-grid {
    grid-template-columns: 1fr;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: var(--space-md);
  }

  .screenshot {
    scroll-snap-align: start;
  }

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

  .hero-title {
    font-size: 2rem;
  }

  .hero-tagline {
    font-size: 1.1rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }
}
