/* rufinlog — Apple-style guide pages. One radius family: 18 (cards), 12 (bubbles), pill (buttons). */
:root {
  --bg: #F5F5F7;          /* page */
  --card: #FFFFFF;        /* grouped content */
  --text: #1D1D1F;        /* 16.6:1 on #F5F5F7 */
  --text-2: #6E6E73;      /* 4.7:1 on #F5F5F7, 5.1:1 on white */
  --sep: #D2D2D7;
  --link: #0066CC;        /* 5.6:1 on white */
  --button: #0071E3;      /* white text 4.6:1 */
  --ok: #248A3D;          /* 4.6:1 on white */
  --bubble: #0071E3;
  --code-bg: #F5F5F7;
  --r-card: 18px;
  --r-bubble: 20px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1C1C1E;
    --text: #F5F5F7;
    --text-2: #98989D;    /* 7.2:1 on black, 6.0:1 on #1C1C1E */
    --sep: #38383A;
    --link: #2997FF;
    --button: #0071E3;
    --ok: #30D158;
    --bubble: #0A84FF;
    --code-bg: #2C2C2E;
  }
}

*, *::before, *::after { box-sizing: border-box; }
/* Safari 26 paints the status bar from the root background: set it on <html> too */
html { -webkit-text-size-adjust: 100%; background-color: var(--bg); font-size: 17px; }
/* iPhone and iPad: follow the Text Size setting (Dynamic Type). Not on Mac, where this keyword is 13px */
@supports (font: -apple-system-body) and (-webkit-touch-callout: none) {
  html { font: -apple-system-body; }
}
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1rem/1.47 var(--font); letter-spacing: -.022em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 8px; }
code { font: 500 .86em/1.4 var(--mono); letter-spacing: 0; }
p code, li code, .row.result code, .row.note code { background: var(--code-bg); padding: 1px 6px; border-radius: 6px; }

/* nav */
.nav { border-bottom: 1px solid var(--sep); background: var(--bg); }
.nav-in {
  max-width: 980px; margin: 0 auto; padding: 0 16px; height: 52px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { color: var(--text); font: 600 1.1176rem/1 var(--font-display); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.nav-action {
  font: 400 0.8824rem/1 var(--font); color: var(--link); background: none; border: 0; cursor: pointer;
  padding: 12px 0 12px 12px; min-height: 44px;
}
.nav-action:hover { text-decoration: underline; }

main, .footer { max-width: 692px; margin: 0 auto; padding: 0 16px; }

/* hero */
.hero { text-align: center; padding: 56px 0 28px; }
.hero h1 {
  font: 700 clamp(34px, 8vw, 56px)/1.07 var(--font-display); letter-spacing: -.035em;
  margin: 0 0 14px; text-wrap: balance;
}
.sub { font-size: clamp(19px, 4.6vw, 23px); line-height: 1.4; margin: 0 auto 10px; max-width: 30em; text-wrap: balance; }
.meta { color: var(--text-2); margin: 0 0 24px; }

.segmented {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--sep);
}
.segmented button {
  font: 500 0.8824rem/1 var(--font); color: var(--text); background: transparent; border: 0;
  border-radius: 999px; padding: 0 20px; min-height: 40px; cursor: pointer; letter-spacing: -.01em;
}
.segmented button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* sections */
.section { padding: 40px 0 8px; }
.step { color: var(--text-2); font-size: 0.8824rem; margin: 0 0 4px; }
.section h2 { font: 700 1.6471rem/1.14 var(--font-display); letter-spacing: -.03em; margin: 0 0 16px; }
.lead-in { margin: -6px 0 18px; }
.how { margin: 0 0 18px; padding-left: 1.3em; }
.how li { margin-bottom: 8px; padding-left: 2px; }
.how li::marker { color: var(--text-2); }
.label { color: var(--text-2); font-size: 0.8824rem; margin: 22px 0 8px 4px; }
.foot-note { color: var(--text-2); font-size: 0.8824rem; margin: 10px 4px 0; }

/* inset grouped list */
.group {
  list-style: none; margin: 0; padding: 0; background: var(--card);
  border-radius: var(--r-card); overflow: hidden;
}
ul.group li { padding: 14px 18px; border-top: 1px solid var(--sep); }
ul.group li:first-child { border-top: 0; }
.group + .group { margin-top: 12px; }
.row { padding: 12px 16px 12px 18px; }
.group > .row + .row, .disclosure > .row { border-top: 1px solid var(--sep); }

.row.cmd { display: flex; align-items: center; gap: 12px; padding-top: 6px; padding-bottom: 6px; min-height: 56px; }
.row.cmd code {
  flex: 1; min-width: 0; padding: 10px 0; white-space: pre-wrap; overflow-wrap: anywhere;
}
.row.result { color: var(--text); font-size: 0.9412rem; padding-left: 48px; position: relative; }
.row.result::before {
  content: ""; position: absolute; left: 18px; top: 15px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ok)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/20px no-repeat;
}
.row.note { color: var(--text-2); font-size: 0.8824rem; }

