/* ===================================================================
   Mat Logbook – shared styles
   =================================================================== */

/* ---------- Custom properties ---------- */
:root {
  --brand-blue: #2E63E6;
  --brand-blue-dark: #1B4ABF;
  --brand-red: #E63A2E;
  --brand-red-dark: #C42E23;
  --brand-dark: #10131A;
  --brand-light: #F7F9FC;
  --text: #0F172A;
  --text-muted: #475569;
  --text-inverse: #FFFFFF;
  --border: #D9E1EE;
  --card-bg: #FFFFFF;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.12);
  --max-width: 1120px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--brand-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--brand-blue);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--brand-blue-dark);
}

/* ---------- Focus states (accessibility) ---------- */
:focus-visible {
  outline: 3px solid var(--brand-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  line-height: 1.2;
  color: var(--text);
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.15rem; }

p {
  max-width: 65ch;
}

/* ---------- Utility ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  text-decoration: none;
  line-height: 1.4;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--brand-blue);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background: var(--brand-blue-dark);
  color: var(--text-inverse);
  box-shadow: 0 4px 16px rgba(46, 99, 230, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-inverse);
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  color: var(--text-inverse);
  border-color: rgba(255, 255, 255, 0.8);
}

.btn-outline {
  background: transparent;
  color: var(--brand-blue);
  border: 2px solid var(--brand-blue);
}

.btn-outline:hover {
  background: var(--brand-blue);
  color: var(--text-inverse);
}

/* ---------- Store modal ---------- */
body.modal-open {
  overflow: hidden;
}

.store-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
}

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

.store-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
}

.store-modal__panel {
  position: relative;
  width: min(92vw, 440px);
  margin: 8vh auto 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
}

.store-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.store-modal__close:hover {
  color: var(--text);
}

.store-modal h2 {
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
}

.store-modal__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.store-option {
  display: block;
  line-height: 0;
}

.store-option img {
  display: block;
  height: 50px;
  width: auto;
  object-fit: contain;
}

/* ---------- Site header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.2;
  color: var(--text);
  text-decoration: none;
}

.site-header__brand:hover {
  color: var(--text);
}

.site-header__icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-header__link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
}

.site-header__link:hover {
  color: var(--text);
}

.site-header__cta {
  font-size: 0.875rem;
  padding: 0.5rem 1.25rem;
}

.site-header__cta .header-cta__short {
  display: none;
}

/* Mobile: smaller header CTA so it doesn't dominate */
@media (max-width: 639px) {
  .site-header .container {
    height: 56px;
  }
  .site-header__nav {
    gap: 1rem;
  }
  .site-header__cta {
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
    white-space: nowrap;
  }
  .site-header__cta .header-cta__full {
    display: none;
  }
  .site-header__cta .header-cta__short {
    display: inline;
  }
}

/* ---------- Hero section ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand-blue) 0%, #4338CA 35%, var(--brand-red) 100%);
  color: var(--text-inverse);
  padding: 4rem 0 0;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(0,0,0,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: 2rem;
  text-align: center;
}

.hero__content {
  padding-bottom: 2rem;
}

.hero__icon {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  margin-inline: auto;
  margin-bottom: 1.5rem;
}

.hero__headline {
  font-size: clamp(2rem, 5.5vw, 3.25rem);
  font-weight: 800;
  color: var(--text-inverse);
  margin-bottom: 1rem;
}

.hero__subline {
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  opacity: 0.92;
  margin-bottom: 0.5rem;
  max-width: 540px;
  margin-inline: auto;
}

.hero__trust {
  font-size: 0.95rem;
  opacity: 0.78;
  margin-bottom: 2rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.hero__visual {
  position: relative;
  width: clamp(220px, 44vw, 380px);
  margin-inline: auto;
}

.hero__screenshot-wrap {
  width: 100%;
  max-height: clamp(300px, 52vw, 500px);
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.hero__screenshot {
  display: block;
  width: 100%;
  height: auto;
}

.hero__character {
  position: absolute;
  bottom: -4px;
  z-index: 1;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
}

.hero__character--left {
  width: clamp(80px, 15vw, 130px);
  left: -18%;
}

.hero__character--right {
  width: clamp(100px, 18.75vw, 163px);
  right: -18%;
}

/* ---------- Features section ---------- */
.features {
  padding: 5rem 0;
  background: var(--brand-light);
}

