/* ukhona.css - Dedicated styles for ukhona.html */

:root {
  --glass:      rgba(15, 28, 46, 0.72);
  --border-hi:  rgba(59, 130, 246, 0.38);
  --blue-faint: rgba(59, 130, 246, 0.06);
  --text-hi:    #e8f0ff;
  --text-dim:   rgba(255,255,255,0.65);
  --blue:       #3b82f6;
  --mono:       'SF Mono', 'Fira Mono', 'Consolas', monospace;
  --r:          14px;
  --r-lg:       20px;
}

/* Divider */
.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-hi), transparent);
  margin: 0 0 48px;
}

/* Islands Container */
.islands-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* Island Card */
.island {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 40px 44px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  opacity: 0;
  transform: translateY(18px);
  animation: fadeUp 0.55s ease forwards;
}

.island:hover {
  border-color: var(--border-hi);
  box-shadow: 0 0 40px rgba(59,130,246,0.07), 0 2px 32px rgba(0,0,0,0.4);
}

.island::before {
  content: '';
  position: absolute;
  left: 0; top: 16%; bottom: 16%;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--blue), transparent);
  border-radius: 2px;
  opacity: 0.5;
}
.island:hover::before { opacity: 1; }

.island::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(59,130,246,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.island--center { text-align: center; }
.island--center::before { display: none; }
.island--center p { margin-left: auto; margin-right: auto; }

/* Typography Inside Islands */
.island-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
  opacity: 0.75;
  margin-bottom: 0.6rem;
  display: block;
}

.island-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-hi);
  line-height: 1.2;
  margin-bottom: 0.35rem;
}

.island-subtitle {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin-bottom: 1.6rem;
}

.island p {
  font-size: 0.955rem;
  color: var(--text);
  line-height: 1.76;
  max-width: 72ch;
  margin-bottom: 0.9rem;
}

.island strong { color: var(--text-hi); font-weight: 600; }

.island h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-hi);
  margin: 2rem 0 0.5rem;
  letter-spacing: -0.01em;
}

/* Lists, Blockquotes, Math, Videos, Figures */
.island ul, .island ol {
  padding-left: 1.4em;
  margin: 0.6rem 0 1rem;
  font-size: 0.955rem;
  line-height: 1.72;
}

.island blockquote {
  border-left: 2px solid var(--blue);
  background: rgba(59,130,246,0.05);
  border-radius: 0 8px 8px 0;
  margin: 1.2rem 0;
  padding: 0.9rem 1.2rem;
  font-style: italic;
  color: var(--text-hi);
}

.math-block {
  background: rgba(7, 13, 20, 0.7);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 28px;
  margin: 1.4rem 0;
  text-align: center;
  font-size: 1.05rem;
  overflow-x: auto;
}

.video-wrap {
  margin: 1.6rem 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.fig-card {
  background: rgba(7, 13, 20, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 1.6rem 0;
}

.fig-grid {
  display: grid;
  gap: 16px;
  margin: 1.6rem 0;
}
.fig-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.fig-grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }

.stat-row {
  display: flex;
  gap: 12px;
  margin: 1.4rem 0 0.4rem;
  flex-wrap: wrap;
}

.stat {
  flex: 1 1 100px;
  background: rgba(7, 13, 20, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 16px;
}

.concept-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 1.2rem 0;
}

.concept-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 40px;
  border: 1px solid var(--border-hi);
  background: var(--blue-faint);
  color: var(--blue);
}

/* Responsive + Animation */
@media (max-width: 600px) {
  .island { padding: 28px 22px; }
  .island-title { font-size: 1.3rem; }
}

.island:nth-child(1)  { animation-delay: 0.08s; }
.island:nth-child(2)  { animation-delay: 0.16s; }
.island:nth-child(3)  { animation-delay: 0.24s; }
/* ... continue up to nth-child(10) */

@keyframes fadeUp {
  to { opacity: 1; transform: none; }
}

/* ───────────────────────────────────────────
   FIXED IMAGE STYLES (no more distortion)
─────────────────────────────────────────── */

.fig-card {
  background: rgba(7, 13, 20, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 1.6rem 0;
  position: relative;
}

.fig-card img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;        /* Prevents stretching */
  max-height: 420px;          /* Optional safety cap — adjust if needed */
  background: #0a0a0f;        /* Fallback color while loading */
}

.fig-grid {
  display: grid;
  gap: 16px;
  margin: 1.6rem 0;
}

.fig-grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.fig-grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}

/* Optional: nicer captions */
.fig-card figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
  font-style: italic;
  font-family: var(--mono);
  letter-spacing: 0.03em;
  border-top: 1px solid var(--border);
}