/* Mad Minds Inc. — shared stylesheet.
   Plain CSS, no dependencies, no external fonts. Light by default, dark via the
   system preference. Palette: Mad Minds. */

:root {
  color-scheme: light dark;

  /* Mad Minds palette (light) */
  --background: #fff9e6;
  --surface: #f5eac4;
  --text: #28181b;
  --text-muted: #52222d;
  --accent-fill: #ff542c;
  --accent-fill-text: #28181b;
  --accent-text: #a93212;
  --secondary: #6b4c8f;

  /* Derived helpers */
  --border: rgba(40, 24, 27, 0.16);
  --focus: #a93212;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --measure: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #28181b;
    --surface: #39244b;
    --text: #fff9e6;
    --text-muted: #ffcab7;
    --accent-fill: #ff542c;
    --accent-fill-text: #28181b;
    --accent-text: #ff8a70;
    --secondary: #ffa093;

    --border: rgba(255, 249, 230, 0.18);
    --focus: #ff8a70;
  }
}

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

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

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent-fill);
  color: var(--accent-fill-text);
}

a {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.16em;
}

a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 0.2rem;
}

/* ---------- Home ----------
   Home-only rules, all scoped under body.home so the shared pages are unaffected. */

body.home {
  /* Sky wash: warm paper by day, quiet plum dusk at night. */
  --sky-top: #fffdf6;
  --sky-bottom: #f7edd2;
  --sky-glow: rgba(255, 84, 44, 0.09);
  --icon-ring: rgba(40, 24, 27, 0.14);
  --icon-shadow: rgba(40, 24, 27, 0.28);
  --chip-shadow: rgba(40, 24, 27, 0.05);

  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background-color: var(--background);
  background-image:
    radial-gradient(34rem 24rem at 50% 34%, var(--sky-glow), transparent 72%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--background) 46%, var(--sky-bottom) 100%);
  background-repeat: no-repeat;
}

@media (prefers-color-scheme: dark) {
  body.home {
    --sky-top: #2e1c21;
    --sky-bottom: #1e1214;
    --sky-glow: rgba(255, 84, 44, 0.13);
    --icon-ring: rgba(255, 249, 230, 0.28);
    --icon-shadow: rgba(255, 249, 230, 0.1);
    --chip-shadow: rgba(0, 0, 0, 0.25);
  }
}

body.home main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: clamp(2.25rem, 8vh, 4.5rem) clamp(1.25rem, 6vw, 2rem) clamp(1.5rem, 4vh, 2.25rem);
  text-align: center;
}

body.home .app-icon {
  display: block;
  width: clamp(6.75rem, 30vw, 10rem);
  height: auto;
  aspect-ratio: 1;
  margin: 0 0 clamp(1.6rem, 4.5vh, 2.4rem);
  border-radius: 22.5%;
  box-shadow:
    0 0 0 1px var(--icon-ring),
    0 1.35rem 2.6rem -1rem var(--icon-shadow),
    0 0.3rem 0.8rem -0.2rem var(--icon-shadow);
}

body.home h1 {
  margin: 0;
  font-size: clamp(2.5rem, 9vw, 4rem);
  line-height: 1.03;
  letter-spacing: -0.03em;
  font-weight: 700;
  text-wrap: balance;
}

body.home .tagline {
  margin: 0.85rem 0 0;
  max-width: 30rem;
  font-size: clamp(1.05rem, 3.6vw, 1.3rem);
  line-height: 1.4;
  color: var(--text-muted);
  text-wrap: balance;
}

body.home .lede {
  margin: 0.95rem 0 0;
  max-width: 26rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-muted);
  text-wrap: pretty;
}

body.home .coming-soon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: clamp(1.6rem, 4.5vh, 2.25rem) 0 0;
  padding: 0.45rem 1rem 0.45rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 0.1rem 0.3rem var(--chip-shadow);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.045em;
  line-height: 1.3;
}

body.home .coming-soon .dot {
  flex: none;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--accent-fill);
}

body.home footer {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem 1.1rem;
  padding: 0 clamp(1.25rem, 6vw, 2rem) calc(1.6rem + env(safe-area-inset-bottom));
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
}

body.home footer p {
  margin: 0;
}

body.home footer .footer-copy {
  max-width: 26rem;
  text-wrap: balance;
}

/* A calm entrance, only when motion is welcome. */
@media (prefers-reduced-motion: no-preference) {
  body.home .app-icon,
  body.home h1,
  body.home .tagline,
  body.home .lede,
  body.home .coming-soon,
  body.home footer {
    animation: home-rise 0.7s cubic-bezier(0.22, 0.68, 0.24, 1) both;
  }

  body.home h1 {
    animation-delay: 0.05s;
  }

  body.home .tagline {
    animation-delay: 0.1s;
  }

  body.home .lede {
    animation-delay: 0.15s;
  }

  body.home .coming-soon {
    animation-delay: 0.22s;
  }

  /* Fade only: a translate on the bottom-most element would briefly extend the page. */
  body.home footer {
    animation: home-fade 0.7s ease both;
    animation-delay: 0.3s;
  }
}

@keyframes home-rise {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes home-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ---------- Content pages (privacy, 404) ---------- */

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2rem, 7vw, 3.5rem) 1.5rem calc(3rem + env(safe-area-inset-bottom));
}

.backlink {
  display: inline-block;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.page h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.85rem, 5.5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.page .updated {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.page h2 {
  margin: 2.25rem 0 0.6rem;
  font-size: 1.2rem;
  line-height: 1.35;
  color: var(--secondary);
}

.page p,
.page ul {
  margin: 0 0 1rem;
}

.page ul {
  padding-left: 1.25rem;
}

.page li + li {
  margin-top: 0.4rem;
}

.page strong {
  font-weight: 600;
}

.page hr {
  margin: 2.5rem 0 1.5rem;
  border: 0;
  border-top: 1px solid var(--border);
}

.page footer {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------- 404 ---------- */

.notfound {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.notfound main {
  max-width: 28rem;
  padding: 2rem 1.5rem;
}

.notfound h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.notfound p {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
}

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

/* ---------- Mad Minds additions ---------- */

body.home .wordmark {
  font-size: clamp(2.1rem, 8vw, 3.4rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

body.home .products {
  margin: clamp(1.8rem, 5vh, 2.6rem) 0 0;
  width: 100%;
  max-width: 26rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  text-align: left;
}

body.home .products h2 {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary);
}

body.home .products p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

body.home .contact {
  margin: 1.4rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

body.home .products,
body.home .contact {
  animation-delay: 0.22s;
}

@media (prefers-reduced-motion: no-preference) {
  body.home .products,
  body.home .contact {
    animation: home-rise 0.7s cubic-bezier(0.22, 0.68, 0.24, 1) both;
    animation-delay: 0.22s;
  }
}

body.home .app-icon.logo {
  border-radius: 0;
  box-shadow: none;
}
