@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@300;400;500;600;700&family=Russo+One&display=swap');

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 17px;
  background: #1f1726;
  color: #e8ddf5;
}

body {
  font-family: 'Chakra Petch', 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.7;
  background: #1f1726;
  color: #e8ddf5;
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: #b07fff; text-decoration: none; transition: color 0.25s; }
a:hover, a:focus-visible { color: #d8b4fe; }
ul, ol { list-style: none; }
address { font-style: normal; }

:focus-visible {
  outline: 2px solid #56228b;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===== CSS Variables ===== */
:root {
  --primary: #56228b;
  --secondary: #8b4513;
  --ink: #1f1726;
  --ink-mid: #2e1f3e;
  --ink-light: #3d2a50;
  --text: #e8ddf5;
  --text-muted: #b09cc8;
  --accent: #c084fc;
  --gold: #d4a055;
  --nav-w: 220px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-soft: 0 8px 32px rgba(86,34,139,0.22);
  --shadow-card: 0 4px 20px rgba(0,0,0,0.4);
}

/* ===== Layout Shell ===== */
.site-shell {
  display: flex;
  min-height: 100vh;
}

.site-body {
  flex: 1;
  margin-left: var(--nav-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== Side Navigation ===== */
.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  background: linear-gradient(180deg, #2a1240 0%, #1f1726 60%, #1a0f1a 100%);
  border-right: 1px solid rgba(86,34,139,0.35);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
}

.side-nav-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 0 20px;
  border-bottom: 1px solid rgba(86,34,139,0.3);
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.brand-text-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #56228b, #8b4513);
  color: #fff;
  font-family: 'Russo One', sans-serif;
  font-size: 1.4rem;
  font-weight: 400;
  box-shadow: 0 4px 16px rgba(86,34,139,0.45);
  text-decoration: none;
}

.side-nav ol {
  display: flex;
  flex-direction: column;
  padding: 18px 0;
  gap: 2px;
  flex: 1;
}

.side-nav ol li {
  width: 100%;
}

.side-nav ol li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  color: var(--text-muted);
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-left: 3px solid transparent;
  transition: all 0.22s;
  min-height: 44px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  position: relative;
}

.side-nav ol li a:hover,
.side-nav ol li a:focus-visible {
  color: var(--text);
  background: rgba(86,34,139,0.2);
  border-left-color: var(--primary);
}

.nav-icon {
  font-size: 1rem;
  color: var(--primary);
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  opacity: 0.85;
}

.nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Hero ===== */
.hero-wrap {
  position: relative;
  width: 100%;
  min-height: 45vh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  position: absolute;
  inset: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(31,23,38,0.92) 0%, rgba(86,34,139,0.55) 50%, rgba(139,69,19,0.45) 100%);
}

.hero-blob {
  position: absolute;
  bottom: -40px;
  left: -20px;
  width: 460px;
  height: auto;
  pointer-events: none;
  z-index: 1;
}

.hero-bg-word {
  position: absolute;
  bottom: -10px;
  right: -10px;
  font-family: 'Russo One', sans-serif;
  font-size: clamp(80px, 14vw, 160px);
  color: rgba(86,34,139,0.12);
  letter-spacing: 0.05em;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  line-height: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: right;
  padding: 48px 56px 56px;
  max-width: 640px;
}

.hero-eyebrow {
  display: inline-block;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--gold);
  background: rgba(139,69,19,0.18);
  border: 1px solid rgba(212,160,85,0.3);
  border-radius: 30px;
  padding: 4px 16px;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.hero-h1 {
  font-family: 'Russo One', sans-serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.2;
  color: #fff;
  margin-bottom: 16px;
  text-shadow: 0 2px 20px rgba(86,34,139,0.5);
}

.hero-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 460px;
  margin-left: auto;
}

.hero-cta {
  display: inline-block;
  padding: 13px 34px;
  background: linear-gradient(135deg, #56228b, #7c3abf);
  color: #fff;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 24px rgba(86,34,139,0.45);
  transition: transform 0.2s, box-shadow 0.2s;
  min-height: 44px;
  line-height: 1.2;
}

.hero-cta:hover, .hero-cta:focus-visible {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(86,34,139,0.6);
}

/* ===== Main Content Area ===== */
main {
  flex: 1;
}

.wrap {
  display: flex;
  gap: 0;
  align-items: flex-start;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

/* ===== Aside ===== */
.content-aside {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 32px;
  padding: 32px 0 32px 32px;
  align-self: flex-start;
}

.aside-inner {
  background: rgba(42,18,64,0.6);
  border: 1px solid rgba(86,34,139,0.3);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.aside-title {
  font-family: 'Russo One', sans-serif;
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.aside-title span {
  border-bottom: 1px solid rgba(192,132,252,0.3);
  padding-bottom: 4px;
}

.aside-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aside-nav li a {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  line-height: 1.4;
  min-height: 32px;
  display: flex;
  align-items: center;
}

.aside-nav li a:hover, .aside-nav li a:focus-visible {
  color: var(--text);
  background: rgba(86,34,139,0.22);
}

.aside-deco {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  opacity: 0.7;
}

.aside-deco svg {
  width: 40px;
  height: 100px;
}

/* ===== Content Main ===== */
.content-main {
  flex: 1;
  padding: 40px 40px 40px 32px;
  min-width: 0;
}

.page-article {
  max-width: 860px;
}

/* ===== Article / page.content Styling ===== */
.page-article h2 {
  font-family: 'Russo One', sans-serif;
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  font-weight: 400;
  color: #d8b4fe;
  margin: 2.8rem 0 1rem;
  padding-left: 16px;
  border-left: 3px solid var(--primary);
  line-height: 1.3;
}

.page-article h2 span {
  display: inline;
}

.page-article h3 {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin: 2rem 0 0.7rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-article h3 span {
  display: inline;
}

.page-article h3::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--secondary);
  border-radius: 50%;
  flex-shrink: 0;
}

.page-article p {
  margin-bottom: 1.2rem;
  color: #cdbfe3;
  line-height: 1.85;
  font-size: 1rem;
}

.page-article ul, .page-article ol {
  margin: 0.8rem 0 1.2rem 0;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.page-article ul li, .page-article ol li {
  padding: 8px 14px 8px 36px;
  position: relative;
  background: rgba(42,18,64,0.4);
  border-radius: var(--radius-sm);
  color: #cdbfe3;
  font-size: 0.96rem;
  line-height: 1.6;
  border: 1px solid rgba(86,34,139,0.2);
}

.page-article ul li::before {
  content: '◆';
  position: absolute;
  left: 12px;
  top: 10px;
  font-size: 0.55rem;
  color: var(--primary);
}

.page-article ol {
  counter-reset: art-counter;
  list-style: none;
}

.page-article ol li {
  counter-increment: art-counter;
}

.page-article ol li::before {
  content: counter(art-counter, decimal-leading-zero);
  position: absolute;
  left: 10px;
  top: 8px;
  font-family: 'Russo One', sans-serif;
  font-size: 0.72rem;
  color: var(--accent);
  opacity: 0.8;
}

.page-article section {
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(86,34,139,0.2);
  scroll-margin-top: 32px;
}

.page-article section:last-child {
  border-bottom: none;
}

.page-article a {
  color: var(--accent);
  border-bottom: 1px solid rgba(192,132,252,0.3);
  transition: border-color 0.2s, color 0.2s;
}

.page-article a:hover {
  color: #fff;
  border-bottom-color: var(--accent);
}

.page-article blockquote {
  margin: 1.5rem 0;
  padding: 16px 24px;
  background: rgba(86,34,139,0.12);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-muted);
  font-style: italic;
}

.page-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
}

.page-article table th {
  background: rgba(86,34,139,0.3);
  color: var(--accent);
  padding: 10px 14px;
  text-align: left;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 600;
}

.page-article table td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(86,34,139,0.15);
  color: #cdbfe3;
}

.page-article table tr:hover td {
  background: rgba(86,34,139,0.08);
}

/* ===== Scroll margin for sections ===== */
section[id] {
  scroll-margin-top: 32px;
}

/* ===== Footer ===== */
.site-footer {
  background: linear-gradient(180deg, #1a0f2e 0%, #110a1a 100%);
  border-top: 1px solid rgba(86,34,139,0.3);
  margin-top: 4rem;
}

.footer-top {
  padding: 48px 56px 40px;
  border-bottom: 1px solid rgba(86,34,139,0.2);
}

.footer-form-block {
  max-width: 560px;
}

.footer-form-title {
  font-family: 'Russo One', sans-serif;
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 400;
}

.footer-form-title span {
  border-bottom: 1px solid rgba(192,132,252,0.35);
  padding-bottom: 3px;
}

.footer-form-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
  line-height: 1.7;
}

.footer-address {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-address a {
  color: var(--accent);
  border-bottom: 1px solid rgba(192,132,252,0.3);
}

.footer-address a:hover {
  color: #fff;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 56px;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-copyright {
  font-size: 0.82rem;
  color: #6b5580;
}

.footer-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.footer-links li a {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  font-size: 0.82rem;
  color: #6b5580;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
  min-height: 40px;
}

.footer-links li a:hover {
  color: var(--accent);
  background: rgba(86,34,139,0.12);
}

/* ===== Organic Blobs (background decoration) ===== */
.pg-home .site-body::before {
  content: '';
  position: fixed;
  top: 10%;
  right: 5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(86,34,139,0.08) 0%, transparent 70%);
  border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%;
  pointer-events: none;
  z-index: 0;
  animation: blob-float 18s ease-in-out infinite;
}

.pg-home .site-body::after {
  content: '';
  position: fixed;
  bottom: 15%;
  right: 20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(139,69,19,0.07) 0%, transparent 70%);
  border-radius: 40% 60% 30% 70% / 60% 30% 70% 40%;
  pointer-events: none;
  z-index: 0;
  animation: blob-float 24s ease-in-out infinite reverse;
}

@keyframes blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -20px) scale(1.05); }
  66% { transform: translate(-10px, 15px) scale(0.97); }
}

