/* Home page only (index.html loads it after style.css): paper scraps pasted on newsprint.
   Grain is one tiled SVG noise picture (drawn once, cheap to scroll). Scroll motion is CSS scroll-driven
   (animation-timeline) inside @supports: a browser without it, and anyone who asks for less motion, sees the
   finished page. Notebook card in the hero: each cut is struck and its piece of the bar shrinks as you scroll. */
body.paper {
  --paper: #EDE5D6;
  --news: #E6DCCB;
  --scrap: #FBF8F2;
  --sun: #F6D66B;
  --red: #C8321F;
  --serif: "Noto Serif Thai", Georgia, serif;
  --poster: Kanit, var(--ui);
  --hand: Mali, var(--ui);
  --mono: "IBM Plex Mono", ui-monospace, var(--ui);
  background: var(--paper);
  overflow-x: clip;
}
.paper .nav { position: relative; }
.paper .nav::after { content: ""; position: absolute; left: calc(50% - 50vw); right: calc(50% - 50vw); bottom: 0; border-bottom: 1px solid var(--edge); }

/* paper */
.grain { position: relative; isolation: isolate; }
.grain::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 5; mix-blend-mode: multiply; opacity: .5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .48 0 0 0 0 .38 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 220px 220px;
}
.halftone { background-image: radial-gradient(rgba(43, 36, 32, .16) 1.1px, transparent 1.5px); background-size: 6px 6px; }
.lined { background-image: repeating-linear-gradient(transparent 0 31px, rgba(60, 90, 140, .16) 31px 32px); }
.torn-b { clip-path: polygon(0 0, 100% 0, 100% 96%, 97% 98.5%, 93% 96.5%, 89% 99%, 85% 96%, 80% 98.8%, 75% 96.2%, 70% 99%, 65% 96.4%, 60% 98.6%, 55% 96%, 50% 99%, 45% 96.5%, 40% 98.7%, 35% 96.1%, 30% 99%, 25% 96.4%, 20% 98.5%, 15% 96%, 10% 98.9%, 5% 96.3%, 0 98.5%); }
.torn-x { clip-path: polygon(1% 2%, 6% 0, 12% 1.5%, 19% 0, 27% 2%, 34% .5%, 42% 2%, 50% 0, 58% 1.8%, 66% .3%, 74% 2%, 82% .5%, 90% 1.8%, 97% 0, 100% 3%, 99% 30%, 100% 60%, 98.5% 97%, 93% 100%, 86% 98%, 78% 100%, 70% 98.2%, 62% 100%, 54% 98%, 46% 100%, 38% 98.4%, 30% 100%, 22% 98%, 14% 100%, 7% 98.3%, 0 99%, 1% 70%, 0 35%); }
.tape-strip { position: absolute; height: 28px; background: rgba(240, 228, 180, .72); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); z-index: 6; transform: rotate(var(--tr, -4deg));
  clip-path: polygon(2% 0, 98% 6%, 100% 30%, 97% 55%, 100% 80%, 97% 100%, 3% 94%, 0 70%, 3% 45%, 0 20%); }
