/* yayotee theme: layout and components on top of theme.json.
   Colours come from the theme.json palette (--wp--preset--color--*). */

:root {
  --yy-cacao-ink: #ffffff;
  --yy-cacao-muted: #dccbd0;
  --yy-cacao-line: rgba(255, 255, 255, .16);
  --yy-cacao-accent: #ff8fb5;
  --yy-focus: #1f5fd6;
  --yy-on-framboise: #ffffff;
}

@media (prefers-color-scheme: dark) {
  html body {
    --wp--preset--color--surface: #1a1315;
    --wp--preset--color--surface-raised: #241b1e;
    --wp--preset--color--surface-sunken: #120c0e;
    --wp--preset--color--ink: #f3e8eb;
    --wp--preset--color--ink-muted: #b9a6ac;
    --wp--preset--color--line: #3a2d31;
    --wp--preset--color--framboise: #ff6fa0;
    --wp--preset--color--framboise-text: #ff8fb5;
    --wp--preset--color--framboise-pale: #3d1f2a;
    --yy-focus: #8ab4ff;
    --yy-on-framboise: #2b0a16;
    color-scheme: dark;
  }
  html body .wp-block-button:not(.is-style-outline) > .wp-block-button__link { color: var(--yy-on-framboise); }
}

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { -webkit-font-smoothing: antialiased; }
:where(a, button, summary):focus-visible { outline: 2px solid var(--yy-focus); outline-offset: 3px; border-radius: 4px; }

.yy-main { margin-block-start: 0; }
.yy-main > * + * { margin-block-start: 0; }
.wp-site-blocks > * + * { margin-block-start: 0; }

/* Header */
.yy-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--wp--preset--color--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--wp--preset--color--line);
}
.admin-bar .yy-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .yy-header { top: 0; } }
.yy-header__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.yy-brand { display: inline-flex; line-height: 0; }
.yy-brand svg { height: 30px; width: auto; }
.yy-ink { fill: var(--wp--preset--color--framboise); }
.yy-stroke { stroke: var(--wp--preset--color--framboise); }
.yy-reel { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .yy-brand.is-rewinding .yy-reel { animation: yy-rewind 2.4s cubic-bezier(.4, 0, .2, 1) 1; }
}
@keyframes yy-rewind { 0% { transform: rotate(0); } 40% { transform: rotate(-540deg); } 100% { transform: rotate(0); } }

.yy-nav { display: flex; align-items: center; gap: 28px; }
.yy-nav a { color: var(--wp--preset--color--ink); text-decoration: none; font-weight: 500; }
.yy-nav a:hover { color: var(--wp--preset--color--framboise-text); }
.yy-nav .yy-nav__cta {
  color: var(--yy-on-framboise); background: var(--wp--preset--color--framboise);
  padding: 8px 16px; border-radius: 8px; font-weight: 600;
}
.yy-nav .yy-nav__cta:hover { color: var(--yy-on-framboise); filter: brightness(.94); }
@media (max-width: 760px) { .yy-nav a:not(.yy-nav__cta) { display: none; } }

/* Type helpers */
.yy-kicker { color: var(--wp--preset--color--framboise-text); font-weight: 600; font-size: 16px; margin: 0; }
.yy-lead { font-size: var(--wp--preset--font-size--medium); line-height: 1.6; color: var(--wp--preset--color--ink-muted); max-width: 62ch; }
.yy-note { color: var(--wp--preset--color--ink-muted); }
h1.wp-block-heading { max-width: 14ch; text-wrap: balance; }
h2.wp-block-heading { max-width: 26ch; text-wrap: balance; }

/* Outline button */
.wp-block-buttons .wp-block-button.is-style-outline > .wp-block-button__link {
  background: transparent; color: var(--wp--preset--color--framboise-text);
  border: 1.5px solid currentColor; padding: 10.5px 20.5px;
}
.wp-block-buttons .wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--framboise-pale); }
.wp-block-button__link:hover { filter: brightness(.95); }