/* ===== Scroll Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

.stagger-list li {
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-list.visible li { opacity: 1; transform: none; }
.stagger-list.visible li:nth-child(1) { transition-delay: 0.05s; }
.stagger-list.visible li:nth-child(2) { transition-delay: 0.12s; }
.stagger-list.visible li:nth-child(3) { transition-delay: 0.19s; }
.stagger-list.visible li:nth-child(4) { transition-delay: 0.26s; }
.stagger-list.visible li:nth-child(5) { transition-delay: 0.33s; }
.stagger-list.visible li:nth-child(6) { transition-delay: 0.40s; }
.stagger-list.visible li:nth-child(7) { transition-delay: 0.47s; }
.stagger-list.visible li:nth-child(n+8) { transition-delay: 0.54s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .stagger-list li, .hero-cta,
  .pg-home .site-body::before, .pg-home .site-body::after {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  :root { --nav-w: 180px; }

  .content-aside {
    width: 180px;
    padding: 24px 0 24px 20px;
  }

  .content-main {
    padding: 32px 24px 32px 20px;
  }

  .hero-content {
    padding: 36px 36px 44px;
  }

  .footer-top,
  .footer-bottom {
    padding-left: 36px;
    padding-right: 36px;
  }
}

@media (max-width: 768px) {
  :root { --nav-w: 0px; }

  .site-shell { flex-direction: column; }
  .site-body { margin-left: 0; }

  /* Mobile nav: horizontal top bar */
  .side-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 0;
    border-right: none;
    border-bottom: 1px solid rgba(86,34,139,0.35);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    z-index: 200;
  }

  .side-nav-brand {
    padding: 10px 16px;
    border-bottom: none;
    border-right: 1px solid rgba(86,34,139,0.3);
    flex-shrink: 0;
  }

  .side-nav ol {
    flex-direction: row;
    padding: 0;
    gap: 0;
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
  }

  .side-nav ol li a {
    padding: 14px 14px;
    border-left: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    font-size: 0.78rem;
    min-height: 52px;
  }

  .side-nav ol li a:hover,
  .side-nav ol li a:focus-visible {
    border-left-color: transparent;
    border-bottom-color: var(--primary);
    background: rgba(86,34,139,0.15);
  }

  .nav-label { display: none; }
  .nav-icon { width: auto; font-size: 1.1rem; }

  .site-body {
    padding-top: 52px;
  }

  .hero-wrap {
    min-height: 48vh;
    align-items: flex-end;
    justify-content: flex-end;
  }

  .hero-content {
    padding: 24px 20px 32px;
    max-width: 100%;
  }

  .hero-bg-word {
    font-size: clamp(48px, 18vw, 90px);
  }

  .wrap {
    flex-direction: column;
  }

  .content-aside {
    width: 100%;
    position: static;
    padding: 20px 20px 0;
  }

  .aside-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
  }

  .aside-title { margin-bottom: 0; flex-shrink: 0; }
  .aside-nav { flex-direction: row; flex-wrap: wrap; }
  .aside-deco { display: none; }

  .content-main {
    padding: 24px 20px;
  }

  .footer-top {
    padding: 32px 20px 28px;
  }

  .footer-bottom {
    padding: 16px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  html { font-size: 16px; }

  .hero-h1 { font-size: 1.5rem; }
  .hero-eyebrow { font-size: 0.72rem; }
  .hero-sub { font-size: 0.88rem; }

  .page-article h2 { font-size: 1.2rem; }
  .page-article h3 { font-size: 1rem; }
}