.lift { box-shadow: 0 1px 1px rgba(0, 0, 0, .08), 0 8px 18px rgba(40, 30, 15, .16), 0 22px 40px -18px rgba(40, 30, 15, .32); }
.paste, .motion .paste.rv.in { transform: rotate(var(--r, 0deg)); }
.bleed { margin-inline: calc(50% - 50vw); padding-inline: calc(50vw - 50%); }
.hl { background-image: linear-gradient(var(--mist), var(--mist)); background-repeat: no-repeat; background-position: 0 88%; background-size: 100% 44%; padding: 0 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.strike { position: relative; color: var(--red); }
.strike::after { content: ""; position: absolute; left: -3px; right: -3px; top: 55%; height: 3px; border-radius: 2px; background: var(--red); transform-origin: left center; }
.note-hand { font-family: var(--hand); font-weight: 700; color: var(--red); }
.label { font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .06em; }
.num { font-family: var(--mark); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* section heads: big serif, ruled */
.paper main section > h2, .paper .showcase h2 { font-family: var(--serif); font-weight: 900; font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.2; letter-spacing: -0.01em; }
.paper main section > h2, .paper .showcase h2 { border-bottom: 3px solid var(--ink); padding-bottom: 12px; margin-bottom: 28px; }
.paper .intro { font-size: 18px; max-width: 40em; }

/* hero */
.paper .hero { grid-template-columns: minmax(0, 500px) minmax(0, 1fr); padding-block: clamp(24px, 4vw, 48px); }
.paper .hero .kicker { display: inline-block; background: var(--ink); color: var(--bg); font-family: var(--mono); font-size: 13px; letter-spacing: .08em; padding: 5px 12px; transform: rotate(-2deg); }
.paper .hero h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(3rem, 7.4vw, 5.6rem); line-height: 1.12; margin-bottom: 30px; }
.scraps { position: relative; display: inline-flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 12px; }
.scraps > span { transform: rotate(var(--r, 0deg)); display: inline-block; padding: 0 .22em .12em; line-height: 1.2; }
.scraps .a { background: var(--sun); font-family: var(--poster); font-weight: 800; --r: -4deg; }
.scraps .b { background: var(--scrap); --r: 3deg; }
.scraps .c { background: var(--ink); color: var(--bg); font-family: var(--poster); font-weight: 800; --r: -2deg; }
.scraps .d { background: var(--mist); --r: 5deg; }
.paper .hero .lede { color: var(--ink); }
.paper .btn { border-radius: 2px; }
.paper .btn.primary { transform: rotate(-1deg); box-shadow: 0 8px 18px rgba(40, 30, 15, .25); font-family: var(--poster); font-weight: 700; font-size: 19px; }
.paper .btn.primary:hover { transform: rotate(0deg); }

.cutcard { position: relative; padding: 24px 6px 40px; }
.cutcard .kraft { position: absolute; left: -14px; top: 0; width: 60%; height: 120px; background: #D8C09A; --r: -6deg; }
.cutcard figure { margin: 0; background-color: var(--scrap); padding: 30px 28px 40px; position: relative; --r: 1.5deg; }
.cutcard figcaption { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; margin-bottom: 6px; border-bottom: 2px solid var(--ink); }
.cutcard p { margin: 0; font-size: 18px; line-height: 2; }
.cutcard .t { display: inline-block; min-width: 3em; margin-right: 10px; font-family: var(--mono); font-size: 13px; color: var(--ink-4); }
.cutcard .said { position: absolute; right: -6px; top: -18px; font-size: 22px; display: flex; align-items: center; gap: 6px; --r: -6deg; z-index: 8; }
.timeline { margin-top: 16px; }
.timeline .row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.clock { font-size: 26px; }
.tlbar { display: flex; height: 24px; width: 81.25%; border: 2px solid var(--ink); background: var(--scrap); }
.tlbar i { display: block; min-width: 0; margin: 3px 0; }
.tlbar .k { background: var(--ink); }
.tlbar .x { flex-grow: 0; background: repeating-linear-gradient(-45deg, var(--red) 0 3px, transparent 3px 6px); }
.cutcard .foot { margin: 12px 0 0; font-size: 15px; color: var(--ink-3); line-height: 1.6; }

/* the dark band (the marquee runs in it) */
.paper .marquee { background: var(--ink); border: 0; margin-top: clamp(40px, 6vw, 72px); padding-block: 8px; }
.paper .mq { font-family: var(--poster); font-weight: 800; font-size: clamp(32px, 5vw, 64px); }
.paper .mq b { color: var(--bg); }
.paper .mq span { -webkit-text-stroke: 1.5px #8B7F70; }

/* three steps as pasted columns */
.paper .steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 32px; list-style: none; padding: 0; margin: 0; }
.paper .steps li { background: var(--scrap); padding: 26px 24px 40px; display: block; border: 0; position: relative; }
.paper .steps li:nth-child(1) { --r: -1.5deg; }
.paper .steps li:nth-child(2) { --r: 1.2deg; background: var(--sun); }
.paper .steps li:nth-child(3) { --r: -.8deg; }
.paper .steps li::before { display: block; font-family: var(--mark); font-weight: 800; font-size: 72px; line-height: .9; color: var(--ink); margin-bottom: 12px; }
.paper .steps strong { display: block; font-family: var(--poster); font-weight: 800; font-size: 24px; line-height: 1.25; margin-bottom: 8px; }
.paper .steps span:not(.tape-strip) { display: block; font-size: 16px; line-height: 1.7; }

/* receipt */
.say-it { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; padding-block: clamp(56px, 8vw, 96px); background: var(--news); margin-top: clamp(48px, 8vw, 96px); }
.say-it > div:first-child { flex: 1 1 400px; min-width: 0; position: relative; }
.say-it h2 { font-family: var(--serif); font-weight: 900; font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.2; }
.sticky { background: #F6DC6E; width: min(380px, 100%); padding: 24px 26px 30px; position: relative; --r: -3deg; margin-top: 28px; }
.sticky p { margin: 0; font-size: 22px; line-height: 1.6; font-weight: 500; }
.say-it .enough { position: absolute; right: 0; bottom: -40px; font-size: 22px; display: flex; align-items: center; gap: 8px; --r: -4deg; }
.till { flex: 0 1 370px; min-width: 0; margin: 0 auto; position: relative; }
.till .slot { height: 18px; background: var(--ink); border-radius: 9px; margin: 0 -14px; position: relative; z-index: 2; box-shadow: inset 0 -5px 0 #120E0B; }
.till .roll { margin-top: -9px; filter: drop-shadow(0 10px 18px rgba(40, 30, 15, .22)) drop-shadow(0 2px 2px rgba(40, 30, 15, .12)); --r: 1.5deg; }
.receipt { background: #FFFEFA; padding: 34px 24px; font-family: var(--mono); font-size: 14px; line-height: 1.55;
  clip-path: polygon(0% 0%, 4.17% 1.2%, 8.33% 0%, 12.5% 1.2%, 16.67% 0%, 20.83% 1.2%, 25% 0%, 29.17% 1.2%, 33.33% 0%, 37.5% 1.2%, 41.67% 0%, 45.83% 1.2%, 50% 0%, 54.17% 1.2%, 58.33% 0%, 62.5% 1.2%, 66.67% 0%, 70.83% 1.2%, 75% 0%, 79.17% 1.2%, 83.33% 0%, 87.5% 1.2%, 91.67% 0%, 95.83% 1.2%, 100% 0%, 100% 100%, 95.83% 98.8%, 91.67% 100%, 87.5% 98.8%, 83.33% 100%, 79.17% 98.8%, 75% 100%, 70.83% 98.8%, 66.67% 100%, 62.5% 98.8%, 58.33% 100%, 54.17% 98.8%, 50% 100%, 45.83% 98.8%, 41.67% 100%, 37.5% 98.8%, 33.33% 100%, 29.17% 98.8%, 25% 100%, 20.83% 98.8%, 16.67% 100%, 12.5% 98.8%, 8.33% 100%, 4.17% 98.8%, 0% 100%); }
.receipt .top { text-align: center; }
.receipt .brandline { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mark); font-weight: 600; font-size: 19px; }
.receipt hr { border: 0; border-top: 2px dashed var(--ink); margin: 14px 0; }
.receipt hr.double { border-top: 4px double var(--ink); }
.rrow { display: flex; gap: 8px; align-items: center; }
.rrow i { flex: 1; border-bottom: 2px dotted var(--gone); transform: translateY(3px); }
.rrow .ok { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; background: var(--mist); font-size: 13px; }
.receipt .barcode { height: 40px; margin: 18px 12px 6px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 7px, transparent 7px 8px, var(--ink) 8px 9px, transparent 9px 12px); }
.stamp { position: absolute; font-family: var(--poster); font-weight: 900; color: var(--red); border: 4px solid var(--red); padding: 8px 12px; line-height: 1.1; text-align: center; background: rgba(255, 254, 250, .8); transform: rotate(8deg); z-index: 7; }
.till .stamp { right: -16px; top: 110px; font-size: 19px; }
.made-up { margin: 14px 0 0; text-align: center; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

/* table as a newspaper clipping */
.paper .table-scroll { background: var(--scrap); border-radius: 0; box-shadow: 0 8px 18px rgba(40, 30, 15, .14); }
.paper .compare thead th { font-family: var(--mono); color: var(--ink); }
.paper .compare td.ours { font-weight: 500; }

/* test result: bars cut from a magazine */
.test { padding: 40px 36px 44px; background: var(--scrap); --r: -.6deg; position: relative; }
.test .bar-row { margin-top: 22px; }
.test .bar-head { display: flex; justify-content: space-between; gap: 12px; font-family: var(--poster); font-weight: 700; font-size: 19px; margin-bottom: 8px; }
.test .track2 { height: 44px; border-bottom: 2px solid var(--ink); }
.test .fill2 { height: 100%; border: 2px solid var(--ink); border-bottom: 0; transform-origin: left center; }
.test .note-hand { position: absolute; left: 24%; top: 132px; font-size: 21px; display: flex; align-items: center; gap: 6px; --r: -4deg; }
.test .fine { margin: 18px 0 0; font-size: 15px; color: var(--ink-3); }

/* big numbers on torn colour paper */
.figures { background: var(--ink); color: var(--bg); padding-block: 64px; margin-top: clamp(48px, 8vw, 96px); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 40px; }
.figures b { display: inline-block; color: var(--ink); font-size: 76px; line-height: 1.1; padding: 4px 22px 10px; }
.figures p { margin: 14px 0 0; font-size: 17px; line-height: 1.6; }

/* what it can do, what you need, questions: pasted sheets */
.paper .showcase .lines, .paper #need .lines { background: var(--scrap); border: 0; padding: 6px 28px; box-shadow: 0 8px 18px rgba(40, 30, 15, .14); }
.paper .showcase .lines { transform: rotate(.4deg); }
.paper #need .lines { transform: rotate(-.4deg); }
.paper .lines li:last-child { border-bottom: 0; }
.paper .lines strong { font-family: var(--poster); font-weight: 700; font-size: 18px; }
.paper .spec.subs, .paper .spec.tag { border-radius: 2px; }
.paper #faq details { background: var(--scrap); border: 0; margin-bottom: 10px; padding: 16px 22px; box-shadow: 0 2px 6px rgba(40, 30, 15, .08); }
.paper #faq summary { font-family: var(--poster); font-weight: 600; font-size: 18px; }

/* offers: a cut-out coupon */
.paper #buy .offer { background: var(--scrap); border-radius: 0; outline: 3px dashed var(--ink); outline-offset: -14px; padding: 40px 38px; position: relative; transform: rotate(-.8deg); }
.paper #buy .offer.quiet { outline-color: var(--edge); transform: rotate(.6deg); }
.paper #buy .offer:not(.quiet)::after { content: "ไม่มี\Aรายเดือน"; white-space: pre; position: absolute; right: -14px; top: 26px; font-family: var(--poster); font-weight: 900; font-size: 18px; color: var(--red); border: 4px solid var(--red); padding: 8px 12px; line-height: 1.15; text-align: center; background: rgba(251, 248, 242, .85); transform: rotate(8deg); }
:lang(en) .paper #buy .offer:not(.quiet)::after { content: "No monthly\A fee"; }
.paper #buy .offer .price { font-family: var(--mark); font-weight: 800; font-size: 56px; }
.paper footer.site { border-top: 1px solid var(--edge); }
.brand-foot { display: inline-flex; align-items: center; gap: 8px; }
.brand-foot b { font-family: var(--mark); font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }

@media (max-width: 860px) {
  .paper .hero { grid-template-columns: minmax(0, 1fr); }
  .cutcard .said { right: 0; top: -14px; font-size: 19px; }
  .say-it .enough { display: none; }
  .test .note-hand { position: static; margin-top: 10px; }
  .till .stamp { right: -4px; }
}

/* scroll-driven motion */
@property --t { syntax: "<integer>"; inherits: true; initial-value: 39; }
@property --m { syntax: "<integer>"; inherits: true; initial-value: 0; }
@property --s { syntax: "<integer>"; inherits: true; initial-value: 39; }
@property --sa { syntax: "<integer>"; inherits: true; initial-value: 3; }
@property --sb { syntax: "<integer>"; inherits: true; initial-value: 9; }
@keyframes paste { from { opacity: 0; transform: translate(var(--dx, 0px), 46px) rotate(calc(var(--r, 0deg) - 9deg)) scale(1.08); } 60% { opacity: 1; } to { opacity: 1; transform: translate(0, 0) rotate(var(--r, 0deg)) scale(1); } }
@keyframes stick { from { transform: rotate(var(--tr, -4deg)) scaleX(0); } }
@keyframes draw { from { transform: scaleX(0); } }
@keyframes marker { from { background-size: 0% 44%; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes drift { to { translate: 0 -50px; } }
@keyframes slam { 0% { opacity: 0; transform: rotate(14deg) scale(2.2); } 70% { opacity: 1; transform: rotate(7deg) scale(.94); } 100% { opacity: 1; transform: rotate(8deg) scale(1); } }
@keyframes xcut { from { flex-grow: var(--g); } to { flex-grow: 0; } }
@keyframes shrink { from { width: 100%; } }
@keyframes clock { from { --t: 48; } to { --t: 39; } }
@keyframes slap { from { opacity: 0; transform: translate(var(--dx, 0px), -70px) rotate(calc(var(--r, 0deg) - 14deg)) scale(1.35); } 55% { opacity: 1; } to { opacity: 1; transform: rotate(var(--r, 0deg)); } }
@keyframes hint { to { opacity: 0; } }
@keyframes print { from { clip-path: inset(0 0 100% 0); transform: translateY(-60px); } }
@supports (animation-timeline: view()) {
  .motion .paste { animation: paste linear both; animation-timeline: view(); animation-range: entry 5% entry 85%; }
  .motion .tape-strip { animation: stick linear both; animation-timeline: view(); animation-range: entry 60% cover 30%; }
  .motion .strike::after { animation: draw linear both; animation-timeline: view(); animation-range: entry 70% cover 40%; }
  .motion .hl { animation: marker linear both; animation-timeline: view(); animation-range: entry 60% cover 42%; }
  .motion .fill2 { animation: grow linear both; animation-timeline: view(); animation-range: entry 40% cover 45%; }
  .motion .kraft { animation: drift linear both; animation-timeline: scroll(root); animation-range: 0 900px; }
  .motion .stamp, .motion #buy .offer:not(.quiet)::after { animation: slam linear both; animation-timeline: view(); animation-range: entry 70% cover 35%; }
  .motion .till .roll > div { animation: print linear both; animation-timeline: view(); animation-range: entry 30% cover 50%; }
  /* the opening: header + hero hold still while the first scroll pastes the headline word by word, then the card
     cuts; only then does the page move on. It follows the scroll both ways and waits wherever you stop. */
  .motion .cutcard .strike::after, .motion .tlbar .x { animation: draw linear both; animation-timeline: scroll(root); }
  .motion .tlbar .x { animation-name: xcut; }
  .motion .cutcard .c1::after, .motion .tlbar .x1 { animation-range: 440px 560px; }
  .motion .cutcard .c2::after, .motion .tlbar .x2 { animation-range: 570px 690px; }
  .motion .cutcard .c3::after, .motion .tlbar .x3 { animation-range: 700px 820px; }
  .motion .tlbar { animation: shrink linear both; animation-timeline: scroll(root); animation-range: 440px 820px; }
  @media (max-width: 860px) { /* stacked: the card sits below the held screen, so it cuts once it scrolls into view */
    .motion .cutcard .strike::after, .motion .tlbar .x, .motion .tlbar, .motion .clock { animation-timeline: view() !important; }
    .motion .cutcard .c1::after, .motion .tlbar .x1 { animation-range: contain 5% contain 25% !important; }
    .motion .cutcard .c2::after, .motion .tlbar .x2 { animation-range: contain 25% contain 45% !important; }
    .motion .cutcard .c3::after, .motion .tlbar .x3 { animation-range: contain 45% contain 65% !important; }
    .motion .tlbar, .motion .clock { animation-range: contain 5% contain 65% !important; }
  }
  @media (prefers-reduced-motion: no-preference) {
    .motion .pin { position: sticky; top: 0; }
    .motion .pin-room { height: 840px; }
    .motion .scraps > span { animation: slap linear both; animation-timeline: scroll(root); }
    .motion .scraps .w1 { animation-range: 10px 110px; }
    .motion .scraps .w2 { animation-range: 110px 210px; }
    .motion .scraps .w3 { animation-range: 210px 310px; }
    .motion .scraps .w4 { animation-range: 310px 410px; }
    .motion .scraps::before { content: attr(data-hint); position: absolute; left: 4px; top: 50%; translate: 0 -50%; font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: .06em; color: var(--ink-3);
      animation: hint linear both; animation-timeline: scroll(root); animation-range: 0 60px; }
  }
  .motion .clock { --m: calc((var(--t) - 30) / 60); --s: calc(var(--t) - var(--m) * 60); --sa: calc((var(--s) - 4.5) / 10); --sb: calc(var(--s) - var(--sa) * 10);
    counter-reset: m var(--m) sa var(--sa) sb var(--sb); animation: clock linear both; animation-timeline: scroll(root); animation-range: 440px 820px; }
  .motion .clock .now { display: none; }
  .motion .clock::after { content: counter(m) ":" counter(sa) counter(sb); }
}
@media (prefers-reduced-motion: reduce) {
  .motion .paste, .motion .tape-strip, .motion .strike::after, .motion .hl, .motion .fill2, .motion .kraft, .motion .stamp,
  .motion .till .roll > div, .motion .tlbar, .motion .tlbar .x, .motion #buy .offer::after { animation: none !important; }
  .motion .scraps > span { animation: none !important; }
  .motion .clock::after { content: none; }
  .motion .clock .now { display: inline; }
}
