@font-face {
  font-family: 'Cal Sans';
  src: url('../assets/fonts/CalSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

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

:root {
  --bg: #060607;
  --panel: rgba(255, 255, 255, 0.03);
  --line: rgba(255, 255, 255, 0.08);
  --text: #e8e8ed;
  --muted: #9494a0;
  --dim: #5a5a66;
  --accent: #7c83eb;
  --accent-dim: #5b62c4;
  --max: 980px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Cal Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

a.link-inline {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

code {
  font-family: ui-monospace, monospace;
  font-size: 0.88em;
  color: var(--muted);
}

.bg-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--bg);
}

.bg-grain::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
}

.logo-icon {
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #15151a;
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 0.95rem;
}

.topnav {
  display: none;
  gap: 1.5rem;
}

.topnav a {
  color: var(--muted);
  font-size: 0.92rem;
}

.topnav a:hover { color: var(--text); }

@media (min-width: 640px) {
  .topnav { display: flex; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.15rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.btn-fill {
  background: var(--accent);
  color: #fff;
}

.btn-fill:hover { background: var(--accent-dim); }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Hero — side by side on desktop, not centered iiSU clone */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

@media (min-width: 820px) {
  .hero {
    grid-template-columns: 1fr 1.15fr;
    gap: 3rem;
    padding-top: 3rem;
  }
}

.hero-copy {
  max-width: 420px;
}

@media (min-width: 820px) {
  .hero-copy { max-width: none; }
}

.release-note {
  color: var(--dim);
  font-size: 0.82rem;
  margin-bottom: 1rem;
}

.release-note span {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  margin-right: 0.3rem;
}

.hero h1 {
  font-size: clamp(2.75rem, 8vw, 3.75rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.65rem;
}

.hero-tag {
  color: var(--text);
  font-size: clamp(1.05rem, 2.5vw, 1.2rem);
  margin-bottom: 0.85rem;
}

.hero-lede {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.hero-shot {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0a0a0c;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.hero-shot img {
  display: block;
  width: 100%;
  height: auto;
}

/* About / iiSU origin */
.about-block {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

@media (min-width: 760px) {
  .about-block {
    grid-template-columns: 1.4fr 1fr;
    gap: 3rem;
    align-items: start;
  }
}

.about-copy h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.about-copy p {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.65;
  margin-bottom: 1rem;
}

.about-copy a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.about-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.about-points li {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.about-points strong {
  display: block;
  color: var(--text);
  font-weight: 400;
  margin-bottom: 0.15rem;
}

.fine-print {
  font-size: 0.85rem !important;
  color: var(--dim) !important;
}

/* FAQ */
.faq-block {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
}

.faq-block > h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.faq-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.faq-panel details {
  border-bottom: 1px solid var(--line);
}

.faq-panel details:last-child { border-bottom: none; }

.faq-panel summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  font-size: 0.95rem;
}

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

.faq-panel summary::after {
  content: '+';
  float: right;
  color: var(--dim);
}

.faq-panel details[open] summary::after { content: '−'; }

.faq-panel p {
  padding: 0 1.25rem 1.1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Features grid */
.features-block {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem 3.5rem;
}

.features-block > h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 600px) {
  .features-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  .features-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.feature {
  padding: 1.1rem 1.2rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.feature h3 {
  font-size: 0.95rem;
  font-weight: 400;
  margin-bottom: 0.4rem;
}

.feature p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Split sections */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

@media (min-width: 760px) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
  .split-reverse .split-copy { order: -1; }
}

.split h2 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  margin-bottom: 0.85rem;
}

.split-copy p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.widget-list {
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.15rem 1.35rem;
}

.widget-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.9rem;
}

.widget-list li:last-child { border-bottom: none; }

.theme-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.theme-strip span {
  aspect-ratio: 1.2;
  border-radius: 14px;
  background: var(--c);
  border: 2px solid transparent;
  display: flex;
  align-items: flex-end;
  padding: 0.5rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 -3px 0 var(--a);
}

.theme-strip span:first-child { color: rgba(0, 0, 0, 0.55); text-shadow: none; }

/* Download */
.download-block {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
  border-top: 1px solid var(--line);
}

.download-block h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  margin-bottom: 0.65rem;
}

.download-lede {
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 1.75rem;
  font-size: 0.95rem;
}

.download-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.download-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .download-grid { grid-template-columns: 1fr 1fr; }
}

.download-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.1rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}

.download-item:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.045);
}

.dl-platform {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

.dl-file {
  font-size: 0.88rem;
  color: var(--text);
  word-break: break-all;
}

.dl-meta {
  font-size: 0.78rem;
  color: var(--dim);
  margin-top: 0.25rem;
}

/* Discord invite — sits right under download buttons */
.discord-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem 1.15rem;
  padding: 1.15rem 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(88, 101, 242, 0.35);
  background:
    linear-gradient(135deg, rgba(88, 101, 242, 0.14) 0%, rgba(88, 101, 242, 0.04) 42%, rgba(255, 255, 255, 0.02) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.discord-card:hover {
  border-color: rgba(88, 101, 242, 0.55);
  background:
    linear-gradient(135deg, rgba(88, 101, 242, 0.2) 0%, rgba(88, 101, 242, 0.07) 42%, rgba(255, 255, 255, 0.03) 100%);
  transform: translateY(-1px);
}

.discord-card-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  background: #5865f2;
  color: #fff;
  box-shadow: 0 8px 24px rgba(88, 101, 242, 0.35);
}

.discord-card-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.discord-card-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a5adf8;
}

.discord-card-title {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.2;
}

.discord-card-desc {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
}

.discord-card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  background: #5865f2;
  color: #fff;
  font-size: 0.88rem;
  white-space: nowrap;
  transition: background 0.15s;
}

.discord-card:hover .discord-card-cta {
  background: #4752c4;
}

@media (max-width: 639px) {
  .discord-card {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }

  .discord-card-cta {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* Footer */
.foot {
  text-align: center;
  padding: 2rem 1.5rem 3rem;
  color: var(--dim);
  font-size: 0.82rem;
  border-top: 1px solid var(--line);
}

.foot a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.foot a:hover { color: var(--text); }

/* Linux download modal */
body.modal-open { overflow: hidden; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.modal-panel {
  position: relative;
  width: min(100%, 480px);
  max-height: min(90vh, 640px);
  overflow-y: auto;
  padding: 1.5rem 1.5rem 1.35rem;
  background: #111114;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.modal-panel h2 {
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 0.65rem;
  padding-right: 2rem;
}

.modal-lede {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.modal-steps {
  margin: 0 0 1rem 1.15rem;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.55;
}

.modal-steps li { margin-bottom: 0.45rem; }

.modal-steps code,
.modal-note code {
  font-size: 0.82em;
  color: var(--muted);
  word-break: break-all;
}

.modal-note {
  color: var(--dim);
  font-size: 0.85rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

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