/* ================================================================
   Art Deco Editorial — Luxury Publishing House Design System
   Tone: refined, authoritative, architectural, unforgettable
   Fonts: Playfair Display (headings) + Lora (body)
   Palette: deep navy + warm gold + cream paper
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600&family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=DM+Mono:wght@300;400;500&display=swap');

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

:root {
  /* === Palette — Deep Navy + Warm Gold === */
  --ink:           #0f1923;
  --ink-rich:      #1a2744;
  --ink-soft:      #2c3e5c;
  --ink-muted:     #5a6e84;

  --gold:          #c9a96e;
  --gold-dim:      #a68a52;
  --gold-bright:   #d4b87a;
  --gold-pale:     #f5ecd7;
  --gold-subtle:   rgba(201,169,110,0.12);

  --paper:         #faf7f0;
  --paper-warm:    #f5f0e6;
  --surface:       #ffffff;
  --surface-warm:  #fdfbf7;

  --border:        #e8e2d5;
  --border-light:  #f0ebe0;
  --border-faint:  #f5f1e8;

  /* Semantic */
  --success:       #3d7055;
  --danger:        #b53b3b;
  --warning:       #c47a30;

  /* Typography */
  --font-display:  'Playfair Display', 'Georgia', 'SimSun', 'Songti SC', serif;
  --font-body:     'Lora', 'Georgia', 'Noto Serif SC', 'SimSun', serif;
  --font-mono:     'DM Mono', 'SF Mono', 'Cascadia Code', 'Consolas', monospace;

  /* Spacing */
  --space-xs:  6px;
  --space-sm:  12px;
  --space-md:  20px;
  --space-lg:  32px;
  --space-xl:  48px;
  --space-2xl: 64px;
  --space-3xl: 88px;
  --space-4xl: 120px;

  /* Radii */
  --radius-sm: 1px;
  --radius-md: 2px;
  --radius-lg: 4px;

  /* Rules */
  --rule-hairline: 0.5px solid var(--border);
  --rule-thin:     1px solid var(--border-light);
  --rule-gold:     1.5px solid var(--gold-dim);
}

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.8;
  color: var(--ink);
  background: var(--paper);
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ================================================================
   ATMOSPHERIC BACKGROUND — layered paper texture + subtle grain
   ================================================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  background:
    url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='grain' width='60' height='60' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='30' cy='30' r='0.35' fill='%230f1923'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='60' height='60' fill='url(%23grain)'/%3E%3C/svg%3E");
}

/* Top-to-bottom atmospheric gradient */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 40vh;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(15,25,35,0.03) 0%,
    transparent 100%
  );
}

/* Page content above background layers */
body > * { position: relative; z-index: 1; }

::selection { background: var(--gold-dim); color: #fff; }

/* ================================================================
   TYPOGRAPHY
   ================================================================ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
}
h1 { font-size: 2.8rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.25rem; }

a {
  color: var(--ink-rich);
  text-decoration: none;
  transition: color 0.25s;
  border-bottom: 1px solid transparent;
}
a:hover {
  color: var(--gold-dim);
  border-bottom-color: var(--gold);
}

/* ================================================================
   CONTAINERS
   ================================================================ */
.container       { max-width: 860px;  margin: 0 auto; padding: 0 var(--space-lg); }
.container-wide  { max-width: 1080px; margin: 0 auto; padding: 0 var(--space-lg); }
.container-narrow{ max-width: 620px;  margin: 0 auto; padding: 0 var(--space-lg); }

/* ================================================================
   GATE PAGE — commanding entrance with art-deco gravitas
   ================================================================ */
.gate-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-lg);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(201,169,110,0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(15,25,35,0.03) 0%, transparent 60%),
    var(--paper);
}

.gate-card {
  background: var(--surface);
  padding: var(--space-4xl) var(--space-3xl);
  width: 100%;
  max-width: 440px;
  text-align: center;
  position: relative;
  box-shadow:
    0 1px 0 0 var(--border-light),
    0 2px 0 0 var(--surface),
    0 4px 0 0 var(--border-light),
    0 6px 0 0 var(--surface),
    0 8px 0 0 var(--border-light),
    0 10px 0 0 var(--surface),
    0 12px 24px -8px rgba(15,25,35,0.12);
  animation: gateRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes gateRise {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Art-deco corner accents */
.gate-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 32px;
  height: 32px;
  border-top: 2px solid var(--gold-dim);
  border-left: 2px solid var(--gold-dim);
}
.gate-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 32px;
  height: 32px;
  border-top: 2px solid var(--gold-dim);
  border-right: 2px solid var(--gold-dim);
}

