/* ============================================================
   IF-SCHLEIFE DOCS — styles.css
   Official C# If-Loop Documentation Stylesheet v3.1.4
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,600;1,400&family=Syne:wght@400;600;700;800&family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

/* ── Variables ──────────────────────────────────────────── */
:root {
  --bg:           #0d1117;
  --surface:      #161b22;
  --surface2:     #1c2333;
  --border:       #30363d;
  --accent:       #00b4d8;
  --accent2:      #0077b6;
  --accent-glow:  rgba(0,180,216,0.15);
  --green:        #3fb950;
  --yellow:       #d29922;
  --red:          #f85149;
  --purple:       #a371f7;
  --text:         #e6edf3;
  --text-muted:   #8b949e;
  --text-dim:     #484f58;
  --code-bg:      #010409;
  --radius:       8px;
  --radius-lg:    14px;
  --nav-h:        60px;
  --font-body:    'IBM Plex Sans', sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;
  --font-display: 'Syne', sans-serif;
  --shadow:       0 4px 24px rgba(0,0,0,0.5);
  --shadow-accent: 0 0 32px rgba(0,180,216,0.2);
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: #48cae4; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

p { margin-bottom: 1em; color: #cdd9e5; }
strong { color: var(--text); font-weight: 600; }
em { color: var(--accent); font-style: italic; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ── Navbar ─────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(13,17,23,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 0;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-right: 2rem;
  white-space: nowrap;
}

.nav-logo .logo-badge {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000;
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: .05em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex: 1;
}

.nav-links a {
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 500;
  padding: .4rem .85rem;
  border-radius: var(--radius);
  transition: all .2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--surface2);
}

.nav-links a.active {
  color: var(--accent);
}

.nav-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--green);
  border: 1px solid var(--green);
  padding: 2px 10px;
  border-radius: 20px;
  animation: pulse-green 2.5s ease-in-out infinite;
}

