/* LensCraft Tweaks - scoped component styles. Import after the existing everwished template CSS. */

:root {
  --lc-electric: #b8ff2c;
  --lc-signal: #13d7b0;
  --lc-ink: #10141c;
  --lc-rose: #ff5c7a;
}

:root,
:root[data-lens-theme="night-ops"],
:root[data-lens-theme="signal-green"],
:root[data-lens-theme="paper-cut"] {
  --page-background:
    radial-gradient(circle at 82% 0%, rgba(19, 215, 176, 0.12), transparent 22rem),
    linear-gradient(180deg, #eef8ef 0%, #f7fbf6 58%, #ffffff 100%);
  --surface: #ffffff;
  --surface-strong: #e6f7ef;
  --surface-muted: #f1f4ee;
  --text: #17202b;
  --text-muted: #53606b;
  --border: rgba(23, 32, 43, 0.22);
  --accent: #087e6f;
  --accent-strong: #0f382d;
  --accent-soft: rgba(19, 215, 176, 0.14);
  --focus: #c99735;
  --nav-background: rgba(247, 251, 246, 0.96);
  --footer-background: #0f382d;
  --footer-text: #f7f8f0;
}

.site-header__bar {
  display: none;
}

.site-header {
  background: var(--nav-background);
}

.site-nav a,
.button,
.nav-toggle,
.lc-tweak-button,
.lc-risk-options button,
.lc-generator select,
.lc-lens-switcher select {
  border-radius: 6px;
}

.site-nav__item[data-active="true"] > a,
.site-nav a:hover {
  background: #e9e0d4;
}

.brand__wordmark {
  letter-spacing: 0;
}

.lc-reference-hero {
  min-height: 520px;
  display: grid;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(238, 248, 239, 0.96), rgba(238, 248, 239, 0.9) 45%, rgba(238, 248, 239, 0.54)),
    var(--lc-hero-art),
    var(--page-background);
  background-repeat: no-repeat;
  background-size: cover, min(56vw, 760px), cover;
  background-position: center, right 8% center, center;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.lc-reference-hero__inner {
  width: min(1180px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: clamp(3.2rem, 6vw, 5rem) 0;
}

.lc-reference-hero__copy {
  max-width: 720px;
}

.lc-reference-hero .eyebrow {
  color: #c99735;
}

.lc-reference-hero h1 {
  margin: 0.65rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 7vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.lc-reference-hero .lead {
  max-width: 720px;
  margin-top: 1.15rem;
  font-size: clamp(1.08rem, 2vw, 1.32rem);
  line-height: 1.55;
}

.lc-reference-hero .button-row {
  margin-top: 1.65rem;
}

.lc-reference-hero .button--secondary {
  color: var(--text);
}

.lc-trust-strip {
  background: var(--accent-strong);
  color: #f7f8f0;
}

.lc-trust-strip ul {
  width: min(1180px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1rem 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.85rem;
  list-style: none;
}

.lc-trust-strip li {
  border-left: 3px solid #c99735;
  padding-left: 0.7rem;
  font-weight: 900;
  line-height: 1.22;
}

.lc-reference-section-head {
  display: grid;
  gap: 0.85rem;
}

.lc-reference-section-head h2 {
  margin: 0;
  font-size: clamp(2.15rem, 4vw, 3.3rem);
  line-height: 1.02;
  max-width: 10ch;
}

.lc-reference-flow {
  display: grid;
  gap: 1.35rem;
}

.lc-reference-flow > p:first-child {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.16;
  font-weight: 900;
}

.card,
.info-panel,
.hero__aside {
  border-radius: 8px;
}

.card[href] {
  text-decoration: none;
}

.lc-lens-switcher {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(18rem, 0.9fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: end;
}

.lc-lens-switcher h3 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.3rem, 2vw, 1.75rem);
}

.lc-lens-switcher p {
  margin: 0;
}

.lc-lens-switcher__controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.lc-lens-switcher label {
  display: grid;
  gap: 0.35rem;
  font-weight: 800;
}

.lc-lens-switcher select {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem;
  background: Canvas;
  color: CanvasText;
}

.lc-tweak-card,
.rf-rock-widget,
.lc-generator,
.lc-risk-round,
.lc-cupboard-reveal {
  box-sizing: border-box;
}

.lc-tweak-card {
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-radius: 8px;
  padding: clamp(1rem, 2vw, 1.5rem);
  background: color-mix(in srgb, Canvas 94%, var(--accent-soft, transparent) 24%);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.08);
}

.lc-tweak-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.78;
}

.lc-tweak-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

.lc-tweak-stack {
  display: grid;
  gap: 1rem;
}

.lc-tweak-button {
  border: 1px solid var(--accent-strong, #173f54);
  padding: 0.75rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent-strong, #173f54);
  color: #fff;
}

.lc-tweak-button:disabled {
  border-color: var(--border, rgba(0, 0, 0, 0.18));
  background: var(--surface-strong, #f0f6fa);
  color: var(--text-muted, #556471);
  cursor: not-allowed;
  opacity: 0.85;
}

.lc-tweak-button:focus-visible,
.rf-rock-button:focus-visible,
.lc-generator select:focus-visible,
.lc-risk-round button:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 4px;
}

/* RockFlip rock */
.rf-rock-widget {
  text-align: center;
  max-width: 24rem;
  margin-inline: auto;
}

.rf-rock-button {
  display: inline-grid;
  place-items: center;
  inline-size: min(100%, 18rem);
  aspect-ratio: 1.15;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 900px;
}

.rf-rock-inner {
  position: relative;
  inline-size: 100%;
  block-size: 100%;
  transform-style: preserve-3d;
  transition: transform 650ms cubic-bezier(.2,.8,.2,1);
}

.rf-rock-button.is-flipped .rf-rock-inner {
  transform: rotateY(180deg) rotateZ(-2deg);
}

.rf-rock-button:focus .rf-rock-inner,
.rf-rock-button:active .rf-rock-inner,
.rf-rock-widget.is-flipped .rf-rock-inner {
  transform: rotateY(180deg) rotateZ(-2deg);
}

.rf-rock-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  backface-visibility: hidden;
}

.rf-rock-face img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
  filter: drop-shadow(0 1rem 1.2rem rgba(0, 0, 0, 0.22));
}

.rf-rock-face-back {
  transform: rotateY(180deg);
}

.rf-rock-face-back::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 29% 15% 20%;
  border-radius: 0.85rem;
  background: rgba(16, 20, 28, 0.92);
  box-shadow: 0 0.75rem 1rem rgba(0, 0, 0, 0.28);
}