/* Gold monogram */
.gate-mark {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 700;
  font-style: italic;
  color: var(--gold-dim);
  margin-bottom: var(--space-md);
  line-height: 1;
  letter-spacing: -0.03em;
}

.gate-card h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: var(--space-xs);
  font-family: var(--font-display);
}

.gate-card .subtitle {
  font-size: 0.85rem;
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-style: italic;
  margin-bottom: var(--space-xl);
}

/* Decorative gold rule */
.gate-card .rule {
  display: block;
  width: 48px;
  height: 0;
  border: none;
  border-top: 2px solid var(--gold-dim);
  margin: 0 auto var(--space-2xl);
}

.code-group {
  position: relative;
  margin-bottom: var(--space-lg);
}

.code-input {
  width: 100%;
  padding: 18px 0 14px;
  font-size: 2.4rem;
  font-family: var(--font-mono);
  font-weight: 300;
  text-align: center;
  letter-spacing: 0.6em;
  text-indent: 0.6em;
  border: none;
  border-bottom: 2px solid var(--border);
  background: transparent;
  outline: none;
  color: var(--ink);
  transition: border-color 0.4s;
  caret-color: var(--gold-dim);
  border-radius: 0;
}
.code-input:focus {
  border-bottom-color: var(--gold-dim);
}
.code-input::placeholder {
  letter-spacing: 0;
  text-indent: 0;
  font-size: 0.75rem;
  font-family: var(--font-body);
  color: var(--ink-muted);
  font-style: italic;
  opacity: 0.5;
}

/* Enter button — gold accent */
.btn {
  display: inline-block;
  padding: 15px 48px;
  font-size: 0.78rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  border-radius: 0;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
}
.btn:hover::after { transform: translateY(0); }
.btn:hover {
  color: var(--ink);
  border-color: var(--gold-dim);
}
.btn span { position: relative; z-index: 1; }
.btn:active { transform: scale(0.98); }
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.gate-error {
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: var(--space-md);
  min-height: 24px;
  font-family: var(--font-body);
  font-style: italic;
}

.lock-timer {
  font-size: 0.78rem;
  color: var(--warning);
  margin-top: var(--space-sm);
  font-family: var(--font-mono);
  padding: var(--space-xs) var(--space-md);
  border: 1px solid rgba(196,122,48,0.2);
  background: rgba(196,122,48,0.04);
  display: inline-block;
}

.gate-footer {
  margin-top: var(--space-3xl);
  font-size: 0.7rem;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-display);
}

/* ================================================================
   PORTFOLIO PAGE — left-right fullscreen layout
   ================================================================ */

.portfolio-body {
  overflow: hidden;
  height: 100vh;
  background: var(--paper);
}

/* === Main Layout Grid === */
.folio-layout {
  display: flex;
  height: 100vh;
  width: 100%;
  animation: fadeSlide 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === Left Sidebar — Personal Info === */
.folio-sidebar {
  width: 320px;
  min-width: 320px;
  height: 100vh;
  background: var(--surface);
  border-right: var(--rule-hairline);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-4xl) var(--space-2xl) var(--space-2xl);
  position: relative;
  overflow-y: auto;
  z-index: 2;
}

/* Subtle gold accent line on sidebar inner edge */
.folio-sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, var(--gold-dim), transparent 60%);
  opacity: 0.3;
}

/* === Circular Avatar === */
.folio-avatar-wrap {
  margin-bottom: var(--space-xl);
}

.folio-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-dim);
  padding: 3px;
  background: var(--surface);
  box-shadow: 0 4px 20px rgba(15,25,35,0.08);
  transition: transform 0.4s, box-shadow 0.4s;
}
.folio-avatar:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 30px rgba(15,25,35,0.12);
}

.folio-avatar-placeholder {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ink), var(--ink-rich));
  color: var(--gold-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 3rem;
  font-style: italic;
  border: 2px solid var(--gold-dim);
  padding: 3px;
  background-clip: content-box;
  box-shadow: 0 4px 20px rgba(15,25,35,0.08);
}

/* === Name & Title === */
.folio-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--ink);
  text-align: center;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: var(--space-xs);
}

.folio-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--gold-dim);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: var(--space-xl);
}

