/* Home intro "Sushi Conveyor" (approved 2026-10-28; spec: docs/samples/intro-conveyor-2026-10-28.html).
   Shown only while html.intro-on, which the inline check at the top of <body> sets once per visit.
   Without JS, with reduced motion or with Pause on, none of this displays. */

/* ====== Tokens ====== */
@property --intro-t { syntax: "<angle>"; inherits: true; initial-value: 0deg; }
@property --intro-r { syntax: "<length>"; inherits: true; initial-value: 0px; }
.intro {
  --intro-len: 4.2s;
  --intro-logo-len: 3.024s; /* 72% of the intro; intro.js flies the logo into the header for the rest */
  --intro-gold: #c9a24a;
  --intro-belt: var(--surface-2);
  --intro-belt-line: #d6c09b;
  --intro-salmon: #f08a4b;
  --intro-tuna: #c2263a;
  --intro-egg: #f2c94c;
  --intro-nori: #1f2a24;
  --intro-rice: #fbf7ee;
  --intro-rice-edge: #e6dac3;
  --intro-cuke: #6fae4f;
  --intro-sheen: rgba(255, 255, 255, .55);
  --intro-shadow: rgba(60, 40, 20, .25);
}

/* ====== Overlay and Skip button ====== */
.intro, .intro__skip { display: none; }
.intro-on .intro { display: block; position: fixed; inset: 0; z-index: 1000; overflow: hidden; container-type: size; background-color: var(--ivory); animation: intro-bg var(--intro-len) linear both, intro-gone 7s step-end forwards; }
.intro > * { position: absolute; }
.intro.is-skipping > :not(.intro__logo) { visibility: hidden; }
.intro-on .intro__skip { display: inline-flex; align-items: center; position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 1001; min-height: 44px; padding: 0 1.1rem; border: 2px solid var(--blue); border-radius: 3px; background: var(--ivory); color: var(--blue); font: 700 .9375rem/1 var(--font); cursor: pointer; animation: intro-gone 7s step-end forwards; }
/* the real header logo waits for the flying one; the failsafe shows it even if intro.js never runs */
.intro-on .masthead__logo { visibility: hidden; animation: intro-back 7s step-end forwards; }

/* ====== Belt, plates, ripples, sparks, logo ====== */
.intro__orbit { inset: 0; --intro-t: 420deg; --intro-r: 90cqmin; animation: intro-orbit var(--intro-len) cubic-bezier(.45, 0, .4, 1) both; }
.intro__orbit > * { position: absolute; }
.intro__belt { left: 50%; top: 50%; width: 92cqmin; height: 92cqmin; translate: -50% -50%; border-radius: 50%; background: repeating-conic-gradient(from var(--intro-t), var(--intro-belt) 0 9deg, var(--intro-belt-line) 9deg 10deg); mask: radial-gradient(closest-side, var(--transparent) 63%, var(--ink) 63.5% 99%, var(--transparent) 100%); opacity: 0; animation: intro-belt var(--intro-len) ease both; }
.intro__slot { left: 50%; top: 50%; width: 14cqmin; height: 14cqmin; translate: -50% -50%; transform: rotate(calc(var(--a) + var(--intro-t))) translateY(calc(-1 * var(--intro-r))) rotate(calc(-1 * (var(--a) + var(--intro-t)))); opacity: 0; animation: intro-plate var(--intro-len) ease-out var(--d, 0ms) both; }
.intro__slot svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 .6cqmin .6cqmin var(--intro-shadow)); animation: intro-ride var(--intro-len) ease-in-out var(--d, 0ms) both; }
.intro__slot:nth-child(2) { --a: 0deg; }
.intro__slot:nth-child(3) { --a: 45deg; --d: 40ms; }
.intro__slot:nth-child(4) { --a: 90deg; --d: 80ms; }
.intro__slot:nth-child(5) { --a: 135deg; --d: 120ms; }
.intro__slot:nth-child(6) { --a: 180deg; --d: 160ms; }
.intro__slot:nth-child(7) { --a: 225deg; --d: 200ms; }
.intro__slot:nth-child(8) { --a: 270deg; --d: 240ms; }
.intro__slot:nth-child(9) { --a: 315deg; --d: 280ms; }
.intro__ripple { left: 50%; top: 50%; width: 46cqmin; height: 46cqmin; translate: -50% -50%; border-radius: 50%; border: 1.2cqmin solid var(--orange); opacity: 0; animation: intro-ripple var(--intro-len) cubic-bezier(.1, .7, .3, 1) both; }
.intro__ripple--gold { border-color: var(--intro-gold); border-width: .7cqmin; animation-name: intro-ripple-b; }
.intro__spark { left: 50%; top: 50%; width: var(--s); height: var(--s); margin: calc(var(--s) / -2); background: var(--intro-gold); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); opacity: 0; animation: intro-spark var(--intro-len) cubic-bezier(.2, .8, .3, 1) both; }
.intro__spark:nth-of-type(1) { --s: 4cqmin; --x: -27cqmin; --y: -21cqmin; }
.intro__spark:nth-of-type(2) { --s: 3cqmin; --x: 29cqmin; --y: -17cqmin; background: var(--orange); }
.intro__spark:nth-of-type(3) { --s: 3.4cqmin; --x: 25cqmin; --y: 23cqmin; }
.intro__spark:nth-of-type(4) { --s: 2.6cqmin; --x: -23cqmin; --y: 25cqmin; background: var(--orange); }
.intro__spark:nth-of-type(5) { --s: 2.4cqmin; --x: 2cqmin; --y: -32cqmin; }
.intro__logo { left: 50%; top: 50%; z-index: 3; width: 42cqmin; aspect-ratio: 1; translate: -50% -50%; animation: intro-logo var(--intro-logo-len) cubic-bezier(.25, .8, .3, 1) both; }
/* stand in: the header's own logo file (round, as in the header) until the sharp intro logo has decoded */
.intro__stand, .intro__sharp { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .15s linear; }
.intro__stand { border-radius: 50%; }
.intro__sharp { opacity: 0; background: center / contain no-repeat; }
.intro-sharp .intro__stand { opacity: 0; }
.intro-sharp .intro__sharp { opacity: 1; background-image: url(../assets/logo-intro-480.webp); }
@media (min-width: 768px) { .intro-sharp .intro__sharp { background-image: url(../assets/logo-intro-640.webp); } }

