/* Mikra Notes website: the app's three colours (eggshell, coral, near-black), its system
   fonts, light and dark. No framework; one stylesheet for every page. */

:root {
  --bg: #F8F4EC;
  --card: #FCFAF5;
  --text: #1E1C1A;
  --secondary: #66615A;
  --accent: #E8543E;
  --accent-text: #C4402B;
  --line: rgba(30, 28, 26, 0.1);
  --radius: 22px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #141312;
    --text: #F8F4EC;
    --secondary: #ABA69E;
    --accent: #FF7B61;
    --accent-text: #FF7B61;
    --line: rgba(248, 244, 236, 0.14);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-text); }
h1, h2, .brand { font-family: var(--rounded); font-weight: 700; letter-spacing: -0.02em; }
img { max-width: 100%; display: block; }

.wrap { width: min(1080px, 100% - 48px); margin: 0 auto; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-header nav { display: flex; gap: 22px; }
.site-header nav a { color: var(--secondary); text-decoration: none; font-size: 15px; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--text); }

/* Buttons */
.store-button {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--text); color: var(--bg);
  padding: 13px 22px; border-radius: 999px;
  font-weight: 600; text-decoration: none; font-size: 16px;
}
.store-button[aria-disabled="true"] { cursor: default; }

/* Home, after Apple's own app pages: a centred hero, the scroll story, "And much more",
   then the privacy line. */
.hero { padding: 56px 0 0; text-align: center; }
.hero h1 { font-size: clamp(40px, 6.6vw, 68px); line-height: 1.04; max-width: 820px; margin: 0 auto 20px; }
.hero .lede { font-size: clamp(17px, 2vw, 21px); color: var(--secondary); max-width: 600px; margin: 0 auto 24px; }
.hero .small { color: var(--secondary); font-size: 14px; margin: 14px 0 0; }

.promise { text-align: center; padding: 0 0 96px; }
.promise h2 { font-size: clamp(28px, 3.6vw, 40px); margin: 0 0 14px; }
.promise p { color: var(--secondary); font-size: 19px; max-width: 600px; margin: 0 auto; }

/* Text pages: privacy, terms, support */
.doc { width: min(720px, 100% - 48px); margin: 0 auto; padding: 64px 0 96px; }
.doc h1 { font-size: clamp(34px, 5vw, 48px); letter-spacing: -0.02em; margin: 0 0 6px; }
.doc .meta { color: var(--secondary); margin: 0 0 40px; }
.doc h2 { font-size: 22px; margin: 40px 0 8px; }
.doc p, .doc li { color: var(--text); }
.doc .summary { background: var(--card); border-radius: var(--radius); padding: 22px 24px; }
.doc .summary p { margin: 0; }
.doc details { border-top: 1px solid var(--line); padding: 16px 0; }
.doc details:last-of-type { border-bottom: 1px solid var(--line); }
.doc summary { font-weight: 600; cursor: pointer; }
.doc details p { color: var(--secondary); margin: 10px 0 0; }
.contact-card { background: var(--card); border-radius: var(--radius); padding: 26px; margin: 28px 0; }
.contact-card p { margin: 0; }
.contact-card a { font-size: 20px; font-weight: 600; }

/* Footer: the brand on the left, link columns on the right, then the copyright line. */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 40px; font-size: 14px; color: var(--secondary); }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 36px 48px; padding-bottom: 36px; }
.footer-brand p { margin: 10px 0 0; max-width: 260px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 28px 64px; }
.footer-links div { display: grid; gap: 10px; align-content: start; }
.footer-links h2 { margin: 0 0 2px; font: 600 13px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; letter-spacing: 0; color: var(--text); }
.site-footer a:not(.brand) { color: var(--secondary); text-decoration: none; }
.site-footer a:not(.brand):hover { color: var(--text); }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; }

/* Keep scrolling: words and three arrows lighting up in turn. Not a control, nothing to tap.
   In the hero it sits above the phone; once the phone is pinned it floats where it never
   covers the phone (Apple's rules for its bezels), and goes when the story's done. */
.scroll-cue { display: grid; justify-items: center; color: var(--secondary); font-size: 14px; font-weight: 600; letter-spacing: .01em; pointer-events: none; }
.scroll-cue span { width: 10px; height: 10px; margin-top: -3px; border: solid var(--accent); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); opacity: .2; animation: cue 1.5s ease-in-out infinite; }
.scroll-cue span:first-of-type { margin-top: 6px; }
.scroll-cue span:nth-of-type(2) { animation-delay: .2s; }
.scroll-cue span:nth-of-type(3) { animation-delay: .4s; }
@keyframes cue { 0%, 100% { opacity: .2; } 40% { opacity: 1; } }
.scroll-cue.in-hero { margin: 22px 0 0; }
.scroll-cue.floating { position: fixed; z-index: 20; right: max(32px, env(safe-area-inset-right)); bottom: max(28px, env(safe-area-inset-bottom)); opacity: 0; transition: opacity .4s; }
.story-pinned:not(.story-done) .scroll-cue.floating { opacity: 1; }
html:not(.js) .scroll-cue { display: none; }
@media (prefers-reduced-motion: reduce) { .scroll-cue span { animation: none; opacity: .7; } }
@media (max-width: 760px) { .scroll-cue.floating { right: auto; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); } }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Scroll story: the hero's phone sticks to the screen; scrolling through the section plays
   the app frame by frame on the canvas, and story.js moves the phone for the camera's push-ins. */
.story { height: 900vh; position: relative; }
.story-stage { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; place-items: start center; padding-top: 84px; overflow: hidden; }
.story-stage > * { grid-area: 1 / 1; }
.story-word { position: absolute; top: calc(50% - 42px); margin: 0; font: 700 clamp(48px, 7.4vw, 116px)/1 var(--rounded); letter-spacing: -0.03em; opacity: 0; will-change: transform, opacity; }
.story-word { max-width: 4.6em; }
.story-word.left { right: 50%; text-align: right; }
.story-word.right { left: 50%; }
.story-phone { position: relative; height: min(calc(100svh - 160px), 820px); aspect-ratio: 1350 / 2760; will-change: transform; }
/* The screen sits in the bezel's opening: 1206 × 2622 at (72, 69) in its 1350 × 2760 artwork. */
.story-phone canvas, .story-fallback, .story-fallback img { position: absolute; left: 5.333%; top: 2.5%; width: 89.333%; height: 95%; display: block; border-radius: 14.5% / 6.7%; }
.story-fallback img { position: static; width: 100%; height: 100%; }
.story-bezel { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.js .story-fallback { display: none; }
html:not(.js) .story { height: auto; padding: 0 0 40px; }
html:not(.js) .story-stage { position: static; height: auto; }
html:not(.js) .story canvas { display: none; }

.more { text-align: center; padding: 96px 0; }
.more h2 { font-size: clamp(40px, 6vw, 64px); margin: 0 0 28px; }

@media (max-width: 760px) {
  .story-stage { padding-top: 144px; }
  .story-phone { height: min(calc(100svh - 212px), 560px); }
  .hero { padding-top: 40px; }
  .story-word.left, .story-word.right { top: -40px; left: 0; right: 0; text-align: center; font-size: 36px; max-width: none; z-index: 1; }
}
