/* ===========================================================================
   magniway — warm editorial stylesheet
   Plain CSS, no build step. Theming via custom properties in :root.
   =========================================================================== */

/* Self-hosted brand font (used for the magniway wordmark + name). No external request. */
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/sora-400.woff2") format("woff2");
}
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/sora-600.woff2") format("woff2");
}

/* The brand name always renders in Sora, with a touch more weight than body copy. */
.brand-name { font-family: "Sora", var(--font-sans); font-weight: 600; }

:root {
  /* Palette — "Crisp white": cool neutral base, blue lead, red spark */
  --cream:      #F6F8FC; /* page background */
  --cream-deep: #ECF0F7; /* alternating section background */
  --ink:        #16202E; /* primary text + dark surfaces (footer, CTA) */
  --ink-soft:   #4A5667; /* secondary text */
  /* Brand accent — magniway blue (primary) + red (secondary) */
  --clay:       #2F6BF6; /* primary accent: buttons, icons, links */
  --clay-deep:  #1E50C8; /* hover / link text — deeper for contrast */
  --brand-red:  #F23B3B; /* secondary accent: highlights, hero tint */
  --sand:       #E3E9F2; /* soft neutral tint */
  --sand-line:  #DBE2EC; /* borders / hairlines */
  --white:      #FFFFFF; /* cards */

  /* Type. Swap --font-serif to "Fraunces", serif if you enable the web font. */
  --font-serif: Georgia, "Times New Roman", "Iowan Old Style", serif;
  --font-sans:  system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --maxw: 1100px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(43, 38, 34, 0.05), 0 10px 30px rgba(43, 38, 34, 0.06);
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--clay-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }

h1, h2, h3 { font-family: var(--font-serif); line-height: 1.15; color: var(--ink); margin: 0; font-weight: 600; }

p { margin: 0; }

:focus-visible {
  outline: 3px solid var(--clay);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Accessibility helpers ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--cream);
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.4rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 0.78rem 1.5rem;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary {
  background: var(--clay);
  color: var(--white);
}
.btn-primary:hover { background: var(--clay-deep); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--sand-line);
}
.btn-ghost:hover { border-color: var(--clay); color: var(--clay-deep); transform: translateY(-2px); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--sand-line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}
.brand { display: inline-flex; color: var(--ink); }
.brand-logo { height: 30px; width: auto; display: block; }

.site-nav { display: flex; align-items: center; }

.nav-menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.6rem;
  margin: 0;
  padding: 0;
}
.nav-menu a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.nav-menu a:hover { color: var(--clay-deep); border-bottom-color: var(--clay); }
.nav-cta {
  background: var(--ink);
  color: var(--cream) !important;
  padding: 0.5rem 1.1rem !important;
  border-radius: 999px;
  border-bottom: none !important;
}
.nav-cta:hover { background: var(--clay-deep); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--sand-line);
  border-radius: 10px;
  cursor: pointer;
  padding: 0 10px;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s 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); }

/* ---------- Shared section bits ---------- */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section-alt { background: var(--cream-deep); border-block: 1px solid var(--sand-line); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--clay-deep);
  margin-bottom: 0.9rem;
}
.section-title { font-size: clamp(1.7rem, 3.6vw, 2.6rem); max-width: 22ch; }
.section-lede {
  margin-top: 1rem;
  max-width: 60ch;
  color: var(--ink-soft);
  font-size: 1.075rem;
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5rem);
  background:
    radial-gradient(1100px 480px at 80% -10%, color-mix(in srgb, var(--clay) 18%, transparent), transparent 60%),
    radial-gradient(820px 420px at 8% 8%, color-mix(in srgb, var(--brand-red) 13%, transparent), transparent 58%),
    radial-gradient(900px 420px at 50% 120%, color-mix(in srgb, var(--sand) 45%, transparent), transparent 60%),
    var(--cream);
}
.hero-inner { max-width: 760px; }
.hero-title {
  font-size: clamp(2.3rem, 6vw, 4rem);
  letter-spacing: -0.01em;
  margin-top: 0.4rem;
}
.hero-lede {
  margin-top: 1.4rem;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 56ch;
}
.hero-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* ---------- About ---------- */
.about-grid {
  margin-top: 2.6rem;
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(3, 1fr);
}
.about-block {
  background: var(--white);
  border: 1px solid var(--sand-line);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  box-shadow: var(--shadow);
}
.about-block h3 { font-size: 1.2rem; margin-bottom: 0.6rem; }
.about-block p { color: var(--ink-soft); }

/* ---------- Products ---------- */
.product-grid {
  list-style: none;
  margin: 2.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(4, 1fr);
}
.product-card {
  background: var(--white);
  border: 1px solid var(--sand-line);
  border-radius: var(--radius);
  padding: 1.7rem 1.4rem;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.product-card:hover { transform: translateY(-4px); border-color: var(--clay); }
.product-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--clay) 12%, var(--cream));
  color: var(--clay-deep);
  margin-bottom: 1rem;
}
.product-icon svg { width: 26px; height: 26px; }
.product-card h3 { font-size: 1.16rem; margin-bottom: 0.5rem; }
.product-card p { color: var(--ink-soft); font-size: 0.97rem; }

/* ---------- Contact ---------- */
.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.contact-fallback { margin-top: 1.6rem; color: var(--ink-soft); }
.contact-form {
  background: var(--white);
  border: 1px solid var(--sand-line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.2rem);
  box-shadow: var(--shadow);
}
.field { margin-bottom: 1.2rem; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}
.field input,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--cream);
  border: 1.5px solid var(--sand-line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--clay);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--clay) 22%, transparent);
}
.field textarea { resize: vertical; min-height: 120px; }

.cf-turnstile { margin-bottom: 1rem; min-height: 65px; }
.contact-form .btn { width: 100%; margin-top: 0.2rem; }

/* Honeypot — visually hidden, off-screen, not announced */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form-status {
  margin-top: 1rem;
  font-size: 0.95rem;
  min-height: 1.2em;
}
.form-status.is-success { color: #2f7a43; }
.form-status.is-error { color: var(--clay-deep); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--cream);
  padding: 2.6rem 0;
}
.site-footer .brand { color: var(--cream); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; align-items: center; }
.footer-note { color: color-mix(in srgb, var(--cream) 78%, transparent); font-size: 0.95rem; }
.footer-note a { color: var(--cream); }
.footer-copy {
  margin-left: auto;
  color: color-mix(in srgb, var(--cream) 60%, transparent);
  font-size: 0.85rem;
}

/* ---------- Scroll reveal (progressive enhancement) ---------- */
.reveal { opacity: 1; }
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ===========================================================================
   Responsive
   =========================================================================== */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-inner { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--sand-line);
    padding: 0.5rem 1.4rem 1.2rem;
    box-shadow: var(--shadow);
    /* Collapsed by default on mobile */
    display: none;
  }
  .nav-menu.is-open { display: flex; }
  .nav-menu li { border-bottom: 1px solid var(--sand-line); }
  .nav-menu li:last-child { border-bottom: none; padding-top: 0.7rem; }
  .nav-menu a { display: block; padding: 0.85rem 0; }
  .nav-cta { text-align: center; }
  .footer-copy { margin-left: 0; }
}

@media (max-width: 460px) {
  .product-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; text-align: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