/* ====== Plate artwork (the sample's four symbols) ====== */
.ip-blue { fill: var(--blue); }
.ip-red { fill: var(--orange); }
.ip-gold { fill: var(--intro-gold); }
.ip-ink { fill: var(--ink); }
.ip-rice { fill: var(--intro-rice); }
.ip-grain { fill: var(--intro-rice); stroke: var(--intro-rice-edge); stroke-width: .6; }
.ip-salmon { fill: var(--intro-salmon); }
.ip-tuna { fill: var(--intro-tuna); }
.ip-egg { fill: var(--intro-egg); }
.ip-nori { fill: var(--intro-nori); }
.ip-cuke { fill: var(--intro-cuke); }
.ip-sheen { fill: none; stroke: var(--intro-sheen); stroke-width: 1.1; }

/* ====== Keyframes (the sample's "4. Kaiten conveyor") ====== */
/* 2026-10-29 (Eric): belt, plates and the small logo are visible on the first frame (the sample held them at opacity 0 for the first 2 to 11 %) */
@keyframes intro-orbit { 0% { --intro-t: -220deg; --intro-r: 0px; } 16% { --intro-r: 37cqmin; } 63% { --intro-t: 250deg; --intro-r: 37cqmin; } 81%, 100% { --intro-t: 420deg; --intro-r: 90cqmin; } }
@keyframes intro-belt { 0% { opacity: .5; transform: scale(.55); } 15% { opacity: 1; transform: scale(1.04); } 19% { transform: scale(1); } 62% { opacity: 1; transform: scale(1); } 81%, 100% { opacity: 0; transform: scale(1.4); } }
@keyframes intro-plate { 0% { opacity: 1; scale: .35; } 13% { opacity: 1; scale: 1.2; } 18% { scale: 1; } 65% { opacity: 1; scale: 1; } 81%, 100% { opacity: 0; scale: 1.3; } }
@keyframes intro-ride { 0% { transform: rotate(0) translateY(0); } 18% { transform: rotate(-7deg) translateY(0); } 24% { transform: rotate(6deg) translateY(-6%); } 31% { transform: rotate(-5deg) translateY(0); } 37% { transform: rotate(5deg) translateY(-6%); } 44% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(4deg) translateY(-5%); } 57% { transform: rotate(-2deg) translateY(0); } 63% { transform: rotate(0) translateY(0); } 81%, 100% { transform: rotate(600deg) translateY(0); } }
@keyframes intro-ripple { 0%, 41% { opacity: 0; transform: scale(.8); } 44% { opacity: .9; } 63%, 100% { opacity: 0; transform: scale(1.7); } }
@keyframes intro-ripple-b { 0%, 44% { opacity: 0; transform: scale(.85); } 47% { opacity: .8; } 70%, 100% { opacity: 0; transform: scale(2.1); } }
@keyframes intro-spark { 0%, 41% { opacity: 0; transform: translate(0, 0) scale(0) rotate(0); } 47% { opacity: 1; transform: translate(calc(var(--x) * .6), calc(var(--y) * .6)) scale(1.2) rotate(45deg); } 60% { opacity: 1; transform: translate(var(--x), var(--y)) scale(.9) rotate(90deg); } 68%, 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(0) rotate(135deg); } }
/* the sample's logo keyframes 0% to 72%, rescaled to this 3.024 s animation */
@keyframes intro-logo { 0%, 11.11% { opacity: 1; transform: rotate(-420deg) scale(.2); } 58.33% { opacity: 1; transform: rotate(8deg) scale(1.08); } 68.06% { transform: rotate(-3deg) scale(.97); } 76.39%, 100% { opacity: 1; transform: rotate(0) scale(1); } }
/* the page appears under the flying logo in the last 0.8 s */
@keyframes intro-bg { 0%, 80.95% { background-color: var(--ivory); } 100% { background-color: var(--transparent); } }
@keyframes intro-gone { to { visibility: hidden; } }
@keyframes intro-back { to { visibility: visible; } }