.copy {
  flex: none; font: 400 0.8824rem/1 var(--font); color: var(--link); background: none; border: 0;
  cursor: pointer; min-height: 44px; padding: 0 2px; letter-spacing: -.01em;
}
.copy:hover { text-decoration: underline; }
.copy.done { color: var(--ok); }

/* disclosure */
.disclosure { margin-top: 12px; }
.disclosure summary, .fix summary {
  list-style: none; cursor: pointer; padding: 14px 44px 14px 18px; position: relative; min-height: 48px;
}
.disclosure summary { color: var(--link); }
.disclosure summary::-webkit-details-marker, .fix summary::-webkit-details-marker { display: none; }
.disclosure summary::after, .fix summary::after {
  content: ""; position: absolute; right: 20px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg);
}
.disclosure[open] summary::after, .fix[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.disclosure > .row:first-of-type { border-top: 1px solid var(--sep); }
.fix { padding: 0; }
.fix summary { font-size: 0.9412rem; }
.fix p { margin: 0; padding: 0 18px 16px; color: var(--text-2); font-size: 0.9412rem; }

/* messages: the phrases you send to Claude */
.chat { list-style: none; margin: 4px 0 14px; padding: 0; }
.bubble-row { display: flex; flex-direction: column; align-items: flex-end; }
.bubble {
  margin: 0; max-width: 86%; background: var(--bubble); color: #fff;
  padding: 10px 15px; border-radius: var(--r-bubble); border-bottom-right-radius: 6px;
  font-size: 1rem; line-height: 1.35; letter-spacing: -.015em;
}
.copy-small { font-size: 0.8235rem; min-height: 36px; padding: 6px 4px 0; }
.phrases li { margin-bottom: 22px; }
.explain { margin: 2px 0 0; color: var(--text-2); font-size: 0.9118rem; }
.done { font: 600 1.2353rem/1.3 var(--font-display); letter-spacing: -.025em; text-align: center; margin: 32px 0 8px; text-wrap: balance; }

/* tiles */
.tile {
  background: var(--card); border-radius: var(--r-card); text-align: center;
  padding: 30px 24px 26px; margin: 36px 0 8px;
}
.tile p { margin: 0 auto 8px; max-width: 30em; }
.tile-title { font: 700 1.2941rem/1.2 var(--font-display) !important; letter-spacing: -.025em; }
.more::after { content: " ›"; }
.tile-club { padding: 40px 24px 32px; }
.tile-club .tile-title { font-size: 1.7647rem !important; margin-bottom: 12px !important; }
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px;
  padding: 0 26px; margin: 12px 0 4px; border-radius: 999px; background: var(--button); color: #fff;
  font: 500 1rem/1 var(--font);
}
.button:hover { text-decoration: none; background: #0077ED; }
.button[data-pending] { opacity: .45; pointer-events: none; }
.fine { color: var(--text-2); font-size: 0.8235rem; }

.footer { color: var(--text-2); font-size: 0.8235rem; padding-top: 32px; padding-bottom: 56px; border-top: 1px solid var(--sep); margin-top: 48px; }
.footer p { margin: 0 0 6px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100% - 32px);
  background: rgba(29, 29, 31, .92); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 0.8824rem;
}

/* library (site root) */
.lib-item { display: block; color: var(--text); padding: 16px 44px 16px 18px; position: relative; }
.lib-item:hover { text-decoration: none; background: var(--code-bg); }
.lib-item::after {
  content: ""; position: absolute; right: 22px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border-right: 2px solid var(--text-2); border-top: 2px solid var(--text-2); transform: rotate(45deg);
}
.lib-title { display: block; font-weight: 600; }
.lib-sub { display: block; color: var(--text-2); font-size: 0.8824rem; }

/* show only the chosen OS */
body[data-os="win"] [data-only="mac"], body[data-os="mac"] [data-only="win"],
body[data-ai="claude"] [data-ai-only="codex"], body[data-ai="codex"] [data-ai-only="claude"] { display: none !important; }


@media (min-width: 734px) {
  .hero { padding: 80px 0 36px; }
  .section { padding-top: 56px; }
  .section h2 { font-size: 1.8824rem; }
}

