/* Copyright © 2026 Ceskwang. All Rights Reserved. */
/* ════════════════════════════════════════════════════════════
   ceskwang.css — shared styles for every Ceskwang page
   Holds: colors, page background, math canvas, folder tabs.
   Page-specific layout stays inside each page's own <style>.
   ════════════════════════════════════════════════════════════ */

/* ── COLORS ── */
:root {
  --cream: #f2ede4;
  --cream-mid: #e8e2d8;
  --cream-dark: #d8d1c4;
  --ink: #1a1610;
  --ink-mid: #3d3830;
  --ink-light: #7a7268;
  --ink-faint: #7a7268;
  --accent: #c8832a;
  --shadow-soft: 0 2px 12px rgba(26, 22, 16, 0.10);
  --shadow-mid: 0 4px 24px rgba(26, 22, 16, 0.14);
  --shadow-lift: 0 8px 32px rgba(26, 22, 16, 0.18);
  --border: 1px solid rgba(26, 22, 16, 0.12);
  --border-strong: 1px solid rgba(26, 22, 16, 0.22);
}

/* ── RESET ── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;   /* stops the drifting canvas from causing sideways scroll */
}

body {
  width: 100%;
}

/* ── PAGE BACKGROUND (whitewash + amber glow + grain) ── */
body {
  background-color: #f7f4ef;
  background-image:
    radial-gradient(ellipse 80% 60% at 30% 40%, rgba(200, 131, 42, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 70% 60%, rgba(200, 131, 42, 0.03) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 60% 20%, rgba(200, 131, 42, 0.02) 0%, transparent 50%),
    radial-gradient(ellipse at center, transparent 40%, rgba(26, 22, 16, 0.08) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.07'/%3E%3C/svg%3E");
  background-size: 100% 100%;
}

/* ── MATH CANVAS (drawn by canvas.js) ── */
#bgCanvas {
  position: fixed;
  top: -30px;
  left: -30px;
  width: calc(100% + 60px);
  height: calc(100% + 60px);
  z-index: -1;
  opacity: 0;
  animation: canvasDrift 6s ease-out forwards;
  pointer-events: none;
}

@keyframes canvasDrift {
  0%   { opacity: 0;   transform: translateX(80px); }
  100% { opacity: 0.4; transform: translateX(0px); }
}

/* ── FOLDER TABS ──
   Usage:
   <nav class="folder-tabs">
     <a href="index.html" class="active">Home</a>
     <a href="ff1.html">Videos</a>
   </nav>
   Sits directly on top of an <hr class="tab-rule">.            */
.folder-tabs {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  position: relative;
  z-index: 2;
}

.folder-tabs a {
  display: inline-block;
  font-family: 'Courier Prime', monospace;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: #555;
  background: rgba(226, 221, 213, 0.92);
  border: 1px solid #aaa;
  border-bottom: none;
  padding: 6px 18px 7px;
  border-radius: 3px 3px 0 0;
  position: relative;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.15s, color 0.15s;
}

/* Hover — same lift as the media boxes */
.folder-tabs a:hover {
  background: rgba(236, 232, 223, 0.97);
  color: #222;
  transform: translateY(-3px);
  box-shadow: 0 -4px 14px rgba(26, 22, 16, 0.14);
}

/* Current page — highlighted, taller, opens into the page */
.folder-tabs a.active {
  background: #fbf9f5;
  color: var(--ink);
  font-weight: 700;
  border-color: #999;
  border-top: 2px solid var(--accent);
  padding: 10px 22px 9px;
  margin-bottom: -1px;               /* covers the rule so the tab "opens" into the page */
  border-bottom: 1px solid #fbf9f5;
  box-shadow: 0 -3px 10px rgba(26, 22, 16, 0.10);
  z-index: 3;
}

.folder-tabs a.active:hover {
  transform: none;                   /* already raised — stays attached to the page */
  box-shadow: 0 -4px 14px rgba(26, 22, 16, 0.16);
  background: #fbf9f5;
}

.tab-rule {
  border: none;
  border-top: 1px solid #aaa;
  margin: 0;
  position: relative;
  z-index: 1;
}

@media (max-width: 480px) {
  .folder-tabs a {
    padding: 5px 12px 6px;
    font-size: 11.5px;
  }
  .folder-tabs a.active {
    padding: 8px 15px 7px;
  }
}

/* ════════════════════════════════════════════════════════════
   PAGE LAYOUT — shared by every page (index + video pages)
   Centered logo header · tab row · main column + sidebar ·
   media boxes · cream sidebar boxes · footer · fade-in
   ════════════════════════════════════════════════════════════ */
/* Page side padding — shrinks smoothly from widescreen down to phone */
:root {
  --pad-l: clamp(16px, 6.5vw, 125px);
  --pad-r: clamp(16px, 5.2vw, 100px);
}

body {
  color: var(--ink);
  font-family: 'EB Garamond', serif;
  font-size: 17px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease 0.3s, transform 1.3s ease 0.3s;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── HEADER: centered logo ── */
header {
  position: relative;
  background: transparent;
  padding: 0;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-top {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 40px;
  margin-top: 16px;
  width: 100%;
}

.center-logo-link {
  position: relative;
  z-index: 2;
}

.logo-slot {
  min-width: 184px;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 6px rgba(26, 22, 16, 0.18));
  transition: filter 0.2s;
}

.logo-slot:hover {
  filter: drop-shadow(0 5px 12px rgba(26, 22, 16, 0.28));
}

.logo-slot img {
  max-height: 220px;
  width: auto;
}

/* ── FOLDER TABS ROW (tab styles live in ceskwang.css) ── */
.tab-row {
  margin-top: 12px;
  padding: 0 var(--pad-r) 0 var(--pad-l);
}

.tab-row + .tab-rule {
  margin: 0 var(--pad-r) 0 var(--pad-l);
}

/* ── PAGE LAYOUT: main column + sidebar ── */
.page-wrapper {
  width: 100%;
  padding: 4px var(--pad-r) 0 var(--pad-l);
  display: grid;
  grid-template-columns: minmax(0, 850px) minmax(240px, 350px);
  justify-content: space-between;
  column-gap: clamp(24px, 3vw, 40px);
  flex: 1;
  align-items: start;
}

/* ── SECTION LABELS ── */
.section-label {
  font-family: 'Courier Prime', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-bottom: 14px;
  padding-bottom: 8px;
  position: relative;
}

.section-label::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

/* ── MAIN COLUMN ── */
.left-col {
  display: flex;
  flex-direction: column;
  gap: 48px;
  min-width: 0;
  padding-top: 40px;
  padding-bottom: 48px;
}

.video-wrapper {
  background: var(--ink);
  border: var(--border);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: var(--shadow-mid);
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ── MEDIA ROWS (films + merch) ── */
.media-section:hover .section-label::after {
  transform: scaleX(1);
}

.media-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.media-box {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.55);
  border: var(--border);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.media-box:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.media-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--ink);
  overflow: hidden;
}

.media-row.merch .media-thumb {
  aspect-ratio: 1/1;
  background: var(--cream-dark);
}

.media-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-thumb .thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Courier Prime', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.25);
}

