/* Margin — an advert in the app's own look: paper, ink, one sea accent; the screens do the showing. */
@font-face { font-family: "Cormorant"; src: url(fonts/cormorant.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Literata"; src: url(fonts/literata.woff2) format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Commissioner"; src: url(fonts/commissioner.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #F6F5F1; --card: #FFFFFF; --ink: #1A1A1A; --graphite: #6B665E; --hair: rgba(26,26,26,.12);
  --sea: #2B6E72; --frame: #1F2122; --shadow: rgba(30,28,24,.28);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #131516; --card: #1C1F20; --ink: #EDE7DD; --graphite: #ADA596; --hair: rgba(237,231,221,.14);
    --sea: #4F9A9E; --frame: #2A2D2E; --shadow: rgba(0,0,0,.6); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.55 "Commissioner", system-ui, sans-serif; overflow-x: hidden; }
a { color: var(--sea); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { font-family: "Cormorant", serif; font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(40px, 6.4vw, 76px); line-height: 1.02; }
h1 span { color: var(--sea); }
h2 { font-size: clamp(36px, 5vw, 58px); line-height: 1.02; }
h3 { font-size: 30px; line-height: 1.1; }
sup { font-size: .65em; }

.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; gap: 10px; align-items: center; color: var(--ink); font: 600 23px "Cormorant", serif; }
.logo img { border-radius: 7px; }
.top-link { font-weight: 500; }

.btn { display: inline-block; background: var(--sea); color: var(--bg); padding: 15px 28px; border-radius: 30px; font-weight: 500; font-size: 17px; transition: transform .2s, filter .2s; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.07); }

/* A phone: the screen in a thin dark frame, rounded like the real one. */
.phone { position: relative; border-radius: 38px; padding: 7px; background: var(--frame); box-shadow: 0 40px 80px -40px var(--shadow), 0 0 0 1px var(--hair); }
.phone img { border-radius: 31px; width: 100%; }

/* Hero */
.hero { padding: 76px 0 0; text-align: center; }
.kicker { margin: 0 0 18px; color: var(--graphite); font-size: 15.5px; letter-spacing: .03em; }
.lead { font-size: clamp(18px, 2.2vw, 21px); color: var(--graphite); max-width: 30em; margin: 26px auto 34px; }
.cta { display: flex; flex-direction: column; gap: 14px; align-items: center; margin: 0; }
.free { color: var(--graphite); font-size: 14.5px; }
.fan { position: relative; height: clamp(460px, 66vw, 720px); margin: 64px auto 0; max-width: 980px; }
.fan figure { margin: 0; }
.fan figcaption { position: absolute; left: 0; right: 0; bottom: -34px; text-align: center; font: 600 20px "Cormorant", serif; color: var(--graphite); }
.fan .phone { position: absolute; top: 0; left: 50%; width: clamp(200px, 28vw, 300px); transition: transform .9s cubic-bezier(.2,.8,.2,1), opacity .9s; will-change: transform; }
.p-mid { transform: translate(-50%, 0); z-index: 3; }
.p-left { transform: translate(-50%, 8%) rotate(0deg) scale(.92); opacity: .0; z-index: 2; }
.p-right { transform: translate(-50%, 8%) rotate(0deg) scale(.92); opacity: .0; z-index: 2; }
.fan.open .p-left { transform: translate(calc(-50% - 74%), 9%) rotate(-7deg) scale(.9); opacity: 1; }
.fan.open .p-right { transform: translate(calc(-50% + 74%), 9%) rotate(7deg) scale(.9); opacity: 1; }
.hero::after { content: ""; display: block; height: 1px; background: var(--hair); }

/* Principles */
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; padding-top: 96px; padding-bottom: 40px; }
.pr p { color: var(--graphite); margin: 12px 0 0; font-size: 17px; }

/* The saying: the phone plays one phrase becoming a deal; the words read it out */
.say { padding-top: 120px; }
.say-in { display: grid; grid-template-columns: 300px 1fr; gap: 80px; align-items: center; max-width: 940px; margin: 0 auto; }
.say-phone .phone { width: 300px; }
.say-phone video { display: block; width: 100%; height: auto; border-radius: 31px; background: #F4F3EF; }
.say-text p { color: var(--graphite); font-size: 20px; margin: 20px 0 0; max-width: 24em; }
.say-text .more { font-size: 17px; margin-top: 26px; }
.share { padding-top: 130px; }
.share .say-in { grid-template-columns: 1fr 300px; }
.share .say-phone { order: 2; }
.share .say-text p + p { margin-top: 14px; }
/* Only the top of the screen matters here: the phone fades out below it. */
.phone.half { border-radius: 38px 38px 0 0; padding-bottom: 0; -webkit-mask-image: linear-gradient(#000 62%, transparent); mask-image: linear-gradient(#000 62%, transparent); box-shadow: none; }
.phone.half img { border-radius: 31px 31px 0 0; }
.parse { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 24px 0 0; }
.parse li { border: 1px solid var(--hair); border-radius: 10px; padding: 4px 13px; font-size: 15px; background: var(--card); color: var(--ink); }
.parse li:first-child { background: color-mix(in srgb, var(--sea) 15%, transparent); color: var(--sea); border-color: transparent; }

/* Usual against Margin: three rows on hairlines */
.vs { padding-top: 130px; }
.vs h2 { text-align: center; }
.vs-grid { max-width: 900px; margin: 44px auto 0; }
.vs-row { display: grid; grid-template-columns: 1fr 1.4fr 1.4fr; gap: 24px; padding: 20px 0; border-top: 1px solid var(--hair); align-items: baseline; }
.vs-head { border-top: 0; padding: 0 0 12px; font-size: 14px; letter-spacing: .04em; color: var(--graphite); }
.vs-head span:last-child { color: var(--sea); font-weight: 500; }
.vs-k { font: 600 23px/1.2 "Cormorant", serif; }
.vs-was { color: var(--graphite); font-size: 16.5px; }
.vs-now { font: 400 19px/1.35 "Literata", serif; }
.vs-was::first-letter, .vs-now::first-letter { text-transform: uppercase; }

/* The story: a sticky phone, its screen following the words */
.story { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; padding-top: 60px; align-items: stretch; }
.story-col { position: relative; }
.story-phone { position: sticky; top: calc(50vh - 300px); display: flex; justify-content: center; align-items: flex-start; align-self: start; }
.story-phone .phone { width: 292px; padding: 7px; }
/* The first screen gives the frame its height; the others lie over it. */
.story-phone .scr { position: absolute; top: 7px; left: 7px; width: calc(100% - 14px); opacity: 0; transform: scale(.985); transition: opacity .55s ease, transform .55s ease; }
.story-phone .scr[data-k="0"] { position: relative; top: 0; left: 0; width: 100%; }
.story-phone .scr.on { opacity: 1; transform: none; }
.step { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; opacity: .25; transition: opacity .5s; }
.step.on { opacity: 1; }
.step p { color: var(--graphite); font-size: 20px; max-width: 22em; margin: 18px 0 0; }
.m-phone { display: none; }
.swipe { display: none; }

/* Honest terms — rows as in the app: a knot on the rule, the words, a quiet line */
.terms { padding-top: 120px; }
.terms h2 { text-align: center; margin-bottom: 36px; }
.terms ul { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); justify-content: center; gap: 8px 72px; }
.terms li { position: relative; display: grid; grid-template-columns: 34px 1fr; align-content: start; padding: 14px 0; }
.terms .k { width: 15px; height: 15px; margin-top: 7px; border-radius: 50%; border: 1.4px solid var(--sea); background: var(--bg); grid-row: span 2; z-index: 1; }
.terms b { font: 400 26px/1.25 "Literata", serif; }
.terms li br { display: none; }
.terms em { display: block; font-style: normal; color: var(--graphite); font-size: 16px; margin-top: 2px; }

.final { text-align: center; padding-top: 140px; padding-bottom: 90px; }
.final .btn { margin-top: 34px; }
.final .os { color: var(--graphite); margin: 18px 0 0; font-size: 15px; }
.final .note { color: var(--graphite); font-size: 13.5px; margin-top: 56px; }

.foot { border-top: 1px solid var(--hair); }
.foot-in { display: flex; flex-wrap: wrap; gap: 10px 26px; padding-top: 22px; padding-bottom: 28px; font-size: 14.5px; color: var(--graphite); }
.foot-in span { margin-right: auto; }

/* Coming into view */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Privacy page */
.doc { max-width: 760px; padding-top: 56px; padding-bottom: 80px; }
.doc h1 { font-size: clamp(38px, 6vw, 56px); margin-bottom: 8px; }
.doc .meta { color: var(--graphite); font-size: 14.5px; margin: 0 0 30px; }
.doc p { margin: 12px 0; }
.doc p strong { font-weight: 600; }

@media (max-width: 860px) {
  .hero { padding-top: 48px; }
  .fan { margin-top: 44px; }
  .fan.open .p-left { transform: translate(calc(-50% - 52%), 10%) rotate(-6deg) scale(.86); }
  .fan.open .p-right { transform: translate(calc(-50% + 52%), 10%) rotate(6deg) scale(.86); }
  .principles { grid-template-columns: 1fr; gap: 30px; padding-top: 64px; }
  /* On a phone the story is one row of cards, swiped sideways; the next one peeks in. */
  .story { display: block; padding: 40px 0 0; }
  .story-phone { display: none; }
  .swipe { display: block; text-align: right; color: var(--graphite); font-size: 14px; margin: 0 20px 10px; }
  .story-steps { display: flex; align-items: flex-start; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 20px 24px; scrollbar-width: none; }
  .story-steps::-webkit-scrollbar { display: none; }
  .step { flex: 0 0 76%; min-height: 0; opacity: 1; padding: 0; text-align: left; scroll-snap-align: center; justify-content: flex-start; }
  .step h2 { font-size: 30px; }
  .step h2 br { display: none; }
  .step p { font-size: 16px; margin-top: 8px; }
  .m-phone { display: block; order: -1; width: 100%; margin: 0 0 18px; }
  .terms { padding-top: 76px; }
  .terms ul { grid-template-columns: 1fr; gap: 0; max-width: 340px; }
  .terms b { font-size: 22px; }
  .say { padding-top: 76px; }
  .say-in { grid-template-columns: 1fr; gap: 36px; }
  .say-phone, .share .say-phone { order: 1; }
  .share { padding-top: 84px; }
  .share .say-in { grid-template-columns: 1fr; }
  .say-phone .phone { width: min(260px, 72vw); margin: 0 auto; }
  .say-text p { font-size: 18px; }
  .say-text .more { font-size: 16px; }
  .vs { padding-top: 84px; }
  .vs-grid { margin-top: 30px; }
  .vs-head { display: none; }
  .vs-row { grid-template-columns: 1fr; gap: 4px; padding: 18px 0; }
  .vs-was::before { content: "Обычно: "; }
  .vs-now::before { content: "Margin: "; color: var(--sea); font: 500 15px "Commissioner", sans-serif; }
  .fan figcaption { font-size: 17px; bottom: -28px; }
  .final { padding-top: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .fan .phone, .story-phone .scr, .step { transition: none; }
  .reveal { opacity: 1; transform: none; }
}