.features__header {
  text-align: center;
  margin-bottom: 3rem;
}

.features__header p {
  color: var(--text-muted);
  margin-top: 0.75rem;
  margin-inline: auto;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: box-shadow 0.2s, transform 0.2s;
}

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

.feature-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.feature-card__icon--blue   { background: #E8EFFE; color: var(--brand-blue); }
.feature-card__icon--red    { background: #FDECEB; color: var(--brand-red); }
.feature-card__icon--purple { background: #EDEBFE; color: #6D28D9; }
.feature-card__icon--teal   { background: #E0F7F6; color: #0D9488; }
.feature-card__icon--amber  { background: #FEF3CD; color: #B45309; }
.feature-card__icon--slate  { background: #EEF0F4; color: #475569; }

.feature-card h3 {
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ---------- App preview section ---------- */
.app-preview {
  padding: 5rem 0;
  background: var(--card-bg);
}

.app-preview .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

.app-preview__text h2 {
  margin-bottom: 1.25rem;
}

.app-preview__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.app-preview__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 1rem;
  line-height: 1.55;
}

.app-preview__list li::before {
  content: "";
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border-radius: 50%;
  background: #E8EFFE;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%232E63E6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.app-preview__screenshots {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.app-preview__screenshots img {
  width: 45%;
  max-width: 240px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

/* ---------- Privacy section (landing page) ---------- */
.privacy-block {
  padding: 5rem 0;
  background: var(--brand-light);
}

.privacy-block .container {
  text-align: center;
}

.privacy-block h2 {
  margin-bottom: 1rem;
}

.privacy-block > .container > p {
  color: var(--text-muted);
  margin-inline: auto;
  margin-bottom: 2rem;
}

.privacy-block__points {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
  list-style: none;
}

.privacy-block__points li {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.5rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.privacy-block__points li svg {
  flex-shrink: 0;
  color: #0D9488;
}

/* ---------- Final CTA section ---------- */
.final-cta {
  padding: 5rem 0;
  background: linear-gradient(135deg, var(--brand-dark) 0%, #1E293B 100%);
  color: var(--text-inverse);
  text-align: center;
}

.final-cta h2 {
  color: var(--text-inverse);
  margin-bottom: 0.75rem;
}

.final-cta p {
  opacity: 0.82;
  margin-inline: auto;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--brand-dark);
  color: rgba(255, 255, 255, 0.65);
  padding: 2.5rem 0;
  font-size: 0.875rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.site-footer__links a {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.875rem;
}

.site-footer__links a:hover {
  color: #FFFFFF;
}

.site-footer__contact a {
  color: rgba(255, 255, 255, 0.65);
}

.site-footer__contact a:hover {
  color: #FFFFFF;
}

/* ---------- Privacy page ---------- */
.privacy-page {
  padding: 4rem 0;
  background: var(--brand-light);
}

.privacy-page .container {
  max-width: 760px;
}

.privacy-page h1 {
  margin-bottom: 0.5rem;
}

.privacy-page__date {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 2.5rem;
}

.privacy-page h2 {
  font-size: 1.35rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.privacy-page p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.privacy-page ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.privacy-page li {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.privacy-page a {
  word-break: break-word;
}

/* ---------- Responsive: Tablet and up ---------- */
@media (min-width: 640px) {
  .hero .container {
    grid-template-columns: 1fr 1fr;
    text-align: left;
  }

  .hero__icon {
    margin-inline: 0;
  }

  .hero__subline {
    margin-inline: 0;
  }

  .hero__actions {
    justify-content: flex-start;
  }

  .hero__visual {
    margin-inline: 0 0;
    margin-left: auto;
  }

  .app-preview .container {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Responsive: Desktop ---------- */
@media (min-width: 1024px) {
  .hero {
    padding: 5rem 0 0;
  }

  .hero__content {
    padding-bottom: 4rem;
  }

  .hero__character--left {
    width: 140px;
  }

  .hero__character--right {
    width: 175px;
  }

  .hero__visual {
    width: 380px;
  }

  .hero__screenshot-wrap {
    max-height: 500px;
  }

  .features__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
