@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css');

:root {
  color-scheme: light;
  --bg: #ffffff;
  --text: #111111;
  --text-muted: #444444;
  --text-subtle: #737373;
  --text-body: #333333;
  --border: #dddddd;
  --border-light: #eeeeee;
  --header-bg: #ffffff;
  --header-bg-glass: rgba(255, 255, 255, 0.9);
  --surface: #ffffff;
  --btn-bg: #111111;
  --btn-text: #ffffff;
  --btn-border: #111111;
  --grid-line: #e5e7eb;
}

[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0a0a0a;
  --text: #f5f5f5;
  --text-muted: #a3a3a3;
  --text-subtle: #737373;
  --text-body: #d4d4d4;
  --border: #2a2a2a;
  --border-light: #1f1f1f;
  --header-bg: #0a0a0a;
  --header-bg-glass: rgba(10, 10, 10, 0.92);
  --surface: #141414;
  --btn-bg: #f5f5f5;
  --btn-text: #0a0a0a;
  --btn-border: #f5f5f5;
  --grid-line: #262626;
}

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

body {
  font-family: 'Montserrat', system-ui, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  transition: background-color 0.2s ease, color 0.2s ease;
}

body.nav-open {
  overflow: hidden;
}

a {
  color: var(--text);
}

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

/* Header / Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-bar {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 3.5rem;
  gap: 0.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  flex: 1;
  min-width: 0;
  color: var(--text);
}

.logo__img {
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  object-fit: cover;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .logo {
    flex: 0 0 auto;
  }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1.125rem;
  line-height: 1;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--text-muted);
}

.theme-toggle__icon--moon {
  display: none;
}

[data-theme='dark'] .theme-toggle__icon--sun {
  display: none;
}

[data-theme='dark'] .theme-toggle__icon--moon {
  display: inline;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: var(--surface);
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  width: 1.125rem;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded='true'] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) 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(-7px) rotate(-45deg);
}

.nav-menu {
  display: none;
  flex-basis: 100%;
  width: 100%;
  border-top: 1px solid var(--border);
  background: var(--header-bg);
  padding: 0.5rem 0 1rem;
  margin-top: 0.25rem;
}

.nav-menu.is-open {
  display: block;
}

/* Mobile — logo left, theme + menu right, links dropdown below */
@media (max-width: 767px) {
  .logo {
    order: 1;
  }

  .nav-actions {
    order: 2;
    margin-left: auto;
  }

  .nav-menu {
    order: 3;
    flex-basis: 100%;
  }
}

.nav-links {
  list-style: none;
}

.nav-links li {
  border-bottom: 1px solid var(--border-light);
}

.nav-links li:last-child {
  border-bottom: none;
}

.nav-links a {
  display: block;
  padding: 0.875rem 0.25rem;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}

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

.nav-links a[aria-current='page'] {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

/* Desktop nav — logo | links | theme toggle */
@media (min-width: 768px) {
  .nav-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: nowrap;
    padding: 0 1.5rem;
    min-height: 4rem;
  }

  .nav-toggle {
    display: none;
  }

  .nav-menu {
    display: block;
    justify-self: center;
    width: auto;
    flex-basis: auto;
    border-top: none;
    padding: 0;
    margin: 0;
  }

  .nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
  }

  .nav-links li {
    border-bottom: none;
  }

  .nav-links a {
    padding: 0.5rem 0;
    font-size: 0.9375rem;
    font-weight: 500;
  }

  .nav-links a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
  }

  .nav-links a[aria-current='page'] {
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
  }

  .nav-actions {
    justify-self: end;
    margin-left: 0;
  }

  .logo,
  .nav-menu,
  .nav-actions {
    order: unset;
  }
}

/* Main */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

@media (min-width: 640px) {
  main {
    padding: 3rem 1.5rem 4rem;
  }
}

/* Hero */
.hero {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.hero__content {
  order: 2;
  min-width: 0;
}

.hero__figure {
  order: 1;
  margin: 0;
}

@media (min-width: 768px) {
  .hero {
    grid-template-columns: 1fr 1.05fr;
    gap: 2.5rem;
  }

  .hero__content {
    order: 1;
  }

  .hero__figure {
    order: 2;
  }
}

.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  max-width: 28rem;
  line-height: 1.15;
  color: var(--text);
}

.hero__def {
  font-size: clamp(1rem, 2.5vw, 1.0625rem);
  color: var(--text-muted);
  max-width: 36rem;
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

.hero__image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.hero__caption {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-subtle);
  line-height: 1.4;
}

.store-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  max-width: 20rem;
}

@media (min-width: 480px) {
  .store-links {
    flex-direction: row;
    flex-wrap: wrap;
    max-width: none;
    gap: 0.75rem;
  }
}

.store-links a {
  display: block;
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--btn-border);
  text-decoration: none;
  font-size: 0.9375rem;
  text-align: center;
  color: var(--text);
}

@media (min-width: 480px) {
  .store-links a {
    display: inline-block;
    text-align: left;
  }
}

.store-links a:hover {
  background: var(--btn-bg);
  color: var(--btn-text);
}

/* Content pages */
.content h1 {
  font-size: clamp(1.75rem, 5vw, 2rem);
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.content h2,
.content h3 {
  color: var(--text);
}

.content h2 {
  font-size: clamp(1.125rem, 3vw, 1.25rem);
  font-weight: 700;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.content .lead {
  font-size: clamp(1rem, 2.5vw, 1.0625rem);
  color: var(--text);
  font-weight: 500;
  line-height: 1.55;
}

.content p {
  font-size: 1rem;
  color: var(--text-body);
  margin-bottom: 1rem;
  max-width: 42rem;
}

.content h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.content h2 + h3 {
  margin-top: 0.75rem;
}

.content .use-cases {
  list-style: none;
  max-width: 42rem;
  margin-top: 0.5rem;
}

.content .use-cases li {
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  font-size: 1rem;
  color: var(--text-body);
  word-wrap: break-word;
}

.content .use-cases li:last-child {
  margin-bottom: 0;
}

.content .download-options {
  list-style: none;
  max-width: 42rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.content .download-options li {
  margin-bottom: 0.5rem;
}

.content .download-options a {
  display: block;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  text-decoration: none;
  font-size: 1rem;
  color: var(--text);
}

.content .download-options a:hover {
  background: var(--btn-bg);
  color: var(--btn-text);
  border-color: var(--btn-border);
}

.content .contact-emails {
  list-style: none;
  max-width: 42rem;
}

.content .contact-emails li {
  margin-bottom: 0.5rem;
}

.content .contact-emails a {
  font-size: 1rem;
  font-weight: 500;
}

.content .contact-emails a:hover {
  text-decoration: underline;
}

@media (min-width: 768px) {
  .content h2 {
    margin-top: 2rem;
  }

  .content h1 {
    margin-bottom: 1.5rem;
  }

  .content h3 {
    margin-top: 1.5rem;
  }

  .content h2 + h3 {
    margin-top: 1rem;
  }
}

/* Home page only — diagonal grid background */
.page-home__shell {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
}

.page-home__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(45deg, transparent 49%, var(--grid-line) 49%, var(--grid-line) 51%, transparent 51%),
    linear-gradient(-45deg, transparent 49%, var(--grid-line) 49%, var(--grid-line) 51%, transparent 51%);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 100% 80% at 50% 100%, #000 50%, transparent 90%);
  mask-image: radial-gradient(ellipse 100% 80% at 50% 100%, #000 50%, transparent 90%);
}

.page-home__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.page-home__main {
  flex: 1;
}

body.page-home .site-header {
  background: var(--header-bg-glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