/* Gold divider */
.folio-divider {
  width: 40px;
  height: 2px;
  background: var(--gold-dim);
  margin-bottom: var(--space-xl);
  opacity: 0.6;
}

/* Bio */
.folio-bio {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--ink-muted);
  line-height: 1.8;
  text-align: center;
  margin-bottom: var(--space-2xl);
  font-style: italic;
  max-width: 240px;
}

/* Contacts */
.folio-contacts {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  font-size: 0.72rem;
  color: var(--ink-muted);
  font-family: var(--font-body);
  text-align: center;
  margin-top: auto;
  padding-top: var(--space-2xl);
  border-top: var(--rule-hairline);
  width: 100%;
}

.folio-footer {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: var(--space-md);
  opacity: 0.5;
}

/* === Right Panel — Scrollable Works === */
.folio-main {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-4xl) var(--space-3xl);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.folio-section {
  animation: fadeSlide 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.folio-section + .folio-section {
  margin-top: var(--space-4xl);
  padding-top: var(--space-4xl);
  border-top: var(--rule-hairline);
}
.folio-section:nth-child(2) { animation-delay: 0.1s; }
.folio-section:nth-child(3) { animation-delay: 0.2s; }

.folio-section-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: var(--space-2xl);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}
.folio-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-dim), transparent);
  opacity: 0.3;
}

/* === Article Cards — compact 2-column grid === */
.article-stack {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.article-card {
  display: block;
  padding: var(--space-lg);
  background: var(--surface);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  border: var(--rule-hairline);
  cursor: pointer;
}
.article-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 24px rgba(15,25,35,0.07),
    0 0 0 1px var(--gold-dim);
  text-decoration: none;
  border-color: var(--gold);
}
.article-card .article-inner {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

/* Thumbnail column — compact */
.article-card .thumb-col {
  flex-shrink: 0;
  width: 100px;
  height: 68px;
  overflow: hidden;
  background: var(--border-faint);
  position: relative;
}
.article-card .thumb-col img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.article-card:hover .thumb-col img {
  transform: scale(1.05);
}

/* Text column */
.article-card .text-col { flex: 1; min-width: 0; }

.article-card .article-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--space-xs);
  line-height: 1.3;
  transition: color 0.3s;
  /* Clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card:hover .article-title { color: var(--gold-dim); }

.article-card .article-meta {
  font-size: 0.68rem;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: var(--font-display);
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  flex-wrap: wrap;
}
.article-card .article-meta span + span::before {
  content: '/';
  margin-right: var(--space-sm);
  color: var(--gold);
  opacity: 0.6;
}

.article-card .article-desc {
  font-size: 0.78rem;
  color: var(--ink-muted);
  line-height: 1.5;
  font-family: var(--font-body);
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card.no-thumb .article-inner { display: block; }

/* === Video Grid === */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: var(--space-xl);
}

.video-card {
  background: var(--surface);
  border: var(--rule-hairline);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(15,25,35,0.1);
  border-color: var(--gold);
}

.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: var(--ink);
  overflow: hidden;
}
.video-embed iframe,
.video-embed video {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.video-embed video {
  object-fit: contain;
  cursor: pointer;
  background: #000;
}

/* Play overlay */
.video-embed .play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15,25,35,0.15);
  transition: background 0.4s;
}
.video-embed .play-overlay::after {
  content: '';
  width: 64px;
  height: 64px;
  border: 2px solid var(--gold-pale);
  background: rgba(15,25,35,0.35);
  transition: all 0.35s;
}
.video-for-parent { pointer-events: none; }
.video-card:hover .play-overlay {
  background: rgba(15,25,35,0.28);
}
.video-card:hover .play-overlay::after {
  background: var(--gold-dim);
  border-color: var(--gold-dim);
  transform: scale(1.06);
}

.video-info {
  padding: var(--space-lg) var(--space-xl);
}
.video-info .video-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--space-xs);
}
.video-info .video-meta {
  font-size: 0.7rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-display);
}

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: var(--space-4xl) var(--space-lg);
  color: var(--ink-muted);
  font-size: 0.88rem;
  font-style: italic;
  border: 1px dashed var(--border);
  background: var(--surface-warm);
}

/* ================================================================
   ADMIN PAGES — restrained authority
   ================================================================ */
.admin-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-lg);
  background: var(--paper);
}