.rf-rock-finding {
  position: absolute;
  z-index: 2;
  inset-inline: 16%;
  bottom: 23%;
  display: block;
  padding: 0.5rem 0.55rem;
  color: #f7f8f0;
  font-size: clamp(0.78rem, 2vw, 0.95rem);
  font-weight: 900;
  line-height: 1.12;
  text-wrap: balance;
}

.rf-rock-caption {
  margin: 0.75rem auto 0;
  max-width: 18rem;
  font-size: 0.95rem;
  font-weight: 800;
  opacity: 0.82;
}

/* Cupboard reveal */
.lc-cupboard-reveal {
  position: relative;
  display: grid;
  place-items: center;
  min-block-size: 24rem;
  --cupboard-progress: 0.32;
}

.lc-cupboard-scene {
  position: relative;
  inline-size: min(100%, 22rem);
  aspect-ratio: 4 / 5;
  transform-style: preserve-3d;
  perspective: 900px;
}

.lc-cupboard-scene img,
.lc-cupboard-layer {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
}

.lc-cupboard-skeleton {
  opacity: calc(0.22 + (var(--cupboard-progress, 0) * 0.78));
  transform: translateY(calc((1 - var(--cupboard-progress, 0)) * 1.2rem));
  transition: opacity 120ms linear, transform 120ms linear;
  z-index: 1;
}

.lc-cupboard-door {
  z-index: 3;
  transform-origin: 18% 50%;
  transform: rotateY(calc(var(--cupboard-progress, 0) * -78deg));
  transition: transform 120ms linear;
}

.lc-cupboard-label {
  position: absolute;
  z-index: 5;
  inset-inline: 4%;
  bottom: -0.4rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  background: color-mix(in srgb, Canvas 88%, currentColor 12%);
  box-shadow: 0 0.7rem 1.4rem rgba(0, 0, 0, 0.12);
}

