/* JassIDE presentation site — Obsidiana theme tokens */
:root {
  --bg: #0b0b0d;
  --surface: #101013;
  --elevated: #141417;
  --border: #232329;
  --border-strong: #36363f;

  --text: #eaeaef;
  --text-secondary: #94949e;
  --text-muted: #666670;

  --gold: #dca848;
  --gold-hover: #e9b95c;
  --on-gold: #1a1206;
  --gold-bg: #1e1911;
  --gold-border: #5e4822;

  --font-display: 'Cinzel', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, 'Cascadia Mono', ui-monospace, monospace;

  /* 3-step body typographic scale below the hero */
  --text-heading: clamp(1.55rem, 2.3vw, 2.05rem);
  --text-body: 0.96875rem;
  --text-sm: 0.875rem;

  --radius-sm: 6px;
  --radius-md: 8px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  --container: 1120px;
  --header-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  color-scheme: dark;
  background-color: var(--bg);
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  a:hover {
    color: var(--gold-hover);
  }
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 3px;
}

.mono {
  font-family: var(--font-mono);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: clamp(18px, 4vw, 32px);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--on-gold);
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 12px;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color 200ms var(--ease-out), border-color 200ms var(--ease-out);
}

.site-header.is-scrolled {
  background-color: rgba(11, 11, 13, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--border);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  flex-shrink: 0;
}

.brand-mark {
  display: block;
  flex-shrink: 0;
}

.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  line-height: 1;
}

.brand-jass {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
}

.brand-ide {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.main-nav a {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .main-nav a:hover {
    color: var(--text);
  }
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.lang-opt {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}

.lang-opt[aria-pressed='true'] {
  background-color: var(--gold-bg);
  color: var(--gold);
}

@media (hover: hover) and (pointer: fine) {
  .lang-opt:not([aria-pressed='true']):hover {
    color: var(--text);
  }
}

.menu-toggle {
  display: none;
  appearance: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Hero */
.hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(32px, 5vw, 60px));
  padding-bottom: clamp(56px, 7vw, 92px);
  background: radial-gradient(ellipse 68% 36% at 50% 0%, rgba(220, 168, 72, 0.065), transparent 72%);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-title {
  margin: 0;
  max-width: 22ch;
  font-family: var(--font-display);
  font-size: clamp(2.05rem, 4.3vw, 3.4rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--text);
}

.hero-subtitle {
  margin: 22px 0 0;
  max-width: 60ch;
  font-size: clamp(1rem, 1.35vw, 1.125rem);
  line-height: 1.6;
  color: var(--text-secondary);
}

.hero-actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 22px;
  background-color: var(--gold);
  color: var(--on-gold);
  font-size: var(--text-body);
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background-color 160ms var(--ease-out), transform 140ms var(--ease-out);
}

.btn-primary:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    background-color: var(--gold-hover);
    color: var(--on-gold);
  }
}

.link-secondary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .link-secondary:hover {
    color: var(--gold);
    border-bottom-color: var(--gold);
  }
}

.hero-meta {
  margin: 18px 0 0;
  max-width: 72ch;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.55;
}

.hero-stage {
  margin: clamp(36px, 5vw, 56px) 0 0;
  width: 100%;
}

/* Screenshot presentation: no extra window frame, strictly 8px radius, #232329 border, soft shadow */
.screen-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: var(--radius-md);
  transition: transform 180ms var(--ease-out);
}

.screen-trigger:active {
  transform: scale(0.99);
}

.screen-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1280 / 768;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.58), 0 4px 14px rgba(0, 0, 0, 0.35);
  background-color: var(--surface);
  transition: border-color 180ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .screen-trigger:hover .screen-img {
    border-color: var(--border-strong);
  }
}

/* Sections */
.section {
  padding-block: clamp(64px, 8vw, 108px);
  border-top: 1px solid var(--border);
}

.section-alt {
  background-color: var(--surface);
}

.section-head {
  max-width: 62ch;
  margin-bottom: clamp(32px, 4vw, 48px);
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-heading);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--gold);
}

.section-lead {
  margin: 12px 0 0;
  font-size: var(--text-body);
  color: var(--text-secondary);
}

/* Hairline architectural feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background-color: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.feature-card {
  background-color: var(--surface);
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background-color 180ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .feature-card:hover {
    background-color: var(--elevated);
  }
}

.feature-icon {
  color: var(--gold);
  flex-shrink: 0;
  margin-bottom: 4px;
}

.feature-card h3 {
  margin: 0;
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.feature-card p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 3 Alternating Showcases */
.showcase-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(56px, 7vw, 96px);
}

.showcase-row {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(28px, 4.5vw, 56px);
  align-items: center;
}

.showcase-reverse .showcase-media {
  order: -1;
}

.showcase-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.showcase-copy p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 56ch;
}

.showcase-media {
  margin: 0;
}

.code-note {
  margin-top: 4px;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  width: fit-content;
  max-width: 100%;
}