.admin-login-card {
  background: var(--surface);
  padding: var(--space-3xl) var(--space-2xl);
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow:
    0 1px 0 0 var(--border-light),
    0 2px 0 0 var(--surface),
    0 4px 0 0 var(--border-light),
    0 6px 0 0 var(--surface),
    0 8px 24px -8px rgba(15,25,35,0.1);
  animation: gateRise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.admin-login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 28px;
  height: 28px;
  border-top: 2px solid var(--gold-dim);
  border-left: 2px solid var(--gold-dim);
}
.admin-login-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 28px;
  height: 28px;
  border-top: 2px solid var(--gold-dim);
  border-right: 2px solid var(--gold-dim);
}

.admin-login-card h1 {
  font-size: 1.15rem;
  text-align: center;
  margin-bottom: var(--space-2xl);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

/* ================================================================
   FORM ELEMENTS — refined editorial inputs
   ================================================================ */
.form-group { margin-bottom: var(--space-lg); }

.form-group label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--space-sm);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 13px 18px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  border: 1px solid var(--border);
  background: var(--surface-warm);
  color: var(--ink);
  outline: none;
  transition: all 0.3s;
  border-radius: 0;
  line-height: 1.6;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--gold-dim);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--gold-subtle);
}
.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-error {
  font-size: 0.78rem;
  color: var(--danger);
  margin-bottom: var(--space-md);
  min-height: 20px;
  font-style: italic;
}

/* ================================================================
   DASHBOARD LAYOUT
   ================================================================ */
.dashboard {
  display: flex;
  min-height: 100vh;
  background: var(--paper);
}

.sidebar {
  width: 260px;
  background: var(--surface);
  border-right: var(--rule-hairline);
  padding: var(--space-2xl) 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 10;
}

.sidebar-mark {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  font-style: italic;
  color: var(--gold-dim);
  padding: 0 var(--space-xl);
  margin-bottom: var(--space-xs);
  line-height: 1.2;
}

.sidebar-title {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 0 var(--space-xl) var(--space-lg);
  border-bottom: 1px solid var(--border-faint);
  margin-bottom: var(--space-md);
}

.sidebar-nav { padding: 0 var(--space-sm); }

.sidebar-nav a {
  display: block;
  padding: 12px var(--space-lg);
  font-size: 0.8rem;
  font-family: var(--font-display);
  color: var(--ink-muted);
  transition: all 0.2s;
  letter-spacing: 0.03em;
  border-left: 2px solid transparent;
  font-weight: 500;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--ink);
  background: var(--gold-subtle);
  border-left-color: var(--gold-dim);
  text-decoration: none;
}
.sidebar-nav a.active {
  color: var(--ink-rich);
  font-weight: 600;
}
.sidebar-nav a.logout-link {
  color: var(--danger);
  margin-top: var(--space-xl);
  opacity: 0.7;
}
.sidebar-nav a.logout-link:hover { opacity: 1; }

.main-content {
  margin-left: 260px;
  flex: 1;
  padding: var(--space-2xl) var(--space-3xl);
  background: var(--paper);
  min-height: 100vh;
}

.main-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: var(--space-xl);
  color: var(--ink);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-light);
  position: relative;
}
.main-content h2::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 60px;
  height: 2px;
  background: var(--gold-dim);
}

.dash-section {
  display: none;
  animation: fadeSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.dash-section.active { display: block; }

/* ================================================================
   ADMIN BUTTONS
   ================================================================ */
.btn-prime {
  display: inline-block;
  padding: 12px 32px;
  font-size: 0.72rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 0;
}
.btn-prime:hover {
  background: transparent;
  color: var(--ink);
  border-color: var(--gold-dim);
}
.btn-prime:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-add {
  padding: 10px 28px;
  font-size: 0.72rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: var(--space-lg);
  border-radius: 0;
}
.btn-add:hover {
  border-color: var(--gold-dim);
  color: var(--gold-dim);
  background: var(--gold-pale);
}

/* ================================================================
   ADMIN TABLE
   ================================================================ */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.admin-table thead { border-bottom: 2px solid var(--ink); }
.admin-table th {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-family: var(--font-display);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--surface-warm);
}
.admin-table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-faint);
  color: var(--ink);
  vertical-align: middle;
}
.admin-table tbody tr:hover td { background: var(--gold-subtle); }
.admin-table tbody tr:last-child td { border-bottom-color: var(--border-light); }

