/* =========================================================================
   My Med Journal — landing page styles
   Aesthetic: hand-drawn journal / sketchbook.
   Self-hosted fonts only. Zero third-party requests.
   ========================================================================= */

/* ---- Self-hosted fonts (OFL licensed) ------------------------------------
   Drop the two woff2 files in landing/fonts/ if not already present:
     fonts/PermanentMarker.woff2  (display / headlines)
     fonts/NunitoSans.woff2       (body — variable, weights 400–800)
--------------------------------------------------------------------------- */
@font-face {
  font-family: "Permanent Marker";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/PermanentMarker.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 400 800; /* variable font: covers 400–800 */
  font-display: swap;
  src: url("fonts/NunitoSans.woff2") format("woff2");
}

/* ---- Brand tokens -------------------------------------------------------- */
:root {
  --paper: #fff8f2;
  --card: #f4f1ee;
  --ink: #000000;
  --ink-soft: #4a4a4a;
  --coral: #e63946;
  --pink: #ffe8ea;
  --green: #2d6a4f;

  --border: 3px solid var(--ink);
  --radius: 10px;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-lift: 7px 7px 0 var(--ink);

  --font-display: "Permanent Marker", "Comic Sans MS", cursive;
  --font-body: "Nunito Sans", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;

  --maxw: 1080px;
  --space: clamp(2.5rem, 6vw, 5rem);
}

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

html {
  font-size: 100%; /* respect user zoom; all sizing in rem */
  scroll-behavior: smooth;
}

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

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

a {
  color: var(--coral);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.5px;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 3.9rem);
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  margin: 0 0 0.75rem;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  margin: 0 0 0.5rem;
}

p {
  margin: 0 0 1rem;
}

.muted {
  color: var(--ink-soft);
}

/* ---- Layout helpers ----------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

section {
  padding-block: var(--space);
}

.section-pink {
  background-color: var(--pink);
  border-block: var(--border);
}

/* ---- Skip link ---------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  z-index: 1000;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-weight: 700;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0.5rem;
}

/* ---- Visible focus states (accessibility) ------------------------------- */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Navigation --------------------------------------------------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--paper);
  border-bottom: var(--border);
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}
.brand img {
  width: 42px;
  height: 42px;
  border: var(--border);
  border-radius: var(--radius);
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.5px;
}

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.2;
  padding: 0.85rem 1.4rem;
  min-height: 48px; /* large touch target */
  border: var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-primary {
  background: var(--coral);
  color: #fff;
}
.btn:hover,
.btn:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lift);
}
.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}
.nav-cta {
  font-size: 0.95rem;
  padding: 0.6rem 1rem;
  min-height: 44px;
}

/* ---- Hero --------------------------------------------------------------- */
.hero {
  padding-block: clamp(3rem, 8vw, 6rem);
}
.hero h1 {
  max-width: 18ch;
}
.hero .lead {
  font-size: 1.2rem;
  max-width: 60ch;
}
.hero-founder {
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  max-width: 60ch;
  margin-block: 1.75rem;
  box-shadow: var(--shadow);
  transform: rotate(-0.6deg);
}
.hero-founder p {
  margin: 0;
  font-style: italic;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}
.ios-note {
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-weight: 600;
}

/* ---- Card grids --------------------------------------------------------- */
.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.card {
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lift);
}
.card:nth-child(2n) {
  transform: rotate(0.5deg);
}
.card:nth-child(2n):hover {
  transform: translateY(-5px) rotate(0.5deg);
}

/* ---- Green check badge --------------------------------------------------- */
.check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--green);
  font-weight: 800;
}
.check::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  flex: 0 0 auto;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  border: 2px solid var(--ink);
  font-size: 0.95rem;
}

/* ---- Screenshot placeholder slots --------------------------------------- */
.shot {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 420px;
  margin-block: 1rem;
  border: 3px dashed var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  color: var(--ink-soft);
  font-weight: 700;
}
/* When a real PNG is dropped in, swap the markup to an <img class="shot-img">. */
.shot-img {
  width: 100%;
  margin-block: 1rem;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---- Feature list (compact) --------------------------------------------- */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-weight: 700;
}
.feature-list li::before {
  content: "✎";
  color: var(--coral);
  font-size: 1.2rem;
}

/* ---- Founder long story ------------------------------------------------- */
.story {
  max-width: 65ch;
}
.story .pull {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--coral);
  line-height: 1.2;
  margin-block: 1.5rem;
}

/* ---- Pricing ------------------------------------------------------------ */
.pricing-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  max-width: 720px;
  margin-inline: auto;
}
.price-card {
  background: var(--paper);
  border: var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.price-card.featured {
  background: var(--pink);
}
.price {
  font-family: var(--font-display);
  font-size: 2.4rem;
  margin: 0.5rem 0 0;
}
.price small {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.badge {
  display: inline-block;
  background: var(--coral);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.25rem 0.7rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  margin-bottom: 0.5rem;
}
.trial-note {
  text-align: center;
  font-weight: 700;
  margin-top: 1.5rem;
}

/* ---- Final CTA ---------------------------------------------------------- */
.final-cta {
  text-align: center;
}
.final-cta .btn {
  margin-top: 1rem;
}

/* ---- Footer ------------------------------------------------------------- */
.site-footer {
  border-top: var(--border);
  background: var(--card);
  padding-block: 2.5rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-links a {
  font-weight: 700;
}

/* ---- Motion: staggered reveal + reduced-motion safety ------------------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  animation: reveal-in 0.6s ease forwards;
}
.reveal:nth-child(1) { animation-delay: 0.05s; }
.reveal:nth-child(2) { animation-delay: 0.15s; }
.reveal:nth-child(3) { animation-delay: 0.25s; }
.reveal:nth-child(4) { animation-delay: 0.35s; }
.reveal:nth-child(5) { animation-delay: 0.45s; }

@keyframes reveal-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .btn:hover,
  .btn:focus-visible,
  .card:hover {
    transform: none;
  }
}