/* ---------- iMessage-style thread (signature element) ---------- */
:root {
  --me: #007AFF; --ai-bg: #E9E9EB; --pill: rgba(0, 0, 0, .06);
  --spring: cubic-bezier(.2, .8, .2, 1);
}
@supports (transition-timing-function: linear(0, 1)) {
  /* critically damped spring, response .35 s (Apple default: no overshoot) */
  :root { --spring: linear(0.000 0.0%, 0.116 6.2%, 0.325 12.5%, 0.522 18.8%, 0.677 25.0%, 0.788 31.2%, 0.864 37.5%, 0.914 43.8%, 0.947 50.0%, 0.967 56.2%, 0.980 62.5%, 0.988 68.8%, 0.993 75.0%, 0.996 81.2%, 0.997 87.5%, 0.998 93.8%, 0.999 100.0%); }
}
@media (prefers-color-scheme: dark) {
  :root { --me: #0A84FF; --ai-bg: #2C2C2E; --pill: rgba(255, 255, 255, .12); }
}

.thread { padding: 6px 14px 18px; }
.thread.solo { padding: 0; margin: 4px 0 14px; }
.sep { text-align: center; color: var(--text-2); font-size: 0.7059rem; font-weight: 500; margin: 18px 0 8px; letter-spacing: 0; }
.sys { text-align: center; color: var(--text-2); font-size: 0.8235rem; margin: 12px 0 2px; }

.msg { display: flex; flex-direction: column; position: relative; margin-top: 2px; }
.msg.me { align-items: flex-end; }
.msg.ai { align-items: flex-start; }
.msg.me + .msg.ai, .msg.ai + .msg.me { margin-top: 10px; }

.bubble-btn, .bubble-ai {
  position: relative; max-width: 80%; margin: 0; padding: 8px 14px; border-radius: 18px;
  font: 400 1rem/1.3 var(--font); letter-spacing: -.015em; text-align: left;
}
.bubble-btn { background: var(--me); color: #fff; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bubble-btn:active { transform: scale(.97); transition: transform 100ms ease-out; }
.bubble-btn .say, .bubble-ai > * { position: relative; z-index: 1; }
.bubble-ai { background: var(--ai-bg); color: var(--text); }
.bubble-ai .pill { margin-top: 4px; }

/* tails: the bubble curls toward its sender */
.bubble-btn::before, .bubble-btn::after, .bubble-ai::before, .bubble-ai::after {
  content: ""; position: absolute; bottom: 0; height: 18px;
}
.bubble-btn::before { right: -7px; width: 20px; background: var(--me); border-bottom-left-radius: 16px 14px; }
.bubble-btn::after { right: -10px; width: 10px; background: var(--card); border-bottom-left-radius: 10px; }
.bubble-ai::before { left: -7px; width: 20px; background: var(--ai-bg); border-bottom-right-radius: 16px 14px; }
.bubble-ai::after { left: -10px; width: 10px; background: var(--card); border-bottom-right-radius: 10px; }
.thread.solo .bubble-btn::after { background: var(--bg); }

.status { font-size: 0.7059rem; color: var(--text-2); min-height: 16px; margin: 3px 4px 0; letter-spacing: 0; }
.thread:not(.solo) .status {
  position: absolute; right: 6px; bottom: -17px; margin: 0; min-height: 0;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.thread:not(.solo) .msg.me + .msg.ai, .thread:not(.solo) .msg.ai + .msg.me { margin-top: 14px; }
.msg.copied .status { opacity: 1; color: var(--ok); }

.pill {
  display: inline-block; border: 0; cursor: pointer; background: var(--pill); color: var(--link);
  font: 500 0.8824rem/1.2 var(--font); padding: 4px 11px; border-radius: 999px; letter-spacing: -.01em;
}
.bubble-ai .pill { background: var(--card); }
.pill:active { transform: scale(.96); }

.typing {
  position: absolute; left: 0; top: 0; display: flex; gap: 5px; padding: 12px 14px;
  background: var(--ai-bg); border-radius: 18px; opacity: 0; transform: scale(.9); transform-origin: 0 100%;
  transition: opacity .15s, transform .3s var(--spring); pointer-events: none;
}
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-2); opacity: .35; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .35; } 30% { opacity: .9; } }
.msg.typing-on .typing { opacity: 1; transform: none; }

/* entrance: from the sender's side, critically damped spring */
.js .thread:not(.solo) .msg > .bubble-btn,
.js .thread:not(.solo) .msg > .bubble-ai { opacity: 0; transform: translateY(12px) scale(.94); }
.js .thread .msg.me > .bubble-btn { transform-origin: 100% 100%; }
.js .thread .msg.ai > .bubble-ai { transform-origin: 0 100%; }
.js .thread:not(.solo) .msg.in > .bubble-btn,
.js .thread:not(.solo) .msg.in > .bubble-ai {
  opacity: 1; transform: none; transition: transform .52s var(--spring), opacity .18s linear;
}
.js .thread:not(.solo) .sep, .js .thread:not(.solo) .sys { opacity: 0; transition: opacity .4s; }
.js .thread .sep.in, .js .thread .sys.in { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .js .thread:not(.solo) .msg > .bubble-btn, .js .thread:not(.solo) .msg > .bubble-ai { transform: none; }
  .js .thread:not(.solo) .msg.in > .bubble-btn, .js .thread:not(.solo) .msg.in > .bubble-ai { transition: opacity .2s; }
  .typing i { animation: none; }
}