/* SAT Session Name Generator */
.lc-generator {
  display: grid;
  gap: 1rem;
}

.lc-generator-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.lc-generator label {
  display: grid;
  gap: 0.4rem;
  font-weight: 700;
}

.lc-generator select {
  inline-size: 100%;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-radius: 0.75rem;
  padding: 0.75rem;
  font: inherit;
  background: Canvas;
  color: CanvasText;
}

.lc-generator-result {
  min-block-size: 7rem;
  border-radius: 1rem;
  padding: 1rem;
  background: color-mix(in srgb, Canvas 88%, currentColor 12%);
}

.lc-generator-title {
  margin: 0 0 0.4rem;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.12;
}

.lc-generator-angle {
  margin: 0;
  opacity: 0.8;
}

/* Risk round */
.lc-risk-round {
  display: grid;
  gap: 1rem;
}

.lc-risk-screen {
  position: relative;
  border-radius: 1rem;
  padding: 1rem;
  min-block-size: 10rem;
  background: #15151d;
  color: white;
  overflow: hidden;
}

.lc-risk-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(255,255,255,.13), transparent 55%);
  pointer-events: none;
}

.lc-risk-title,
.lc-risk-prompt,
.lc-risk-xs {
  position: relative;
  z-index: 1;
}

.lc-risk-title {
  margin: 0 0 0.5rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.lc-risk-prompt {
  font-size: 1.1rem;
  margin: 0.5rem 0 1rem;
}

.lc-risk-xs {
  display: flex;
  gap: 0.35rem;
  font-size: 2rem;
  line-height: 1;
}

.lc-risk-x {
  opacity: 0.35;
  transform: scale(0.9);
  transition: opacity 160ms ease, transform 160ms ease;
}

.lc-risk-x.is-lit {
  opacity: 1;
  transform: scale(1.05);
}

.lc-risk-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.lc-risk-options button {
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  border-radius: 999px;
  padding: 0.65rem 0.85rem;
  font: inherit;
  font-weight: 700;
  background: Canvas;
  color: CanvasText;
  cursor: pointer;
}

.lc-risk-feedback {
  min-block-size: 3rem;
  font-weight: 600;
}

.lc-risk-score {
  margin: -0.35rem 0 0;
  color: var(--text-muted);
  font-weight: 800;
}

/* Beige detector */
[data-ban-beige] {
  cursor: pointer;
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.18em;
}

.lc-beige-toast {
  position: fixed;
  z-index: 9999;
  inset-inline: 50% auto;
  bottom: 1.25rem;
  transform: translateX(-50%);
  max-width: min(92vw, 28rem);
  padding: 0.85rem 1rem;
  border-radius: 999px;
  background: #efe2c3;
  color: #1b1711;
  font-weight: 800;
  box-shadow: 0 0.75rem 2rem rgba(0,0,0,.2);
}

body.lc-beige-detected {
  animation: lcBeigePurge 1600ms ease both;
}

@keyframes lcBeigePurge {
  0% { filter: none; }
  25% { filter: sepia(.5) saturate(.55) brightness(1.05); }
  65% { filter: sepia(.7) saturate(.35) brightness(1.08); }
  100% { filter: none; }
}

@media (max-width: 720px) {
  .lc-reference-hero {
    min-height: auto;
    background:
      linear-gradient(180deg, rgba(238, 248, 239, 0.96), rgba(238, 248, 239, 0.88)),
      var(--lc-hero-art),
      var(--page-background);
    background-repeat: no-repeat;
    background-size: cover, 120vw, cover;
    background-position: center, center 18%, center;
  }

  .lc-reference-hero__inner,
  .lc-trust-strip ul {
    width: min(100% - 2rem, 1180px);
  }

  .lc-reference-hero__inner {
    padding-block: 3rem;
  }

  .lc-trust-strip ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lc-generator-grid {
    grid-template-columns: 1fr;
  }

  .lc-lens-switcher,
  .lc-lens-switcher__controls {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rf-rock-inner,
  .lc-cupboard-skeleton,
  .lc-cupboard-door,
  .lc-risk-x,
  body.lc-beige-detected {
    transition: none !important;
    animation: none !important;
  }
}
