/* Flagship Asymmetric Bento Showcase, Window Chrome, Screen Switchers, Cursor Spotlight & Ecosystem Stage */

/* --- 0. Interactive Cursor Spotlight on Flagship Cards --- */
[data-spotlight] {
  position: relative;
}

[data-spotlight]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.08), transparent 60%);
  transition: opacity 0.35s var(--ease);
  z-index: 2;
}

html[data-theme="light"] [data-spotlight]::after {
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), rgba(20, 21, 26, 0.045), transparent 60%);
}

@media (hover: hover) {
  [data-spotlight]:hover::after {
    opacity: 1;
  }
}

/* --- 1. Browser / App Window Chrome + Interactive Screen Switcher --- */
.window-frame {
  border-radius: 16px;
  overflow: hidden;
  background: #0D0F16;
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 30px 64px -22px rgba(0, 0, 0, 0.78);
}

html[data-theme="light"] .window-frame {
  border-color: rgba(20, 21, 26, 0.13);
  box-shadow: 0 24px 50px -20px rgba(20, 21, 26, 0.22);
}

.window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #161822;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.window-dots {
  display: inline-flex;
  gap: 6px;
}

.window-dots i {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.window-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #9CA3B5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.screen-tab {
  min-height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #B4BBCB;
  font-size: 12px;
  font-weight: 600;
}

.screen-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.screen-tab[aria-selected="true"] {
  background: #FFFFFF;
  color: #14151A;
}

.window-body {
  position: relative;
  background: #0B0C12;
}

.window-body img,
.window-body picture {
  display: block;
  width: 100%;
  height: auto;
}

.window-body [hidden] {
  display: none;
}

/* --- 2. Interactive Ecosystem Switcher (Play · Learn · Make · Grow) --- */
.ecosystem-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
  margin-bottom: clamp(28px, 3.5vw, 44px);
}

.ecosystem-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 3.8vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.036em;
  max-width: 18ch;
}

.ecosystem-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--inner-highlight);
}

.eco-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.eco-tab img {
  width: 20px;
  height: 20px;
  display: block;
}

.eco-tab:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.eco-tab[aria-selected="true"] {
  color: var(--ink);
  background: var(--surface-2);
  border-color: var(--tab-accent, var(--line-strong));
  box-shadow: 0 8px 24px -10px var(--tab-accent, transparent);
}

.eco-tab[data-pillar="play"] { --tab-accent: var(--c-syntories); }
.eco-tab[data-pillar="learn"] { --tab-accent: var(--c-synclass); }
.eco-tab[data-pillar="make"] { --tab-accent: var(--c-mathedos); }
.eco-tab[data-pillar="grow"] { --tab-accent: var(--c-create); }

.eco-stage {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  border-top: 3px solid var(--stage-accent, var(--c-syntories));
  background: var(--surface);
  box-shadow: var(--card-shadow), var(--inner-highlight);
  overflow: hidden;
}

.eco-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(24px, 3.8vw, 52px);
}

.eco-panel[hidden] {
  display: none;
}

.eco-panel[data-pillar="play"] { --stage-accent: var(--c-syntories); }
.eco-panel[data-pillar="learn"] { --stage-accent: var(--c-synclass); }
.eco-panel[data-pillar="make"] { --stage-accent: var(--c-mathedos); }
.eco-panel[data-pillar="grow"] { --stage-accent: var(--c-create); }

.eco-copy .kicker {
  color: var(--stage-accent);
}

.eco-copy h3 {
  font-size: clamp(26px, 2.8vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.032em;
  margin-bottom: 12px;
}

.eco-copy > p {
  font-size: 16.5px;
  color: var(--ink-2);
  max-width: 42ch;
  margin-bottom: 24px;
}

.eco-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 26px;
}

.eco-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  text-decoration: none;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.eco-item:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.eco-item strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  color: var(--ink);
}

.eco-item strong::before {
  content: "";
  width: 0;
  height: 0;
  border: 4px solid var(--dot, var(--ink));
  border-radius: 50%;
  flex-shrink: 0;
}

.eco-item span {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.eco-visual {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #0F1118;
  box-shadow: 0 26px 60px -24px rgba(0, 0, 0, 0.72);
}

.eco-visual img {
  display: block;
  width: 100%;
  height: auto;
}

/* --- 3. Asymmetric Apple-style Bento Grid (#work) --- */
#work .section-head {
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 24px;
}

#work .work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2vw, 28px);
}

.product-feature {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(22px, 2.5vw, 34px);
  padding: clamp(26px, 3.2vw, 44px);
  border: 1px solid var(--frame);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--stage);
  color: var(--type);
  box-shadow: var(--inner-highlight);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.product-feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
}

.product-feature.is-wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 0.74fr) minmax(0, 1.26fr);
  align-items: center;
  gap: clamp(26px, 4vw, 56px);
}