.media-row.merch .thumb-placeholder {
  color: var(--ink-light);
}

.media-caption {
  padding: 10px 12px 12px;
}

.media-title {
  font-family: 'EB Garamond', serif;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 3px;
}

.media-meta {
  font-family: 'Courier Prime', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-light);
}

/* ── SIDEBAR ── */
aside {
  display: flex;
  flex-direction: column;
  padding-top: 56px;
  min-width: 0;
  align-self: start;
}

.sidebar-block {
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.5);
  border: var(--border);
  border-radius: 2px;
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.sidebar-label {
  font-family: 'Courier Prime', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mid);
  padding-bottom: 8px;
  margin-bottom: 12px;
  position: relative;
}

.sidebar-label::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.sidebar-block:not(.about-block) .sidebar-label::after {
  transform: scaleX(1);
  transition: none;
}

.sidebar-block:hover .sidebar-label::after {
  transform: scaleX(1);
}

.about-text {
  font-size: 0.88rem;
  color: var(--ink-mid);
  line-height: 1.82;
}

.about-text p+p {
  margin-top: 10px;
}

.link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-list a {
  font-size: 0.88rem;
  color: var(--ink);
  text-decoration: none;
  position: relative;
}

.link-list a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--ink);
  transition: width 0.3s ease;
}

.link-list a:hover::after {
  width: 100%;
}

.link-list a:hover {
  color: var(--ink-mid);
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid rgba(26, 22, 16, 0.16);
  padding: 14px var(--pad-r) 14px var(--pad-l);
  font-family: 'Courier Prime', monospace;
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

footer a {
  color: var(--ink-faint);
  text-decoration: none;
  position: relative;
  transition: color 0.15s;
}

footer a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--ink-faint);
  transition: width 0.3s ease;
}

footer a:hover::after {
  width: 100%;
}

footer a:hover {
  color: var(--ink-light);
}

/* ── RESPONSIVE ── */