@keyframes pulse-green {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ── Page wrapper ───────────────────────────────────────── */
.page-wrapper {
  padding-top: calc(var(--nav-h) + 2rem);
  min-height: 100vh;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-wide {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -120px; left: 50%; transform: translateX(-50%);
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(0,180,216,.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .15em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 20px; height: 1px;
  background: var(--accent);
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  background: linear-gradient(135deg, #e6edf3 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.25rem;
}

.hero-sub {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 680px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  transition: all .25s;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000;
  box-shadow: 0 0 20px rgba(0,180,216,.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 30px rgba(0,180,216,.5);
  color: #000;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface2);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ── Cards ──────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all .3s;
  position: relative;
  overflow: hidden;
  animation: fadeInUp .5s ease both;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  opacity: 0;
  transition: opacity .3s;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-accent);
}

.card:hover::before { opacity: 1; }

.card-icon {
  font-size: 1.8rem;
  margin-bottom: .75rem;
  display: block;
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: .5rem;
  color: var(--text);
}

.card p {
  font-size: .9rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── Code Blocks ────────────────────────────────────────── */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
  animation: fadeInUp .5s ease both;
}

.code-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .65rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.code-dots {
  display: flex;
  gap: 6px;
}

.code-dots span {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: block;
}

.dot-red   { background: #ff5f56; }
.dot-yellow{ background: #ffbd2e; }
.dot-green { background: #27c93f; }

.code-filename {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--text-muted);
  margin-left: auto;
}

.code-lang {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 2px 8px;
  border-radius: 4px;
}

pre {
  padding: 1.5rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: .88rem;
  line-height: 1.65;
}

/* Syntax Highlighting — CSS only */
.kw   { color: #ff7b72; }   /* keywords: if, loop, break, continue, int, string */
.kw2  { color: #f0883e; }   /* secondary kw: new, return, var */
.type { color: #79c0ff; }   /* types: int, string, bool */
.fn   { color: #d2a8ff; }   /* function names */
.str  { color: #a5d6ff; }   /* strings */
.num  { color: #79c0ff; }   /* numbers */
.cmt  { color: #8b949e; font-style: italic; } /* comments */
.op   { color: #ff7b72; }   /* operators */
.var  { color: #e6edf3; }   /* variables */
.cls  { color: #ffa657; }   /* class names */

/* Copy-button shimmer */
.code-block:hover .code-header {
  background: var(--surface2);
}

/* Animated glow on code blocks */
@keyframes code-glow {
  0%,100% { box-shadow: 0 0 0 rgba(0,180,216,0); }
  50%      { box-shadow: 0 0 20px rgba(0,180,216,.15); }
}
.code-block:hover {
  animation: code-glow 2s ease infinite;
  border-color: rgba(0,180,216,.4);
}

/* ── Sections ───────────────────────────────────────────── */
section { padding: 3.5rem 0; }

.section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: .5rem;
  color: var(--text);
}

.section-sub {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2rem;
  max-width: 600px;
}

/* ── Callout / Alert ────────────────────────────────────── */
.callout {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  display: flex;
  gap: .75rem;
  font-size: .92rem;
  line-height: 1.6;
  border-left: 3px solid;
}

.callout p { margin: 0; }

.callout-info {
  background: rgba(0,180,216,.08);
  border-color: var(--accent);
  color: #90e0ef;
}

.callout-warn {
  background: rgba(210,153,34,.08);
  border-color: var(--yellow);
  color: #e3b341;
}

.callout-danger {
  background: rgba(248,81,73,.08);
  border-color: var(--red);
  color: #ff7b72;
}

.callout-success {
  background: rgba(63,185,80,.08);
  border-color: var(--green);
  color: #56d364;
}

.callout-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: .1rem; }

/* ── Table ──────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

th {
  background: var(--surface);
  padding: .85rem 1.1rem;
  text-align: left;
  font-family: var(--font-mono);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

td {
  padding: .85rem 1.1rem;
  border-bottom: 1px solid rgba(48,54,61,.5);
  color: #cdd9e5;
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: rgba(255,255,255,.02); }

td code, pre code,
.inline-code {
  font-family: var(--font-mono);
  font-size: .85em;
  background: rgba(255,255,255,.07);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--accent);
}

/* ── Diagram Boxes ──────────────────────────────────────── */
.diagram {
  background: var(--code-bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 1.5rem 0;
  font-family: var(--font-mono);
  font-size: .82rem;
  white-space: pre;
  overflow-x: auto;
  color: var(--text-muted);
  line-height: 1.5;
}

.diagram .diag-accent  { color: var(--accent); }
.diagram .diag-green   { color: var(--green); }
.diagram .diag-red     { color: var(--red); }
.diagram .diag-yellow  { color: var(--yellow); }
.diagram .diag-purple  { color: var(--purple); }

/* ── Timeline ───────────────────────────────────────────── */
.timeline { position: relative; padding-left: 2.5rem; }

.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--purple), var(--border));
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  animation: fadeInUp .5s ease both;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.1rem;
  top: .35rem;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px var(--accent);
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--accent);
  letter-spacing: .1em;
  margin-bottom: .35rem;
}

.timeline-item h3 {
  font-size: 1.05rem;
  margin-bottom: .4rem;
}

.timeline-item p {
  font-size: .9rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── Bug Cards ──────────────────────────────────────────── */
.bug-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: all .3s;
  animation: fadeInUp .5s ease both;
}

.bug-card:hover {
  transform: translateX(4px);
  box-shadow: -4px 0 20px rgba(248,81,73,.2);
}

.bug-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: .75rem;
}

.bug-id {
  font-family: var(--font-mono);
  font-size: .72rem;
  background: rgba(248,81,73,.15);
  color: var(--red);
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  margin-top: .1rem;
}

.bug-title { font-size: 1rem; font-weight: 700; color: var(--text); }

.bug-severity {
  margin-left: auto;
  font-size: .72rem;
  font-family: var(--font-mono);
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.sev-critical { background: rgba(248,81,73,.2); color: var(--red); border: 1px solid var(--red); }
.sev-high     { background: rgba(210,153,34,.2); color: var(--yellow); border: 1px solid var(--yellow); }
.sev-medium   { background: rgba(0,180,216,.2); color: var(--accent); border: 1px solid var(--accent); }
.sev-low      { background: rgba(63,185,80,.2); color: var(--green); border: 1px solid var(--green); }

/* ── Stats row ──────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  text-align: center;
  transition: all .3s;
}

.stat-box:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  line-height: 1;
  margin-bottom: .35rem;
}

.stat-label {
  font-size: .78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ── Footer ─────────────────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: 5rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copy {
  font-size: .85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: .85rem;
  color: var(--text-muted);
  transition: color .2s;
}

.footer-links a:hover { color: var(--accent); }

/* ── Animations ─────────────────────────────────────────── */
@keyframes fadeInUp {}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}

.hero            { animation: fadeIn .7s ease both; }
.hero h1         { animation: fadeInUp .6s .1s ease both; }
.hero .hero-sub  { animation: fadeInUp .6s .2s ease both; }
.hero-actions    { animation: fadeInUp .6s .3s ease both; }

/* Staggered cards */
.cards-grid .card:nth-child(1) { animation-delay: .05s; }
.cards-grid .card:nth-child(2) { animation-delay: .12s; }
.cards-grid .card:nth-child(3) { animation-delay: .19s; }
.cards-grid .card:nth-child(4) { animation-delay: .26s; }
.cards-grid .card:nth-child(5) { animation-delay: .33s; }
.cards-grid .card:nth-child(6) { animation-delay: .40s; }

/* ── Loading Animation (Fake compiler) ──────────────────── */
.loader-wrap {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: loader-exit .4s 2.2s ease forwards;
}

@keyframes loader-exit {
  to { opacity: 0; pointer-events: none; }
}

.loader-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  min-width: 380px;
  box-shadow: var(--shadow);
}

.loader-title {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.loader-bar-wrap {
  background: var(--code-bg);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  margin-bottom: .75rem;
}

.loader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  border-radius: 4px;
  animation: loading-fill 1.8s ease forwards .3s;
}

@keyframes loading-fill {
  0%   { width: 0%; }
  30%  { width: 35%; }
  60%  { width: 62%; }
  80%  { width: 79%; }
  95%  { width: 95%; }
  100% { width: 100%; }
}

.loader-steps {
  font-family: var(--font-mono);
  font-size: .75rem;
}

.loader-step {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .2rem 0;
  color: var(--text-dim);
  opacity: 0;
}

.loader-step.done { color: var(--green); }

.loader-step:nth-child(1) { animation: fadeIn .3s .4s ease forwards; }
.loader-step:nth-child(2) { animation: fadeIn .3s .7s ease forwards; }
.loader-step:nth-child(3) { animation: fadeIn .3s 1.0s ease forwards; }
.loader-step:nth-child(4) { animation: fadeIn .3s 1.35s ease forwards; }
.loader-step:nth-child(5) { animation: fadeIn .3s 1.7s ease forwards; }

/* ── Misc utility ───────────────────────────────────────── */
.text-accent  { color: var(--accent); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.text-yellow  { color: var(--yellow); }
.text-muted   { color: var(--text-muted); }
.text-mono    { font-family: var(--font-mono); }

.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: .5rem; }

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .72rem;
  padding: 2px 8px;
  border-radius: 4px;
  margin: 2px;
}

.tag-blue   { background: rgba(0,180,216,.15); color: var(--accent); border: 1px solid rgba(0,180,216,.3); }
.tag-green  { background: rgba(63,185,80,.15); color: var(--green);  border: 1px solid rgba(63,185,80,.3); }
.tag-purple { background: rgba(163,113,247,.15);color: var(--purple);border: 1px solid rgba(163,113,247,.3);}
.tag-yellow { background: rgba(210,153,34,.15); color: var(--yellow);border: 1px solid rgba(210,153,34,.3); }
.tag-red    { background: rgba(248,81,73,.15);  color: var(--red);   border: 1px solid rgba(248,81,73,.3); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  nav { padding: 0 1rem; }
  .nav-links a { padding: .35rem .55rem; font-size: .82rem; }
  .nav-badge { display: none; }
  .loader-box { min-width: 0; width: 90vw; }
  .footer-inner { flex-direction: column; text-align: center; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .nav-links { gap: 0; }
  .nav-links a { font-size: .78rem; padding: .3rem .4rem; }
}