.btn-row {
  padding: 7px 18px;
  font-size: 0.68rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s;
  margin-right: var(--space-sm);
  border-radius: 0;
}
.btn-row:hover {
  border-color: var(--gold-dim);
  color: var(--gold-dim);
  background: var(--gold-pale);
}
.btn-row.danger {
  border-color: rgba(181,59,59,0.25);
  color: var(--danger);
}
.btn-row.danger:hover {
  background: rgba(181,59,59,0.04);
  border-color: var(--danger);
}

/* ================================================================
   MODAL
   ================================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,25,35,0.6);
  backdrop-filter: blur(6px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }

.modal {
  background: var(--surface);
  padding: var(--space-2xl);
  width: 100%;
  max-width: 580px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(15,25,35,0.18);
  position: relative;
  animation: gateRise 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 24px;
  height: 24px;
  border-top: 2px solid var(--gold-dim);
  border-left: 2px solid var(--gold-dim);
}
.modal::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 24px;
  height: 24px;
  border-top: 2px solid var(--gold-dim);
  border-right: 2px solid var(--gold-dim);
}

.modal h3 {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-light);
  color: var(--ink);
}

.modal-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-faint);
}

.btn-cancel {
  padding: 10px 26px;
  font-size: 0.7rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.25s;
  border-radius: 0;
}
.btn-cancel:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-save {
  padding: 10px 30px;
  font-size: 0.7rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 0;
}
.btn-save:hover {
  background: transparent;
  color: var(--ink);
  border-color: var(--gold-dim);
}

/* ================================================================
   THUMBNAIL PREVIEW
   ================================================================ */
.thumb-preview-area {
  background: var(--surface-warm);
  border: 1px dashed var(--gold-dim);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
}
.thumb-preview-inner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.thumb-preview-area img {
  max-width: 200px;
  max-height: 130px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(15,25,35,0.06);
}
.thumb-placeholder {
  width: 180px;
  height: 90px;
  background: repeating-linear-gradient(
    -45deg,
    var(--border-faint),
    var(--border-faint) 4px,
    transparent 4px,
    transparent 8px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--ink-muted);
  font-style: italic;
  text-align: center;
  padding: var(--space-sm);
}
.thumb-info { flex: 1; min-width: 120px; }
.thumb-status-ok {
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-display);
}
.thumb-status-wait {
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-style: italic;
}
.thumb-status-err {
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 500;
}

.thumb-loading {
  display: flex;
  gap: 5px;
  padding: 8px;
}
.thumb-loading span {
  width: 8px; height: 8px;
  background: var(--gold-dim);
  animation: bounce 1.2s ease-in-out infinite;
}
.thumb-loading span:nth-child(2) { animation-delay: 0.15s; }
.thumb-loading span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1; }
}

.thumb-error {
  padding: var(--space-sm) var(--space-md);
  background: rgba(181,59,59,0.05);
  font-size: 0.72rem;
  color: var(--danger);
  font-style: italic;
}

.btn-fetch-thumb {
  padding: 7px 20px;
  font-size: 0.68rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: all 0.25s;
  border-radius: 0;
  white-space: nowrap;
}
.btn-fetch-thumb:hover:not(:disabled) {
  background: transparent;
  color: var(--ink);
  border-color: var(--gold-dim);
}
.btn-fetch-thumb:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* ================================================================
   FILE UPLOAD
   ================================================================ */
.upload-area {
  border: 2px dashed var(--gold-dim);
  padding: var(--space-2xl);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: var(--gold-subtle);
}
.upload-area:hover {
  border-color: var(--gold);
  background: rgba(201,169,110,0.1);
}
.upload-area .upload-hint {
  font-size: 0.8rem;
  color: var(--gold-dim);
  font-family: var(--font-display);
  font-weight: 500;
}
.upload-area input[type="file"] { display: none; }

.upload-status {
  font-size: 0.72rem;
  color: var(--gold-dim);
  margin-top: var(--space-sm);
  font-weight: 600;
  padding: var(--space-xs) var(--space-sm);
  background: var(--gold-pale);
  display: inline-block;
}
.upload-current-file {
  font-size: 0.72rem;
  color: var(--ink-muted);
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--surface-warm);
  word-break: break-all;
  font-style: italic;
}

/* ================================================================
   TOGGLE GROUP (video type)
   ================================================================ */
