/* Round four: every feature shown on an iPad. The extensions, the shared note, the
   tools, the layouts, the PDF and search all run on the same device as the opening:
   an ink bezel with the camera on its side, the app filling the screen. The replay
   and the customizer stay as they are. */

/* ── the iPad: the bezel is the border, so the app inside keeps its own layout.
   Three backgrounds: the screen, the camera dot, the bezel. ── */
.app-window,.product-module,.shared-workspace{
  --bezel:10px;--screen:var(--white);--camera:calc(var(--bezel) / 2) 50%;
  border:var(--bezel) solid transparent;border-radius:29px;overflow:hidden;color:var(--ink);
  background:linear-gradient(var(--screen),var(--screen)) padding-box,radial-gradient(circle at var(--camera),#3b424b 0 2.6px,transparent 3.2px) border-box,var(--ink) border-box;
  box-shadow:0 0 0 1px #00000012,0 26px 40px -26px #05204d80,0 60px 90px -60px rgba(28,41,73,.5)}
/* the same shape and size as the opening's iPad: 4:3 landscape, as wide as the
   column allows but never taller than the screen */
.app-window,.module-pane .product-module,.together-section .shared-workspace{box-sizing:border-box;aspect-ratio:4/3;width:min(100%,calc((100svh - 240px) * 4 / 3));height:auto;min-height:0;max-height:none;margin-inline:auto;padding:0}
/* on the dark layouts section the aluminium edge catches the light */
.layouts-section .app-window{box-shadow:0 0 0 1.5px #4a4d55,0 30px 60px -30px #000}
.app-window{position:relative;display:flex;flex-direction:column}
.app-bar{flex:none;display:flex;align-items:center;gap:16px;height:52px;padding:0 18px;border-bottom:1px solid var(--preview-rule);background:var(--white);color:var(--preview-muted);font-size:13px;font-weight:750}
.app-bar-icons{flex:none;display:flex;align-items:center;gap:17px}
.app-bar-icons img{width:16px;height:16px;opacity:.72}
.app-bar-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.app-body{position:relative;flex:1;min-height:0}

/* the floating tool pill, as on the iPad */
.app-rail{position:absolute;z-index:2;right:14px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:3px;padding:6px;background:var(--white);border-radius:18px;box-shadow:0 0 0 1px var(--preview-rule),0 16px 30px -18px rgba(28,41,73,.45)}
.app-rail button{display:grid;place-items:center;width:40px;height:40px;padding:0;border-radius:12px;background:none;opacity:.5;transition:opacity .2s ease,background-color .2s ease}
.app-rail button:hover{opacity:.85}
.app-rail button.is-current{opacity:1;background:#e3ebfb}
.app-rail img{width:22px;height:22px}
.app-rail-color{width:20px;height:20px;margin:7px auto 5px;border-radius:50%;background:var(--blue);box-shadow:0 0 0 3px var(--white),0 0 0 4.5px #c3d3f3}

/* ── the tools: the demo is a page in the app, the catalog picks from its rail ── */
.tool-page{background:#fcfbf7 radial-gradient(circle,#d9dbd3 1.15px,transparent 1.5px) 0 0/24px 24px}
.tool-page #brush-sample{position:absolute;top:0;left:0;width:calc(100% - 70px);height:100%}

/* ── the layouts: pages on the app's desk, the description as its status line ── */
.layout-app .layout-stage{flex:1;height:auto;min-height:0;background:#ecede7}
.layout-app .layout-page{background-color:var(--white);box-shadow:0 1px 0 #d8dad2,0 20px 36px -26px rgba(28,41,73,.5)}
.layout-app #layout-description{padding:15px 20px 16px;background:var(--white);border-top:1px solid var(--preview-rule);color:var(--preview-muted);font-size:14px;font-weight:700}
.layout-app .layout-pagination{bottom:66px}
.layout-app .layout-pagination button{color:var(--ink)}
.layout-app .infinite-world{inset:0 0 53px;border-radius:0;background-color:var(--white)}
.layout-app .infinite-hint{background:var(--white)}
/* the paper choice shows on the pages too, not only on the infinite canvas */
.layout-stage[data-paper=ruled] .layout-page{background-image:repeating-linear-gradient(transparent 0 27px,#a3b3c940 28px 29px)}
.layout-stage[data-paper=grid] .layout-page{background-image:linear-gradient(#8b9bb92a 1px,transparent 1px),linear-gradient(90deg,#8b9bb92a 1px,transparent 1px);background-size:22px 22px}
.layout-stage[data-paper=dots] .layout-page{background-image:radial-gradient(#7d8aa966 1px,transparent 1.4px);background-size:20px 20px}
.layout-stage[data-paper=cornell] .layout-page{background-image:linear-gradient(90deg,transparent 27%,#e0727055 27%,#e0727055 calc(27% + 1.5px),transparent calc(27% + 1.5px)),linear-gradient(transparent 80%,#8b9bb955 80%,#8b9bb955 calc(80% + 1.5px),transparent calc(80% + 1.5px))}

/* ── reading and search: two small app views ── */
/* a small screen of its own after the customizer: a tinted panel with the nōts
   corner, each feature a small app view beside a few words */
.more-section{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 4%;margin:0 7% 100px;padding:30px 34px 36px;background:#e9e6dc;border-radius:22px 22px 56px 22px}
.more-label{grid-column:1/-1;margin:0;font-size:12.5px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.more-section article{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);grid-template-rows:1fr auto auto 1fr;gap:0 24px}
.more-section article>.more-app{grid-row:1/-1}
.more-section article>h3{grid-row:2}
.more-section article>p{grid-row:3}
.more-section h3{font-size:26px;line-height:1.12;margin:0 0 10px}
.more-section p:not(.more-label){font-size:14.5px;line-height:1.55;margin:0}
/* reading and search are plain app windows, not iPads: no bezel, no camera */
.app-window.more-app{aspect-ratio:auto;width:100%;max-width:none;height:232px;margin:0;border:1px solid var(--preview-rule);border-radius:14px;background:var(--white);box-shadow:0 18px 40px -30px rgba(28,41,73,.5)}
/* the small views: a slimmer bar, a tighter page, shorter results */
.more-app .app-bar{height:40px;gap:11px;padding:0 12px;font-size:11px}
.more-app .app-bar-icons{gap:12px}
.more-app .app-bar-icons img{width:13px;height:13px}
.more-app .pdf-body{padding-top:16px}
.more-app .pdf-page{padding:16px 36% 16px 18px}
.more-app .pdf-heading{font-size:15px;margin:5px -60% 12px 0}
.more-app .pdf-line{height:5px;margin-bottom:7px}
.more-app .pdf-note{font-size:19px;left:calc(100% + 20px);top:24px}
.more-app .search-field{height:28px;font-size:12px}
.more-app .search-body{gap:7px;padding:10px}
.more-app .search-hit{padding:8px 12px}
.more-app .search-meta{font-size:10px}
.more-app .search-ink{margin-top:3px;font-size:18px}

/* the PDF: a printed page, written on */
.pdf-body{display:grid;place-items:start center;padding:26px 0 0;background:#ecede7}
.pdf-page{position:relative;width:min(400px,84%);height:100%;padding:26px 36% 26px 28px;background:var(--white);box-shadow:0 1px 0 #d8dad2,0 20px 36px -26px rgba(28,41,73,.5)}
.pdf-kicker{display:block;font-size:9px;font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:var(--preview-muted)}
.pdf-heading{display:block;margin:7px -60% 16px 0;font:800 19px/1.2 Manrope;letter-spacing:-.4px}
.pdf-line{display:block;height:6px;margin:0 0 9px;border-radius:3px;background:#dfe2df}
.pdf-mark{position:relative;background:#e2e5e2}
.pdf-mark:before{content:"";position:absolute;inset:-5px -4px;border-radius:2px;background:#e2f896;mix-blend-mode:multiply;transform-origin:0 50%}
.pdf-ink{position:absolute;overflow:visible;pointer-events:none}
.pdf-loop{left:-9px;top:-10px;width:calc(100% + 18px);height:26px}
.pdf-arrow{left:calc(100% + 6px);top:-4px;width:46px;height:31px}
.pdf-ink path{fill:none;stroke:var(--blue);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 1}
.pdf-note{position:absolute;left:calc(100% + 26px);top:30px;font:25px/1.05 NotSmooth;color:var(--blue);transform:rotate(-7deg);white-space:nowrap}

/* search: one word, found in handwriting across notes */
.search-field{flex:1;min-width:0;display:flex;align-items:center;gap:9px;height:34px;padding:0 12px;border-radius:10px;background:var(--preview-panel);color:var(--ink);font-size:14px;font-weight:750}
.search-field img{width:15px;height:15px;opacity:.7}
.search-field b{font-weight:750}
.search-field b:after{content:"";display:inline-block;width:1.5px;height:16px;margin-left:2px;vertical-align:-3px;background:var(--blue);animation:caret 1.1s steps(1) infinite}
@keyframes caret{50%{opacity:0}}
.search-count{flex:none;color:var(--preview-blue);font-size:12px;font-weight:800}
.search-body{display:flex;flex-direction:column;gap:10px;padding:16px;background:var(--preview-panel)}
.search-hit{padding:13px 16px 12px;border-radius:10px 10px 22px 10px;background:var(--white);box-shadow:0 0 0 1px var(--preview-rule)}
.search-meta{display:flex;justify-content:space-between;gap:12px;font-size:11px;color:var(--preview-muted)}
.search-meta strong{color:var(--ink);font-weight:800}
.search-ink{margin:8px 0 0;font:23px/1.2 NotSmooth;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.search-ink mark{padding:0 4px;margin:0 -2px;color:inherit;background:linear-gradient(#e2f896,#e2f896) no-repeat 0 65%/100% 72%}

/* motion: the margin note writes itself, the matches light up one by one */
@media (prefers-reduced-motion:no-preference){
  html:not(.motion-paused) .more-app.is-visible .pdf-mark:before{animation:pdf-mark 7s infinite}
  html:not(.motion-paused) .more-app.is-visible .pdf-ink path{animation:pdf-ink 7s infinite}
  html:not(.motion-paused) .more-app.is-visible .pdf-note{animation:pdf-note 7s infinite}
  html:not(.motion-paused) .more-app.is-visible .search-ink mark{animation:search-mark 6s infinite}
  html:not(.motion-paused) .more-app.is-visible .search-hit:nth-child(2) mark{animation-delay:.35s}
  html:not(.motion-paused) .more-app.is-visible .search-hit:nth-child(3) mark{animation-delay:.7s}
}
@keyframes pdf-mark{0%,6%{transform:scaleX(0)}18%,90%{transform:scaleX(1)}97%,100%{transform:scaleX(0)}}
@keyframes pdf-ink{0%,20%{stroke-dashoffset:1}42%,90%{stroke-dashoffset:0}97%,100%{stroke-dashoffset:1}}
@keyframes pdf-note{0%,40%{opacity:0;transform:rotate(-7deg) translateY(5px)}50%,90%{opacity:1;transform:rotate(-7deg)}97%,100%{opacity:0;transform:rotate(-7deg)}}
@keyframes search-mark{0%,8%{background-size:0% 72%}20%,88%{background-size:100% 72%}96%,100%{background-size:0% 72%}}

@media (max-width:700px){
  .app-bar{height:44px;gap:12px;padding:0 13px;font-size:11.5px}
  .app-bar-icons{gap:13px}
  .app-bar-icons img{width:14px;height:14px}
  .app-rail{right:9px;padding:4px;border-radius:14px}
  .app-rail button{width:32px;height:32px;border-radius:9px}
  .app-rail img{width:18px;height:18px}
  .app-rail-color{width:16px;height:16px;margin:5px auto 4px}
  /* on a phone the iPad stands upright, as in the opening */
  .app-window,.product-module,.shared-workspace{--bezel:8px;--camera:50% calc(var(--bezel) / 2);border-radius:30px}
  .app-window,.module-pane .product-module,.together-section .shared-workspace{aspect-ratio:3/4;width:100%;max-width:440px}
  .tool-stage.app-window{margin-top:14px}
  /* the calculator in an upright iPad: the function and its plot, without the working */
  .module-calculator .note-subject,.module-calculator .equation-working,.module-calculator .note-conclusion,.module-calculator .calculation-entry small{display:none}
  .module-calculator .module-note{padding-bottom:6px}
  .module-calculator .function-graph{height:150px}
  .tool-page #brush-sample{width:calc(100% - 50px)}
  .more-section{grid-template-columns:1fr;gap:26px;margin:0 6% 70px;padding:24px 18px 28px;border-radius:18px 18px 40px 18px}
  .more-section article{grid-template-columns:1fr;grid-template-rows:none;gap:0}
  .more-section article>*{grid-row:auto!important}
  .more-section article>.more-app{margin-bottom:16px}
  .app-window.more-app{height:232px;border-radius:12px}
}

/* ── "Looks like you": the heading on top like the other sections, then one studio
   row — the colours, the note they change, and the rail order — on one line ── */
.customize-section{display:block;padding:100px 7% 110px}
.customize-head{display:flex;align-items:flex-end;justify-content:space-between;gap:5%;margin-bottom:60px}
.customize-head h2{margin:0;font:clamp(54px,6.4vw,98px)/1.08 NotSmooth;letter-spacing:-.045em}
.customize-head p{max-width:400px;margin:0 0 7px;font-size:19px;line-height:1.65;font-weight:650}
.customizer{display:grid;grid-template-columns:230px minmax(0,1fr) 270px;gap:56px;align-items:center;margin:0}
.custom-label{display:block;margin-bottom:6px;font-size:12.5px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.custom-hint{margin:0 0 18px;font-size:14px;line-height:1.5;color:var(--muted)}
/* colours: three palettes as a short list, the chosen one lifted like the tools list */
.custom-palette{display:flex;flex-direction:column;gap:6px;margin:0}
.custom-palette button{display:flex;align-items:center;gap:14px;flex:none;padding:12px 14px;border-radius:8px 8px 20px 8px;background:none;opacity:.6;font-size:15px;font-weight:800;text-align:left;transition:opacity .2s ease,background-color .2s ease}
.custom-palette button:hover{opacity:.9}
.custom-palette button[aria-pressed=true]{opacity:1;background:var(--white);box-shadow:0 1px 0 var(--edge),0 12px 26px -18px rgba(28,41,73,.45)}
.custom-palette .palette-strip{flex:none;width:56px;height:16px;margin:0;border-radius:3px}
/* the note in the middle */
.customizer .custom-paper{min-height:400px;padding:34px 36px;border-radius:14px 14px 40px 14px;box-shadow:0 30px 60px -44px rgba(28,41,73,.55)}
.customizer .custom-paper strong{padding-right:64px;font-size:clamp(48px,5vw,72px)}
/* the rail order: the same rows, without the extra rule above */
.custom-order .tool-order{max-width:none;margin:0}
@media (max-width:1000px){
  .customizer{grid-template-columns:200px minmax(0,1fr);gap:36px 40px}
  .custom-order{grid-column:1/-1}
}
@media (max-width:700px){
  .customize-section{padding:70px 6%}
  .customize-head{display:block;margin-bottom:34px}
  .customize-head h2{font-size:min(54px,11.6vw)} /* each line on one line, as on desktop */
  .customize-head p{margin-top:22px;font-size:16px}
  .customizer{grid-template-columns:1fr;gap:34px}
  .custom-palette{flex-direction:row;gap:6px}
  /* three equal cards, so the row reads as one aligned set; the chosen one gets a ring */
  .custom-palette button{flex:1 1 0;min-width:0;flex-direction:column;align-items:stretch;gap:8px;padding:10px;font-size:11.5px;line-height:1.3;opacity:1;color:var(--muted);background:rgba(255,255,255,.55);box-shadow:inset 0 0 0 1px var(--edge);border-radius:8px 8px 18px 8px}
  .custom-palette button[aria-pressed=true]{color:var(--ink);background:var(--white);box-shadow:inset 0 0 0 2px var(--blue),0 12px 26px -18px rgba(28,41,73,.45)}
  .custom-palette .palette-strip{width:100%}
  .customizer .custom-paper{min-height:330px;padding:26px}
  .customizer .custom-paper strong{padding-right:52px;font-size:46px}
}

/* ── the extensions: the animation explains itself ──
   its labels are numbered steps, so the written description below the iPad is
   kept for screen readers only, and the iPad keeps the opening's size */
.module-pane .module-explanation{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.x-tag{display:inline-flex;align-items:center;gap:9px;padding:7px 14px 8px 7px;font-size:14px;box-shadow:0 12px 26px -14px rgba(10,14,30,.55)}
.x-tag .x-step{flex:none;display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--blue);color:#fff;font-size:12px;font-weight:800;line-height:1}
@media (max-width:700px){
  .x-tag{gap:7px;padding:5px 11px 6px 5px;font-size:12px}
  .x-tag .x-step{width:19px;height:19px;font-size:11px}
}