.code-label {
  color: var(--gold);
}

.code-note code {
  color: var(--text);
  font-family: inherit;
  word-break: break-word;
}

/* Segmented view switcher for Inspector / AI Chat / Settings */
.seg-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: fit-content;
  max-width: 100%;
}

.seg-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.seg-tab[aria-selected='true'] {
  background-color: var(--gold-bg);
  border-color: var(--gold-border);
  color: var(--gold);
}

@media (hover: hover) and (pointer: fine) {
  .seg-tab:not([aria-selected='true']):hover {
    color: var(--text);
  }
}

.tab-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tab-copy[hidden] {
  display: none;
}

/* How It Works — 3 steps */
.steps-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.step-card {
  padding: 26px 24px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background-color: var(--gold-bg);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: 4px;
}

.step-card h3 {
  margin: 0;
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--text);
}

.step-card p {
  margin: 0;
  font-size: var(--text-body);
  color: var(--text-secondary);
}

/* Download & Install */
.download-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(28px, 4.5vw, 56px);
  align-items: start;
}

.download-intro {
  margin: 16px 0 0;
  max-width: 58ch;
  color: var(--text-secondary);
}

.download-actions {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.req-list {
  margin: 30px 0 0;
  border-top: 1px solid var(--border);
}

.req-list > div {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.req-list dt {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
}

.req-list dd {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.smartscreen-box {
  padding: 24px;
  background-color: var(--gold-bg);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
}

.smartscreen-head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
}

.smartscreen-head h3 {
  margin: 0;
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--text);
}

.smartscreen-note {
  margin: 12px 0 0;
  font-size: var(--text-body);
  color: var(--text);
}

.smartscreen-steps {
  margin: 16px 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: var(--text-body);
  color: var(--text-secondary);
}

.smartscreen-steps li::marker {
  color: var(--gold);
  font-family: var(--font-mono);
}

/* FAQ */
.faq-container {
  max-width: 820px;
}

.faq-list {
  border-top: 1px solid var(--border);
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: color 160ms var(--ease-out);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '';
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-right: 1.6px solid var(--text-secondary);
  border-bottom: 1.6px solid var(--text-secondary);
  transform: rotate(45deg);
  transition: transform 180ms var(--ease-out), border-color 180ms var(--ease-out);
  margin-right: 4px;
}

.faq-item[open] summary::after {
  transform: rotate(225deg);
  border-color: var(--gold);
}

@media (hover: hover) and (pointer: fine) {
  .faq-item summary:hover {
    color: var(--gold);
  }
}

.faq-item p {
  margin: 0 0 20px;
  max-width: 68ch;
  font-size: var(--text-body);
  color: var(--text-secondary);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background-color: var(--bg);
  padding-block: 44px 52px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.footer-author {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-size: var(--text-sm);
}

.footer-credits {
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.footer-credits p {
  margin: 0;
  max-width: 92ch;
}

.footer-credits strong {
  color: var(--text);
  font-weight: 500;
}

.footer-legal {
  color: var(--text-secondary);
}

/* Lightbox dialog */
.lightbox {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: min(1280px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  color: var(--text);
  overflow: visible;
}

.lightbox::backdrop {
  background: rgba(7, 7, 9, 0.86);
  backdrop-filter: blur(4px);
}

.lightbox-frame {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72);
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.lightbox-caption {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.lightbox-close {
  appearance: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .lightbox-close:hover {
    border-color: var(--gold-border);
    color: var(--gold);
  }
}

.lightbox-img {
  width: 100%;
  max-height: calc(100dvh - 104px);
  object-fit: contain;
  background: var(--bg);
}

/* 404 Page */
.page-404 {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.notfound {
  max-width: 460px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.notfound-code {
  margin: 12px 0 0;
  color: var(--gold);
  font-size: var(--text-sm);
  letter-spacing: 0.14em;
}

.notfound-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 600;
  color: var(--text);
}

.notfound-text {
  margin: 0 0 8px;
  color: var(--text-secondary);
}

/* Responsive breakpoints */
@media (max-width: 1020px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .showcase-row,
  .download-layout {
    grid-template-columns: 1fr;
  }

  .showcase-reverse .showcase-media {
    order: 0;
  }
}

@media (max-width: 780px) {
  .menu-toggle {
    display: inline-flex;
  }

  .main-nav {
    position: fixed;
    top: var(--header-h);
    inset-inline: 0;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px clamp(18px, 4vw, 32px) 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    display: none;
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a {
    width: 100%;
    padding: 10px 0;
    font-size: var(--text-body);
    border-bottom: 1px solid var(--border);
  }

  .main-nav a:last-child {
    border-bottom: 0;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  .req-list > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 560px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .lang-opt {
    padding: 6px 6px;
    font-size: 0.8125rem;
  }

  .hero-actions,
  .download-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .link-secondary {
    align-self: center;
    width: fit-content;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