/* ---------- swipe carousel: one command = one dialogue ---------- */
.slides {
  display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  scroll-behavior: auto;
}
.slides::-webkit-scrollbar { display: none; }
.slides:focus-visible { outline: 3px solid var(--link); outline-offset: -3px; border-radius: 0; }
.slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: center; scroll-snap-stop: always; min-height: 330px; }
.slide.thread { padding: 18px 16px 26px; }

.pager { padding: 4px 12px 14px; text-align: center; }
.caption { margin: 0 0 6px; font-size: 0.7647rem; color: var(--text-2); letter-spacing: 0; min-height: 18px; }
.pager-row { display: flex; align-items: center; justify-content: center; gap: 6px; }
.dots { display: flex; }
.dot {
  width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; position: relative;
}
.dot::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px;
  border-radius: 50%; background: var(--text); opacity: .25; transition: opacity .25s;
}
.dot[aria-current="true"]::before { opacity: .9; }
.pg-arrow {
  display: none; width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--code-bg); color: var(--text); font: 400 1.1765rem/1 var(--font); padding: 0 0 3px;
}
.pg-arrow:disabled { opacity: .3; cursor: default; }
@media (hover: hover) and (pointer: fine) { .pg-arrow { display: inline-grid; place-items: center; } }

/* ---------- club card: Apple Intelligence-style glow ---------- */
@property --glow-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.glow { position: relative; border-radius: 20px; padding: 2px; margin: 40px 0 8px; isolation: isolate; }
.glow::before, .glow::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: conic-gradient(from var(--glow-a), #BC82F3, #F5B9EA, #8D9FFF, #AA6EEE, #FF6778, #FFBA71, #C686FF, #BC82F3);
  animation: glow-flow 5s linear infinite paused;
}
.glow::after { inset: -4px; filter: blur(16px); opacity: .55; }
.glow.on::before, .glow.on::after { animation-play-state: running; }
.glow > .tile { margin: 0; border-radius: 18px; }
@keyframes glow-flow { to { --glow-a: 360deg; } }
@media (prefers-reduced-motion: reduce) { .glow::before, .glow::after { animation: none; } }

/* ---------- club card: lesson sketch ---------- */
.tile-club .ipad { margin: 6px auto 16px; }