/* Tablets & narrow windows — sidebar drops below the main column */
@media (max-width: 820px) {
  .page-wrapper {
    grid-template-columns: minmax(0, 1fr);
  }

  .left-col {
    padding-bottom: 24px;
  }

  aside {
    padding-top: 0;
    padding-bottom: 32px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
  }

  .sidebar-block {
    margin-bottom: 0;
  }
}

/* Phones */
@media (max-width: 520px) {
  header {
    margin-top: 10px;
  }

  .header-top {
    padding: 8px 12px;
    margin-top: 8px;
  }

  .logo-slot {
    min-width: 120px;
    min-height: 70px;
  }

  .logo-slot img {
    max-height: 120px;
  }

  .tab-row {
    margin-top: 20px;
  }

  .left-col {
    padding-top: 24px;
    gap: 36px;
  }

  .media-row {
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}

/* ── FEATURED FILM INFO (video pages) ── */
.feature {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-title {
  font-family: 'EB Garamond', serif;
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 4px;
}

.feature-meta {
  font-family: 'Courier Prime', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 10px;
}

.feature-desc {
  font-size: 0.98rem;
  color: var(--ink-mid);
  line-height: 1.75;
}

/* Film currently playing, shown in the Films row */
.media-box.current {
  border: 1px solid var(--accent);
}

.media-box .now-playing {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  font-family: 'Courier Prime', monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
  background: rgba(26, 22, 16, 0.78);
  border-left: 2px solid var(--accent);
  padding: 4px 8px;
}

/* ════════════════════════════════════════════════════════════
   SIDEBAR — one cream shell: About · MathApp · Runner Game · Links
   (plus the hidden email signup styles, for when it returns)
   ════════════════════════════════════════════════════════════ */
/* ── SIDEBAR: floating Play boxes (MathApp, Runner) ── */
.play-box {
  display: block;
  text-decoration: none;
  color: var(--ink);
  padding: 6px 4px 0;
  margin-bottom: 22px;
  transition: transform 0.18s ease;
}

.play-box:hover {
  transform: translateY(-3px);
}

.play-box .sidebar-label {
  margin-bottom: 12px;
}

.play-box:hover .sidebar-label::after {
  transform: scaleX(1);
}

.play-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  border-radius: 2px;
  background: var(--ink);
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.18s ease;
}

.play-box:hover .play-thumb {
  box-shadow: var(--shadow-lift);
}

.play-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.play-desc {
  font-size: 0.88rem;
  color: var(--ink-mid);
  line-height: 1.6;
  margin-top: 10px;
}

.play-open {
  display: inline-block;
  margin-top: 6px;
  font-family: 'Courier Prime', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  position: relative;
}

.play-open::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--ink);
  transition: width 0.3s ease;
}

.play-box:hover .play-open::after {
  width: 100%;
}

/* ── SIDEBAR: cream shell holding the whole sidebar (no hover effects of its own) ── */
.sidebar-shell {
  background: rgba(242, 237, 228, 0.75);
  border: var(--border);
  border-radius: 2px;
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.sidebar-shell .sidebar-block:last-child {
  margin-bottom: 0;
}

/* About no longer clicks anywhere, so its underline is static like Links */
.about-block .sidebar-label::after {
  transform: scaleX(1);
  transition: none;
}

/* Keep space between the sidebar and the footer on desktop */
@media (min-width: 821px) {
  aside { padding-bottom: 48px; }
}

@media (max-width: 820px) {
  .sidebar-shell .sidebar-block { margin-bottom: 14px; }
}

/* Email signup — box is hidden in the HTML for now; styles kept for when it returns */
.email-signup p {
  font-size: 0.85rem;
  color: var(--ink-mid);
  line-height: 1.75;
  margin-bottom: 10px;
}

.email-form {
  display: flex;
  gap: 6px;
}

.email-input {
  flex: 1;
  font-family: 'Courier Prime', monospace;
  font-size: 11px;
  padding: 7px 10px;
  background: var(--cream);
  border: var(--border-strong);
  border-radius: 1px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
  box-shadow: inset 0 1px 4px rgba(26, 22, 16, 0.08);
  min-width: 0;
}

.email-input:focus {
  border-color: var(--ink-light);
}

.email-input::placeholder {
  color: var(--ink-faint);
}

.email-btn {
  font-family: 'Courier Prime', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 7px 12px;
  background: var(--ink);
  color: var(--cream);
  border: none;
  border-radius: 1px;
  cursor: pointer;
  position: relative;
  overflow: visible;
  white-space: nowrap;
}