.toggle-group {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.toggle-btn {
  flex: 1;
  padding: 11px 18px;
  font-size: 0.68rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.toggle-btn:first-child { border-right: 1px solid var(--border); }
.toggle-btn.active {
  background: var(--ink);
  color: var(--paper);
}
.toggle-btn:hover:not(.active) {
  background: var(--surface-warm);
  color: var(--ink);
}

/* ================================================================
   CODE GENERATOR
   ================================================================ */
.code-display {
  background: var(--surface);
  border: 1px solid var(--gold-dim);
  padding: var(--space-3xl);
  text-align: center;
  margin: var(--space-xl) 0;
  position: relative;
}
.code-display .big-code {
  font-family: var(--font-mono);
  font-size: 3.8rem;
  font-weight: 400;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: var(--ink);
  cursor: pointer;
  user-select: all;
  transition: all 0.3s;
  padding: var(--space-md);
}
.code-display .big-code:hover {
  color: var(--gold-dim);
  background: var(--gold-subtle);
}
.code-display .copy-hint {
  font-size: 0.68rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: var(--space-md);
  font-family: var(--font-display);
}

/* ================================================================
   TOAST
   ================================================================ */
.toast {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: var(--space-sm) var(--space-xl);
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 30px rgba(15,25,35,0.18);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.info    { background: var(--ink-rich); }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
  .container, .container-narrow, .container-wide { padding: 0 var(--space-md); }

  .gate-card {
    padding: var(--space-3xl) var(--space-xl);
  }
  .gate-mark { font-size: 40px; }
  .gate-card h1 { font-size: 1.2rem; }
  .code-input { font-size: 1.8rem; }

  .masthead { padding: var(--space-2xl) 0; }
  .masthead-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-xl);
  }
  .masthead-text h1 { font-size: 1.8rem; }
  .masthead-text h1::after {
    margin: var(--space-sm) auto 0;
  }
  .masthead-text .bio { max-width: 100%; }
  .masthead-photo, .masthead-photo-placeholder { width: 100px; height: 100px; }
  .masthead-contacts { justify-content: center; }

  /* Portfolio left-right → stacked on mobile */
  .folio-layout { flex-direction: column; }
  .folio-sidebar {
    width: 100%;
    min-width: unset;
    height: auto;
    padding: var(--space-2xl) var(--space-lg);
    border-right: none;
    border-bottom: var(--rule-hairline);
  }
  .folio-sidebar::after { display: none; }
  .folio-avatar, .folio-avatar-placeholder { width: 100px; height: 100px; }
  .folio-name { font-size: 1.3rem; }
  .folio-bio { max-width: 100%; }
  .folio-contacts { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: var(--space-md); padding-top: var(--space-lg); }
  .folio-footer { display: none; }
  .folio-main {
    height: auto;
    overflow-y: visible;
    padding: var(--space-xl) var(--space-lg);
  }
  .folio-section + .folio-section {
    margin-top: var(--space-2xl);
    padding-top: var(--space-2xl);
  }

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

  .article-stack { grid-template-columns: 1fr; }
  .article-card { padding: var(--space-md); }
  .article-card:hover { transform: none; }
  .article-card .thumb-col { width: 80px; height: 56px; }
  .article-card .article-inner { gap: var(--space-md); }
  .article-card .article-title { font-size: 0.9rem; }

  .dashboard { flex-direction: column; }
  .sidebar {
    position: static;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-md) 0;
  }
  .sidebar-nav {
    display: flex;
    gap: 2px;
    padding: 0 var(--space-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar-nav a {
    white-space: nowrap;
    padding: 10px 14px;
    border-left: none;
    border-bottom: 2px solid transparent;
    font-size: 0.74rem;
  }
  .sidebar-nav a.active {
    border-left-color: transparent;
    border-bottom-color: var(--gold-dim);
    background: transparent;
  }
  .sidebar-title {
    padding-bottom: var(--space-sm);
    margin-bottom: var(--space-sm);
  }
  .main-content {
    margin-left: 0;
    padding: var(--space-lg) var(--space-md);
  }

  .modal {
    margin: 0 var(--space-sm);
    padding: var(--space-lg);
    max-height: 90vh;
  }

  .code-display { padding: var(--space-xl); }
  .code-display .big-code { font-size: 2.5rem; }

  .thumb-preview-area img { max-width: 150px; max-height: 100px; }
  .thumb-placeholder { width: 140px; height: 70px; }

  .gate-card::before, .gate-card::after,
  .modal::before, .modal::after,
  .admin-login-card::before, .admin-login-card::after {
    width: 20px; height: 20px;
  }
}