/* the lesson sketch on an iPad, drawn stroke by stroke */
.ipad {
  width: min(100%, 360px); margin: 4px auto 14px; padding: 9px; border-radius: 24px;
  background: #1D1D1F; box-shadow: 0 0 0 1.5px #3A3A3C inset, 0 18px 40px -22px rgba(0, 0, 0, .6);
}
.ipad-screen { border-radius: 15px; background: #FCFCFA; color: #1D1D1F; overflow: hidden; aspect-ratio: 360 / 220; }
@media (prefers-color-scheme: dark) { .ipad-screen { background: #1C1C1E; color: #F2F2F7; } }
.ipad svg { display: block; width: 100%; height: 100%; }
.ink { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ink.blue { stroke: #0A84FF; } .ink.green { stroke: #30A14E; } .ink.orange { stroke: #FF9F0A; }
.hand { font: 700 21px/1 "Caveat", cursive; fill: currentColor; }
.hand.small { font-size: 18px; font-weight: 500; }
.hand.green { fill: #30A14E; }
.js .sketch .ink { stroke-dasharray: 1 1; stroke-dashoffset: 1.001; opacity: 0; }
.js .sketch .hand { opacity: 0; }
@keyframes ink-draw {
  0% { stroke-dashoffset: 1.001; opacity: 0; }
  2% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}
.js .sketch.play .ink { animation: ink-draw var(--t, .45s) cubic-bezier(.45, 0, .25, 1) var(--d, 0s) both; }
.js .sketch.play .hand { opacity: 1; transition: opacity .35s linear var(--d, 0s); }
@media (prefers-reduced-motion: reduce) {
  .js .sketch .ink, .js .sketch .hand { opacity: 1 !important; stroke-dashoffset: 0 !important; transition: none !important; animation: none !important; }
}

/* ---------- phone polish ---------- */
.switches { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.switches .segmented { display: flex; width: 272px; }
.switches .segmented button { flex: 1; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
.segmented button:active, .copy:active, .nav-action:active { opacity: .6; }
.row.cmd code { white-space: normal; overflow-wrap: normal; }
.row.cmd code .tok { white-space: nowrap; }
.row.cmd code .tok.long { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .row.cmd code { font-size: 0.7941rem; line-height: 1.5; }
  .copy { font-size: 0.8235rem; }
}

/* =========================== v4: closer to Apple =========================== */

/* nav: 44px, translucent material, sticks to the top */
.nav {
  position: sticky; top: 0; z-index: 20; border-bottom: 0;
  background: rgba(245, 245, 247, .78);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .08);
}
.nav-in { height: 44px; }
.brand { font-size: 1rem; font-weight: 600; }
.nav-pill {
  font: 500 0.7647rem/1 var(--font); letter-spacing: -.01em; color: #fff; background: var(--button);
  border: 0; border-radius: 999px; padding: 6px 12px; min-height: 28px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center;
}
.nav-pill:hover { text-decoration: none; background: #0077ED; color: #fff; }
@media (prefers-color-scheme: dark) {
  .nav { background: rgba(22, 22, 23, .78); box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .08); }
}
@media (prefers-reduced-transparency: reduce) {
  .nav { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* hero: short subhead, two lines at most */
.hero { padding-bottom: 20px; }
.sub { font-size: clamp(21px, 5.2vw, 28px); font-weight: 500; line-height: 1.25; letter-spacing: -.02em; max-width: 18em; }

/* headings: bold hero, semibold sections (Apple weights) */
.section h2 { font-weight: 600; }
.tile-title, .tile-club .tile-title { font-weight: 600 !important; }
.done { font-weight: 600; }

/* settings card with iOS segmented controls */
.setup { padding-top: 4px; }
.setup .group { max-width: 460px; margin: 0 auto; }
.setup .foot-note { text-align: center; }
.setup-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.setup-label { font-size: 1rem; }
.setup .segmented {
  width: 210px; flex: none; display: flex; padding: 2px; gap: 0; border: 0; border-radius: 9px;
  background: rgba(118, 118, 128, .12);
}
.setup .segmented button {
  flex: 1; min-height: 32px; border-radius: 7px; font: 500 0.8235rem/1 var(--font); color: var(--text); padding: 0 6px;
  transition: background-color .2s, box-shadow .2s;
}
.setup .segmented button[aria-pressed="true"] {
  background: #fff; color: #000; box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04);
}
@media (prefers-color-scheme: dark) {
  .setup .segmented { background: rgba(118, 118, 128, .24); }
  .setup .segmented button[aria-pressed="true"] { background: #636366; color: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .3); }
}
@media (max-width: 360px) { .setup .segmented { width: 180px; } }

/* screenshots and terminal windows: a quiet macOS window frame */
.shot, .term {
  margin: 14px 0 6px; border-radius: 12px; overflow: hidden; background: var(--card);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 12px 30px -16px rgba(0, 0, 0, .3);
}
.shot img { display: block; width: 100%; height: auto; }
.shot-bar {
  display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; position: relative;
  background: #E8E8ED; border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.shot-bar i { width: 10px; height: 10px; border-radius: 50%; background: #FF5F57; }
.shot-bar i:nth-child(2) { background: #FEBC2E; }
.shot-bar i:nth-child(3) { background: #28C840; }
.shot-bar span { position: absolute; left: 0; right: 0; text-align: center; font-size: 12px; color: #6E6E73; letter-spacing: 0; }
@media (prefers-color-scheme: dark) {
  .shot, .term { box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 12px 30px -16px rgba(0, 0, 0, .6); }
  .shot-bar { background: #2C2C2E; border-bottom-color: rgba(255, 255, 255, .06); }
  .shot-bar span { color: #98989D; }
}
.term pre {
  margin: 0; padding: 14px 16px 16px; background: #1E1E1E; color: #E5E5EA; overflow-x: auto;
  font: 500 12.5px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere;
}
.term .t-dim { color: #8E8E93; } .term .t-q { color: #30D158; } .term .t-a { color: #64D2FF; }
.term .t-w { color: #FFD60A; } .term .t-ok { color: #30D158; }
.term figcaption { font-size: 13px; color: var(--text-2); padding: 8px 14px 10px; background: var(--card); letter-spacing: 0; }

/* reveal on scroll: fade up once, critically damped */
.js .reveal { opacity: 0; transform: translateY(24px); }
.js .reveal.seen { opacity: 1; transform: none; transition: opacity .6s ease-out, transform .8s var(--spring); }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }

/* nav a touch more opaque so the status bar tint matches the page */
.nav { background: rgba(245, 245, 247, .9); }
@media (prefers-color-scheme: dark) { .nav { background: rgba(0, 0, 0, .86); } }

/* =========================== v12: HIG pass =========================== */

/* increased contrast (Settings → Accessibility → Increase Contrast) */
@media (prefers-contrast: more) {
  :root { --text-2: #3A3A3C; --sep: #8E8E93; --link: #0040DD; }
  .nav { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: inset 0 -1px 0 var(--sep); }
  .group, .tile, .shot, .term { box-shadow: 0 0 0 1px var(--sep); }
  .setup .segmented { background: rgba(118, 118, 128, .3); }
  .dot::before { opacity: .55; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --text-2: #D1D1D6; --sep: #8E8E93; --link: #409CFF; }
}

/* page dots: small dot, 28 pt touch target */
.dot { width: 28px; height: 28px; }

/* press states for every custom control */
.nav-pill:active, .button:active { opacity: .75; transform: scale(.97); }
.setup .segmented button:active { opacity: .7; }
.pg-arrow:active, .dot:active::before { opacity: .5; }
.fix summary:active, .disclosure summary:active, .lib-item:active { background: var(--code-bg); }
.more:active, .copy:active { opacity: .55; }
@media (prefers-reduced-motion: no-preference) {
  .nav-pill, .button { transition: opacity .15s, transform .15s; }
}

/* hint that the chat swipes: one nudge to the left and back, the first time it plays */
@keyframes swipe-hint { 0%, 100% { transform: none; } 40% { transform: translateX(-34px); } }
.slides.hint > .slide { animation: swipe-hint .9s var(--spring) 1; }

/* the club glow flows twice when it appears, then rests as a steady rim */
.glow::before, .glow::after { animation-iteration-count: 2; animation-duration: 4s; }

/* landscape iPhone: keep content out of the camera housing */
.nav-in, main, .footer {
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

/* large Text Size: the setting rows wrap, the segmented control moves under its label */
.setup-row { flex-wrap: wrap; row-gap: 8px; padding-top: 10px; padding-bottom: 10px; }
.setup .segmented { width: auto; flex: 1 1 11.5rem; max-width: 13rem; margin-left: auto; }
.setup .segmented button { white-space: nowrap; }
.sub { font-size: clamp(1.25rem, 5.2vw, 1.65rem); }

/* glow v2: no blur filter (Safari clips blurred layers into a visible rectangle).
   Crisp conic rim + soft coloured shadows that follow the rounded corners. */
.glow::after { display: none; }
@keyframes glow-shadow {
  0%, 100% { box-shadow: -12px -8px 30px -8px rgba(188, 130, 243, .55), 12px -8px 30px -8px rgba(255, 186, 113, .45), 12px 10px 30px -8px rgba(255, 103, 120, .45), -12px 10px 30px -8px rgba(141, 159, 255, .5); }
  25% { box-shadow: -12px -8px 30px -8px rgba(141, 159, 255, .5), 12px -8px 30px -8px rgba(188, 130, 243, .55), 12px 10px 30px -8px rgba(255, 186, 113, .45), -12px 10px 30px -8px rgba(255, 103, 120, .45); }
  50% { box-shadow: -12px -8px 30px -8px rgba(255, 103, 120, .45), 12px -8px 30px -8px rgba(141, 159, 255, .5), 12px 10px 30px -8px rgba(188, 130, 243, .55), -12px 10px 30px -8px rgba(255, 186, 113, .45); }
  75% { box-shadow: -12px -8px 30px -8px rgba(255, 186, 113, .45), 12px -8px 30px -8px rgba(255, 103, 120, .45), 12px 10px 30px -8px rgba(141, 159, 255, .5), -12px 10px 30px -8px rgba(188, 130, 243, .55); }
}
.glow { animation: glow-shadow 4s linear 2 paused; box-shadow: -12px -8px 30px -8px rgba(188, 130, 243, .55), 12px -8px 30px -8px rgba(255, 186, 113, .45), 12px 10px 30px -8px rgba(255, 103, 120, .45), -12px 10px 30px -8px rgba(141, 159, 255, .5); }
.glow.on { animation-play-state: running; }
@media (prefers-reduced-motion: reduce) { .glow { animation: none; } }

/* Safari: children with their own compositing layer (animated bubbles, the swipe hint, the scroll
   container) escape a parent's border-radius + overflow:hidden and show square corners.
   A mask on the rounded container forces WebKit to clip them to the curve. */
.mac, .shot, .term {
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  isolation: isolate;
}

/* ---------- step 4: the AI app in a Mac window (Claude Code desktop, Codex app) ----------
   Looks follow public screenshots of both apps: the person's message in a grey bubble on the right,
   the AI's answer as plain text, the commands it runs as rows, the text field at the bottom. */
.phone { max-width: 560px; margin: 14px auto 0; }
.mac {
  --w-bg: #FAF9F5; --w-ink: #141413; --w-ink2: #73726C; --w-line: rgba(31, 30, 29, .13);
  --w-user: #F0EEE6; --w-field: #FFFFFF; --w-tool: rgba(31, 30, 29, .03);
  position: relative; border-radius: 14px; overflow: hidden; background: var(--w-bg); color: var(--w-ink);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .1), 0 28px 60px -30px rgba(0, 0, 0, .45);
}
[data-ai="codex"] .mac {
  --w-bg: #FFFFFF; --w-ink: #0D0D0D; --w-ink2: #6E6E6E; --w-line: rgba(0, 0, 0, .1);
  --w-user: #F3F3F3; --w-field: #FFFFFF; --w-tool: transparent;
}
@media (prefers-color-scheme: dark) {
  .mac {
    --w-bg: #262624; --w-ink: #FAF9F5; --w-ink2: #A6A39A; --w-line: rgba(222, 220, 209, .14);
    --w-user: #141413; --w-field: #30302E; --w-tool: rgba(222, 220, 209, .04);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 28px 60px -30px rgba(0, 0, 0, .8);
  }
  [data-ai="codex"] .mac {
    --w-bg: #181818; --w-ink: #ECECEC; --w-ink2: #8F8F8F; --w-line: rgba(255, 255, 255, .1);
    --w-user: #2F2F2F; --w-field: #242424; --w-tool: transparent;
  }
}

/* title bar: traffic lights + project name; a soft fade where older messages scroll under it */
.mac-bar { position: relative; z-index: 3; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; background: var(--w-bg); }
.mac-bar::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 30px; background: linear-gradient(var(--w-bg), transparent); pointer-events: none; }
.mac-bar i { width: 12px; height: 12px; border-radius: 50%; background: #FF5F57; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .15); }
.mac-bar i:nth-child(2) { background: #FEBC2E; }
.mac-bar i:nth-child(3) { background: #28C840; }
.mac-title { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--w-ink2); letter-spacing: -.01em; }

/* the chat: newest at the bottom, older history slides up under the title bar */
/* narrow window = longer lines wrap more, so it gets taller: ~440 px at phone width, ~380 px at 560 px */
.mac { container-type: inline-size; }
.mac .slides { height: calc(35.25rem - 27.65cqw); }
.mac .slide { min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.mac .slide.thread { padding: 0 16px 8px; }
.mac .msg { margin-top: 10px; }
.mac .msg.me { margin-top: 22px; }
.mac .msg.tool { margin-top: 7px; }
.mac .msg.tool + .msg.ai:not(.tool) { margin-top: 10px; }
.mac .history .msg:first-child { margin-top: 0; }
.mac .bubble-btn, .mac .bubble-me {
  max-width: 86%; margin: 0; padding: 8px 13px; border-radius: 14px; background: var(--w-user); color: var(--w-ink);
  font-size: .8529rem; line-height: 1.42; letter-spacing: -.005em; text-align: left;
}
.mac .bubble-ai {
  max-width: 100%; padding: 0; border-radius: 0; background: none; color: var(--w-ink);
  font-size: .8529rem; line-height: 1.5; letter-spacing: -.005em;
}
.mac .bubble-btn::before, .mac .bubble-btn::after, .mac .bubble-ai::before, .mac .bubble-ai::after { display: none; }
.js .thread:not(.solo) .history .msg > .bubble-ai { opacity: 1; transform: none; }
.mac .bubble-btn:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

/* a command the AI runs (Claude: a "Bash" card; Codex: a "Ran ..." line) */
.mac .tool-row {
  display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 8px 11px;
  border: 1px solid var(--w-line); border-radius: 10px; background: var(--w-tool);
}
.mac .tool-name { font-size: .7059rem; font-weight: 600; color: var(--w-ink2); letter-spacing: 0; }
.mac .tool-row code { padding: 0; background: none; border-radius: 0; font: 500 .7353rem/1.45 var(--mono); color: var(--w-ink); white-space: pre-wrap; overflow-wrap: anywhere; letter-spacing: 0; }
.mac .tool-row code::before { content: "$ "; color: var(--w-ink2); }
[data-ai="codex"] .mac .tool-row { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 6px; padding: 0; border: 0; border-radius: 0; background: none; }
[data-ai="codex"] .mac .tool-name { font-size: .7941rem; font-weight: 400; }
[data-ai="codex"] .mac .tool-row code { font: 400 .7941rem/1.45 var(--font); }
[data-ai="codex"] .mac .tool-row code::before { content: none; }
[data-ai="codex"] .mac .tool-row code::after { content: " \203A"; color: var(--w-ink2); }

/* screenshot the person attached to a message */
.mac .att { display: block; width: 48%; max-width: 230px; height: auto; margin-bottom: 6px; border-radius: 10px; box-shadow: 0 0 0 1px var(--w-line); }
.js .thread:not(.solo) .msg > .att { opacity: 0; transform: translateY(12px) scale(.94); transform-origin: 100% 100%; }
.js .thread:not(.solo) .msg.in > .att { opacity: 1; transform: none; transition: transform .52s var(--spring), opacity .18s linear; }

.mac .typing { padding: 6px 0; background: none; }
.mac .typing i { width: 7px; height: 7px; }
.mac .thread .status { top: -17px; bottom: auto; right: 4px; font-size: .6471rem; }
.mac .pill { background: var(--w-user); color: var(--link); }
.mac .sys { color: var(--w-ink2); font-size: .7647rem; margin: 12px 0 0; }

/* text field */
.mac-composer { padding: 6px 14px 12px; }
.mc-field {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; min-height: 46px;
  padding: 8px 12px; border: 1px solid var(--w-line); border-radius: 16px; background: var(--w-field);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.mc-plus { font-size: 1.25rem; line-height: 1; font-weight: 300; color: var(--w-ink2); }
.mc-ph { min-width: 0; font-size: .8235rem; color: var(--w-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-icons { display: flex; align-items: center; gap: 10px; color: var(--w-ink2); }
.mc-icons > svg { display: block; width: 13px; height: 18px; }
.mc-send { display: none; }
.mc-foot { display: flex; justify-content: space-between; padding: 7px 6px 0; font-size: .7059rem; color: var(--w-ink2); }
.mc-branch { display: inline-flex; align-items: center; gap: 4px; }
.mc-branch svg { width: 12px; height: 12px; }
[data-ai="codex"] .mc-field {
  grid-template-areas: "ph ph ph" "plus . icons"; row-gap: 12px; padding: 12px 10px 8px 14px; border-radius: 22px;
  box-shadow: 0 2px 10px -4px rgba(0, 0, 0, .14);
}
[data-ai="codex"] .mc-ph { grid-area: ph; }
[data-ai="codex"] .mc-plus { grid-area: plus; }
[data-ai="codex"] .mc-icons { grid-area: icons; }
[data-ai="codex"] .mc-send { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--w-ink); color: var(--w-bg); }
[data-ai="codex"] .mc-send svg { width: 14px; height: 14px; }
.phone .pager { padding: 18px 0 0; }
.mac .tool-row .tok { white-space: nowrap; }
[data-ai="codex"] .mac .tool-row { display: block; }
[data-ai="codex"] .mac .tool-name { margin-right: 6px; }
[data-ai="codex"] .mac .slides { height: calc(33.25rem - 27.65cqw); }

/* ---------- v18: Apple HIG pass on step 4 ---------- */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* labelled segments: the five situations are peers, not an ordered sequence (page-controls.md) */
.cmd-tabs {
  display: flex; max-width: 560px; margin: 16px auto 0; padding: 2px; border-radius: 9px;
  background: rgba(118, 118, 128, .12);
}
.cmd-tabs button {
  flex: 1 1 0; min-width: 0; min-height: 32px; padding: 0 4px; border: 0; border-radius: 7px; background: none; cursor: pointer;
  font: 500 min(0.8235rem, 3.75vw)/1 var(--font); color: var(--text); white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition: background-color .2s, box-shadow .2s;
}
.cmd-tabs button[aria-pressed="true"] {
  background: #fff; color: #000; font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04);
}
.cmd-tabs button:active { opacity: .7; }
.cmd-tabs button:focus-visible { outline: 3px solid var(--link); outline-offset: 1px; }
@media (prefers-color-scheme: dark) {
  .cmd-tabs { background: rgba(118, 118, 128, .24); }
  .cmd-tabs button[aria-pressed="true"] { background: #636366; color: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .3); }
}
@media (prefers-contrast: more) { .cmd-tabs { background: rgba(118, 118, 128, .3); } }
.cmd-tabs + .caption { margin: 9px 0 12px; text-align: center; }

/* pills: 30 px to see, 44 px to tap */
.pill { position: relative; min-height: 30px; padding: 6px 12px; }
.pill::after { content: ""; position: absolute; inset: -7px -3px; }

/* copy button under each phrase, like the apps' own message actions */
.mac .msg-tools { display: flex; align-items: center; justify-content: flex-end; gap: 6px; height: 26px; margin-top: 3px; }
.mac .copy-msg {
  position: relative; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px;
  background: none; color: var(--w-ink2); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.mac .copy-msg::after { content: ""; position: absolute; inset: -9px; }
.mac .copy-msg svg { width: 15px; height: 15px; }
.mac .copy-msg .i-done { display: none; }
.mac .msg.copied .copy-msg .i-copy { display: none; }
.mac .msg.copied .copy-msg .i-done { display: block; color: var(--ok); }
.mac .copy-msg:active { opacity: .55; }
.mac .copy-msg:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) { .mac .copy-msg:hover { background: var(--w-user); color: var(--w-ink); } }
.mac .msg-tools .status { position: static; margin: 0; min-height: 0; font-size: .7059rem; color: var(--w-ink2); opacity: 0; transition: opacity .2s; }
.mac .msg.copied .msg-tools .status { opacity: 1; color: var(--w-ink2); }
.js .thread:not(.solo) .msg > .msg-tools { opacity: 0; }
.js .thread:not(.solo) .msg.in > .msg-tools { opacity: 1; transition: opacity .3s .25s; }

/* while the AI works: say what it is doing, not three dots (generative-ai.md) */
.mac .typing.working {
  display: block; padding: 0; border-radius: 0; background: none; transform: none;
  font-size: .8235rem; line-height: 1.5; white-space: nowrap; color: var(--w-ink2);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .mac .typing.working {
    background: linear-gradient(90deg, var(--w-ink2) 35%, var(--w-ink) 50%, var(--w-ink2) 65%) 0 0 / 300% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: working-shimmer 1.6s linear infinite;
  }
}
@keyframes working-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .mac .typing.working { animation: none; } }

/* Claude command card on one line: "Bash  $ git add -A" */
.mac .tool-row { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 7px 11px; }

/* nav scrolls away with the page (author 2026-11-12: the bar that stays on top while scrolling «не убирается, я её
   не люблю»). It stays the first thing on the page, it just no longer sticks */
.nav { position: relative; }