/* Sections */
.yy-hero { padding-block: clamp(40px, 7vw, 96px); }
.yy-hero__grid { gap: clamp(32px, 5vw, 72px) !important; }
.yy-hero h1 { margin-block: 12px 20px; }
.yy-actions { margin-top: 28px; }
.yy-section { padding-block: clamp(56px, 8vw, 104px); }
.yy-section--raised {
  background: var(--wp--preset--color--surface-raised);
  border-block: 1px solid var(--wp--preset--color--line);
}
.yy-intro > * { margin-block: 0; }
.yy-intro > h2 + .yy-lead { margin-top: 12px; }

/* The deck: the replayable event log in the hero */
.yy-deck {
  margin: 0; background: var(--wp--preset--color--cacao); color: var(--yy-cacao-ink);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 18px 40px -18px rgba(43, 33, 36, .45);
}
.yy-deck__head { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--yy-cacao-line); }
.yy-deck__reels { width: 44px; height: 28px; flex: none; color: var(--yy-cacao-accent); }
.yy-deck__reel { transform-box: fill-box; transform-origin: center; }
.yy-deck.is-playing .yy-deck__reel { animation: yy-spin 1.6s linear infinite; }
.yy-deck.is-rewinding .yy-deck__reel { animation: yy-spin-back .45s linear infinite; }
@keyframes yy-spin { to { transform: rotate(360deg); } }
@keyframes yy-spin-back { to { transform: rotate(-360deg); } }
.yy-deck__title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.yy-deck__scene { font-family: var(--wp--preset--font-family--plex-mono); font-weight: 500; font-size: 15px; }
.yy-deck__meta { color: var(--yy-cacao-muted); font-size: 14px; }
.yy-deck__replay {
  font: 600 15px/1 var(--wp--preset--font-family--barlow); cursor: pointer;
  color: var(--wp--preset--color--cacao); background: #fff; border: 0; border-radius: 999px;
  padding: 9px 16px 9px 34px; position: relative;
}
.yy-deck__replay::before {
  content: ""; position: absolute; left: 14px; top: 50%; width: 12px; height: 12px; margin-top: -6px;
  border: 2px solid currentColor; border-left-color: transparent; border-radius: 50%;
}
.yy-deck__replay::after {
  content: ""; position: absolute; left: 12px; top: 50%; margin-top: -8px;
  border: 4px solid transparent; border-bottom-color: currentColor; transform: rotate(-30deg);
}
.yy-deck__replay:hover { background: #fce4ec; }
.yy-deck__replay[disabled] { opacity: .6; cursor: default; }
.yy-deck__replay:focus-visible { outline-color: #fff; }

.yy-deck__devices { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--yy-cacao-line); }
.yy-dev { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; min-width: 0; }
.yy-dev + .yy-dev { border-left: 1px solid var(--yy-cacao-line); }
.yy-dev__id { font-family: var(--wp--preset--font-family--plex-mono); font-size: 13px; color: var(--yy-cacao-accent); overflow-wrap: anywhere; }
.yy-dev__val { font-family: var(--wp--preset--font-family--quicksand); font-weight: 700; font-size: 24px; line-height: 1.25; font-variant-numeric: tabular-nums; transition: color .3s; }
.yy-dev__val.is-changed { color: var(--yy-cacao-accent); }
.yy-dev__what { font-size: 13px; color: var(--yy-cacao-muted); }
@media (max-width: 560px) {
  .yy-deck__devices { grid-template-columns: repeat(2, 1fr); }
  .yy-dev:nth-child(3) { border-left: 0; }
  .yy-dev:nth-child(n+3) { border-top: 1px solid var(--yy-cacao-line); }
}

.yy-log {
  list-style: none; margin: 0; padding: 12px 0;
  font-family: var(--wp--preset--font-family--plex-mono); font-size: 13.5px; line-height: 1.55;
  min-height: calc(8 * 1.55em + 24px);
}
.yy-log li { display: flex; gap: 14px; padding: 2px 16px; transition: opacity .25s, background-color .25s; }
.yy-log time { color: var(--yy-cacao-muted); flex: none; font-variant-numeric: tabular-nums; }
.yy-log span { min-width: 0; }
.yy-log li.is-in span { color: var(--yy-cacao-accent); }
.yy-log li.is-now { background: rgba(255, 255, 255, .08); }
.yy-deck.is-live .yy-log li:not(.is-shown) { opacity: 0; }
.yy-deck__foot { padding: 12px 16px; border-top: 1px solid var(--yy-cacao-line); font-size: 14px; color: var(--yy-cacao-muted); }
.yy-deck__foot strong { color: var(--yy-cacao-ink); font-weight: 600; }

/* How it works: a real three-step sequence */
.yy-steps { margin-top: 40px !important; gap: 32px !important; }
.yy-step { border-top: 2px solid var(--wp--preset--color--framboise); padding-top: 16px; }
.yy-step__n {
  font-family: var(--wp--preset--font-family--quicksand); font-weight: 700; font-size: 40px; line-height: 1;
  color: var(--wp--preset--color--framboise-text); margin: 0 0 8px;
}
.yy-step h3 { margin: 0 0 8px; }
.yy-step p:last-child { color: var(--wp--preset--color--ink-muted); margin: 0; }

/* Connected room */
.yy-room { gap: clamp(32px, 5vw, 72px) !important; }
.yy-facts > .yy-fact { padding-block: 20px; border-top: 1px solid var(--wp--preset--color--line); margin: 0; }
.yy-facts > .yy-fact:last-child { border-bottom: 1px solid var(--wp--preset--color--line); }
.yy-fact h3 { margin: 0 0 6px; }
.yy-fact p { margin: 0; color: var(--wp--preset--color--ink-muted); }
.yy-fact .wp-block-code { margin: 14px 0 0; padding: 12px 14px; overflow-x: auto; border: 0; }
.yy-fact .wp-block-code code { color: var(--wp--preset--color--framboise-text); white-space: pre; }

/* Who */
.yy-who { margin-top: 32px !important; gap: 40px !important; }
.yy-who h3 { margin: 0 0 8px; }
.yy-who p { margin: 0; color: var(--wp--preset--color--ink-muted); }
.yy-section .yy-note { margin-top: 32px; }

/* Status */
.yy-milestones { display: grid; gap: 12px; }
.yy-ms { margin: 0; padding: 14px 16px 14px 44px; position: relative; border-radius: 10px; background: var(--wp--preset--color--surface-raised); border: 1px solid var(--wp--preset--color--line); }
.yy-ms::before { content: ""; position: absolute; left: 16px; top: 19px; width: 14px; height: 14px; border-radius: 50%; box-sizing: border-box; }
.yy-ms--done::before { background: #1c7a4f; }
.yy-ms--now::before { border: 3px solid var(--wp--preset--color--framboise); }
@media (prefers-color-scheme: dark) { .yy-ms--done::before { background: #4fcb8d; } }

/* Contact */
.yy-contact { border-top: 1px solid var(--wp--preset--color--line); }
.yy-where { font-size: var(--wp--preset--font-size--medium); }
.yy-where strong { display: block; font-weight: 600; color: var(--wp--preset--color--ink-muted); font-size: 15px; }

/* Plain pages */
.yy-page { padding-block: clamp(40px, 6vw, 80px); min-height: 50vh; }

/* Footer */
.yy-footer { background: var(--wp--preset--color--cacao); color: #fff; padding-block: 36px; }
.yy-footer__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.yy-footer__logo { height: 28px; width: auto; }
.yy-footer__text { margin: 0; font-size: 15px; color: var(--yy-cacao-muted); text-align: right; }
.yy-footer__text a { color: #fff; }
@media (max-width: 560px) { .yy-footer__text { text-align: left; } }

@media (prefers-reduced-motion: reduce) {
  .yy-deck .yy-deck__reel { animation: none !important; }
  .yy-log li, .yy-dev__val { transition: none; }
}