.product-feature.syntories {
  --accent: var(--c-syntories);
  --type: #F5F6FA;
  --muted-local: #CBC2C8;
  --frame: rgba(212, 20, 46, 0.3);
  --stage:
    radial-gradient(ellipse 65% 75% at 88% 12%, rgba(212, 20, 46, 0.24), transparent 64%),
    linear-gradient(145deg, #16171F 0%, #1E141B 100%);
}

.product-feature.synclass {
  --accent: var(--c-synclass);
  --type: #F5F6FA;
  --muted-local: #BFC9DC;
  --frame: rgba(31, 99, 214, 0.3);
  --stage:
    radial-gradient(ellipse 75% 65% at 88% 0%, rgba(31, 99, 214, 0.24), transparent 64%),
    linear-gradient(155deg, #171A24 0%, #131B2B 100%);
}

.product-feature.trybytest {
  --accent: var(--c-trybytest);
  --type: #F5F6FA;
  --muted-local: #BBD4C5;
  --frame: rgba(14, 159, 79, 0.3);
  --stage:
    radial-gradient(ellipse 75% 65% at 88% 0%, rgba(14, 159, 79, 0.22), transparent 64%),
    linear-gradient(155deg, #161B19 0%, #111E18 100%);
}

html[data-theme="light"] .product-feature.syntories {
  --type: #14151A;
  --muted-local: #4B464D;
  --frame: rgba(212, 20, 46, 0.22);
  --stage:
    radial-gradient(ellipse 75% 60% at 90% 0%, rgba(212, 20, 46, 0.09), transparent 65%),
    #FCF7F8;
}

html[data-theme="light"] .product-feature.synclass {
  --type: #14151A;
  --muted-local: #3E4A60;
  --frame: rgba(31, 99, 214, 0.22);
  --stage:
    radial-gradient(ellipse 75% 60% at 90% 0%, rgba(31, 99, 214, 0.1), transparent 65%),
    #F5F8FF;
}

html[data-theme="light"] .product-feature.trybytest {
  --type: #14151A;
  --muted-local: #355042;
  --frame: rgba(14, 159, 79, 0.22);
  --stage:
    radial-gradient(ellipse 75% 60% at 90% 0%, rgba(14, 159, 79, 0.1), transparent 65%),
    #F4FBF7;
}

.product-feature .work-brand img {
  width: auto;
  height: clamp(38px, 3.2vw, 50px);
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

.product-feature p {
  max-width: 38ch;
  margin: 14px 0 26px;
  font-size: clamp(16px, 1.25vw, 19px);
  line-height: 1.56;
  color: var(--muted-local);
}

.feature-link {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

.syntories .feature-link {
  background: var(--c-syntories);
  color: #FFFFFF;
}

.synclass .feature-link {
  background: var(--c-synclass);
  color: #FFFFFF;
}

.trybytest .feature-link {
  background: #0B7D3E;
  color: #FFFFFF;
}

.feature-link:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.product-feature .words {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  z-index: 3;
}

.product-feature .feature-link {
  margin-top: auto;
}

.companion-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.companion-card.is-proof {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  align-items: center;
  gap: clamp(26px, 4vw, 56px);
  border-top: 3px solid var(--c-mathedos);
  padding: clamp(26px, 3.2vw, 44px);
}

.companion-card.is-proof .words {
  padding: 0;
}

.companion-card .words {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.companion-card .words .secondary {
  margin-top: auto;
}

/* Orbital rings on Syntrofos Create live orb */
.avatar-orb-wrap {
  position: relative;
  display: grid;
  place-items: center;
  padding: 18px;
}

.avatar-orb-wrap::before,
.avatar-orb-wrap::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.avatar-orb-wrap::before {
  inset: 4px;
  border-style: dashed;
  animation: orbit-spin 26s linear infinite;
}

.avatar-orb-wrap::after {
  inset: -8px;
  border-color: rgba(124, 77, 255, 0.24);
}

@keyframes orbit-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .avatar-orb-wrap::before {
    animation: none;
  }
}

/* Syntrofos Create preset pills */
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.preset-chip {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #D7D4EC;
  font-size: 13px;
  font-weight: 500;
}

.preset-chip:hover,
.preset-chip[aria-pressed="true"] {
  background: rgba(124, 77, 255, 0.3);
  border-color: rgba(183, 156, 255, 0.7);
  color: #FFFFFF;
}

@media (max-width: 960px) {
  .eco-panel,
  .product-feature.is-wide,
  .companion-card.is-proof {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  #work .work-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .product-feature {
    gap: 22px;
    padding: 22px 20px;
  }
  .product-feature .work-brand img {
    height: 38px;
  }
  .product-feature p {
    margin: 10px 0 18px;
  }
  .eco-items {
    grid-template-columns: minmax(0, 1fr);
  }
  .ecosystem-tabs {
    border-radius: 18px;
    width: 100%;
    justify-content: space-between;
  }
  .eco-tab {
    flex: 1 1 auto;
    justify-content: center;
    padding: 0 12px;
  }
  .window-url {
    display: none;
  }
}
