:root {
  --atlas-ink: #f3f0fb;
  --atlas-muted: #bbb5cd;
  --atlas-accent: #aa86f6;
  --atlas-line: #a989e82e;
  --atlas-panel: #191527;
}

body.atlas-site,
body.study-site {
  color: var(--atlas-ink);
  background: radial-gradient(ellipse 90% 60% at 76% -18%, #35204a 0%, transparent 70%),
              linear-gradient(180deg, #15111f, #0d0c15 70%);
}

body.study-site {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

body.study-site header,
body.study-site nav {
  box-shadow: none;
}

body.study-site header nav {
  max-width: 1320px;
  min-height: 66px;
}

body.study-site .logo {
  font-size: 19px;
  letter-spacing: -.035em;
}

body.study-site .logo-icon {
  color: var(--atlas-accent);
}

body.study-site .logo span {
  background: linear-gradient(105deg, #f4eaff, #ab8af3);
  -webkit-background-clip: text;
  background-clip: text;
}

body.study-site .nav-links {
  gap: clamp(12px, 2vw, 26px);
}

body.study-site .nav-links a {
  color: #c4bdd2;
  font-size: 14px;
}

body.atlas-site .top,
body.study-site header,
body.study-site nav {
  background: #181422e8;
  border-color: var(--atlas-line);
}

body.atlas-site .top small,
body.atlas-site .eyebrow,
body.atlas-site .num,
body.study-site .section-subtitle {
  color: #c7b4ed;
}

body.atlas-site .hero h1,
body.atlas-site .section h2,
body.study-site .hero h1,
body.study-site .section-title {
  color: #f7f3ff;
  background: linear-gradient(105deg, #ffffff 15%, #d4c1ff 72%, #a788ed);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.atlas-site .section,
body.atlas-site .hero,
body.atlas-site footer,
body.study-site footer {
  border-color: var(--atlas-line);
}

body.atlas-site .section p,
body.atlas-site .section li,
body.atlas-site .hero p,
body.study-site p {
  color: var(--atlas-muted);
}

body.atlas-site .study-card,
body.atlas-site .exercise,
body.atlas-site .formula,
body.study-site .subject-card,
body.study-site .resource-card,
body.study-site .profile-header {
  background: linear-gradient(145deg, #211a31, #15121f);
  border-color: var(--atlas-line);
}

body.atlas-site .study-cards {
  gap: 16px;
}

body.atlas-site .study-card {
  min-height: 144px;
  padding: 24px;
  box-shadow: 0 14px 34px #00000022;
}

body.atlas-site .study-card .card-index {
  display: block;
  margin-bottom: 16px;
  color: #c6aaf9;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

body.atlas-site .hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

body.atlas-site .hero-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid #a989e85c;
  border-radius: 9px;
  background: #241b34;
  color: #f4eaff;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: background-color .18s ease, transform .18s ease;
}

body.atlas-site .hero-actions a:hover {
  background: #3a2856;
  transform: translateY(-1px);
}

body.atlas-site .learning-objectives {
  margin-top: 28px;
  padding: 22px 25px;
  border: 1px solid var(--atlas-line);
  border-radius: 12px;
  background: linear-gradient(120deg, #1d1729, #15121e);
}

body.atlas-site .learning-objectives h3 {
  margin: 0 0 10px;
  color: #f1eaff;
}

body.atlas-site .learning-objectives ul {
  margin: 0;
}

body.study-site .hero,
body.study-site .cta-button {
  background: linear-gradient(125deg, #21172f, #392257 60%, #1b1528);
  border-color: var(--atlas-line);
}

body.study-site .hero {
  border-bottom: 1px solid var(--atlas-line);
}

body.study-site .container {
  max-width: 1240px;
}

body.study-site .subject-card,
body.study-site .resource-card,
body.study-site .profile-header {
  border: 1px solid var(--atlas-line);
  border-radius: 14px;
  box-shadow: 0 14px 36px #00000026;
}

body.study-site .cta-button,
body.study-site button {
  border-radius: 10px;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

body.study-site .cta-button:hover,
body.study-site button:hover {
  transform: translateY(-1px);
}

body.study-site :is(a, button, input, select, textarea):focus-visible,
body.atlas-site :is(a, button):focus-visible {
  outline: 2px solid #bb9bff;
  outline-offset: 3px;
}

body.study-site a:hover,
body.atlas-site aside a:hover {
  color: #eadcff;
}

@media (max-width: 760px) {
  body.study-site header nav {
    flex-wrap: wrap;
    gap: 10px;
    padding-block: 12px;
  }

  body.study-site .nav-links {
    gap: 12px;
    flex-wrap: wrap;
  }
}

/* Atlas Study embedded home */
@scope (.embedded-study) {

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

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
            line-height: 1.6;
            color: #e8e8e8;
            background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 100%);
            min-height: 100vh;
        }

        header {
            background: rgba(22, 22, 38, 0.95);
            backdrop-filter: blur(10px);
            border-bottom: 1px solid rgba(99, 102, 241, 0.2);
            padding: 1rem 0;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }

        nav {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 2rem;
        }

        .logo {
            font-size: 1.8rem;
            font-weight: 700;
            color: #e8e8e8;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            cursor: pointer;
        }

        .logo-icon {
            color: #6366f1;
        }

        .logo span {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .nav-links {
            display: flex;
            gap: 2.5rem;
            list-style: none;
            align-items: center;
        }

        .nav-links a {
            color: #e8e8e8;
            text-decoration: none;
            font-weight: 500;
            transition: color 0.3s;
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }

        .nav-links a:hover {
            color: #6366f1;
        }

        .hero {
            background: linear-gradient(135deg, #1e1e3f 0%, #2a2a4a 100%);
            padding: 5rem 2rem;
            text-align: center;
            border-bottom: 1px solid rgba(99, 102, 241, 0.2);
            position: relative;
            overflow: hidden;
        }

        .hero::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
        }

        .hero-content {
            position: relative;
            z-index: 1;
            max-width: 800px;
            margin: 0 auto;
        }

        .hero h1 {
            font-size: 3rem;
            margin-bottom: 1.2rem;
            color: #e8e8e8;
            font-weight: 700;
            line-height: 1.2;
        }

        .hero .tagline {
            font-size: 1.3rem;
            margin-bottom: 0.8rem;
            color: #a5a5c8;
            font-weight: 500;
        }

        .hero .subtitle {
            font-size: 1.1rem;
            margin-bottom: 2.5rem;
            color: #8585a8;
        }

        .cta-button {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            color: white;
            padding: 1rem 2.5rem;
            border: none;
            border-radius: 8px;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.3s, box-shadow 0.3s;
            display: inline-flex;
            align-items: center;
            gap: 0.6rem;
            box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
        }

        .cta-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 4rem 2rem;
        }

        .section-title {
            font-size: 2.2rem;
            margin-bottom: 1rem;
            color: #e8e8e8;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 0.8rem;
        }

        .section-subtitle {
            color: #a5a5c8;
            margin-bottom: 3rem;
            font-size: 1.1rem;
        }

        .subjects-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 2rem;
            margin-bottom: 3rem;
        }

        .subject-card {
            background: linear-gradient(135deg, rgba(30, 30, 63, 0.6) 0%, rgba(42, 42, 74, 0.6) 100%);
            padding: 2.5rem;
            border-radius: 12px;
            border: 1px solid rgba(99, 102, 241, 0.2);
            transition: all 0.3s;
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }

        .subject-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
            opacity: 0;
            transition: opacity 0.3s;
        }

        .subject-card:hover {
            border-color: #6366f1;
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(99, 102, 241, 0.2);
        }

        .subject-card:hover::before {
            opacity: 1;
        }

        .subject-icon {
            width: 60px;
            height: 60px;
            margin-bottom: 1.2rem;
            color: #6366f1;
            background: rgba(99, 102, 241, 0.1);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .subject-card h3 {
            font-size: 1.4rem;
            margin-bottom: 0.8rem;
            color: #e8e8e8;
            font-weight: 600;
            position: relative;
        }

        .subject-card p {
            color: #a5a5c8;
            font-size: 1rem;
            line-height: 1.6;
            position: relative;
        }

        .features {
            background: linear-gradient(135deg, #1e1e3f 0%, #2a2a4a 100%);
            padding: 4rem 2rem;
            border-top: 1px solid rgba(99, 102, 241, 0.2);
            border-bottom: 1px solid rgba(99, 102, 241, 0.2);
        }

        .features-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
            gap: 2.5rem;
            max-width: 1200px;
            margin: 0 auto;
        }

        .feature-item {
            padding: 2rem;
            text-align: left;
            background: rgba(30, 30, 63, 0.4);
            border-radius: 12px;
            border: 1px solid rgba(99, 102, 241, 0.15);
            transition: all 0.3s;
        }

        .feature-item:hover {
            transform: translateY(-3px);
            border-color: rgba(99, 102, 241, 0.4);
        }

        .feature-icon {
            width: 50px;
            height: 50px;
            margin-bottom: 1.2rem;
            color: #8b5cf6;
            background: rgba(139, 92, 246, 0.1);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .feature-item h3 {
            font-size: 1.2rem;
            margin-bottom: 0.8rem;
            color: #e8e8e8;
            font-weight: 600;
        }

        .feature-item p {
            color: #a5a5c8;
            font-size: 1rem;
            line-height: 1.6;
        }

        .stats {
            background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 100%);
            padding: 4rem 2rem;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 2rem;
            max-width: 1200px;
            margin: 2rem auto 0;
        }

        .stat-item {
            text-align: center;
            padding: 2rem;
            background: linear-gradient(135deg, rgba(30, 30, 63, 0.6) 0%, rgba(42, 42, 74, 0.6) 100%);
            border-radius: 12px;
            border: 1px solid rgba(99, 102, 241, 0.2);
            transition: all 0.3s;
        }

        .stat-item:hover {
            transform: translateY(-5px);
            border-color: #6366f1;
            box-shadow: 0 10px 25px rgba(99, 102, 241, 0.2);
        }

        .stat-item .stat-icon {
            width: 50px;
            height: 50px;
            margin: 0 auto 1rem;
            color: #6366f1;
            background: rgba(99, 102, 241, 0.1);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .stat-item h3 {
            font-size: 2.8rem;
            margin-bottom: 0.5rem;
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            font-weight: 700;
        }

        .stat-item p {
            color: #a5a5c8;
            font-size: 1rem;
            font-weight: 500;
        }

        footer {
            background: rgba(22, 22, 38, 0.95);
            color: #a5a5c8;
            text-align: center;
            padding: 2.5rem;
            border-top: 1px solid rgba(99, 102, 241, 0.2);
        }

        .quiz-section {
            background: linear-gradient(135deg, rgba(30, 30, 63, 0.6) 0%, rgba(42, 42, 74, 0.6) 100%);
            padding: 2.5rem;
            border-radius: 12px;
            border: 1px solid rgba(99, 102, 241, 0.2);
            margin-top: 2rem;
            display: none;
        }

        .quiz-section.active {
            display: block;
        }

        .quiz-section h3 {
            display: flex;
            align-items: center;
            gap: 0.8rem;
            margin-bottom: 1.5rem;
            font-size: 1.5rem;
        }

        .quiz-question {
            margin-bottom: 2rem;
        }

        .quiz-question p {
            margin-bottom: 1.2rem;
            font-size: 1.2rem;
            font-weight: 500;
        }

        .quiz-options {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .quiz-option {
            padding: 1.2rem;
            background: rgba(30, 30, 63, 0.6);
            border: 1px solid rgba(99, 102, 241, 0.2);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 0.8rem;
        }

        .quiz-option:hover {
            border-color: #6366f1;
            background: rgba(99, 102, 241, 0.1);
            transform: translateX(5px);
        }

        .quiz-option.correct {
            border-color: #10b981;
            background: rgba(16, 185, 129, 0.1);
        }

        .quiz-option.incorrect {
            border-color: #ef4444;
            background: rgba(239, 68, 68, 0.1);
        }

        @media (max-width: 768px) {
            .nav-links {
                gap: 1.5rem;
            }
            
            .hero h1 {
                font-size: 2rem;
            }
            
            .subjects-grid,
            .features-grid {
                grid-template-columns: 1fr;
            }
        }

        .lessons-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
            gap: 2rem;
            margin-bottom: 3rem;
        }

        .lesson-card {
            background: linear-gradient(135deg, rgba(30, 30, 63, 0.6) 0%, rgba(42, 42, 74, 0.6) 100%);
            border-radius: 12px;
            border: 1px solid rgba(99, 102, 241, 0.2);
            overflow: hidden;
            transition: all 0.3s;
            cursor: pointer;
        }

        .lesson-card:hover {
            transform: translateY(-5px);
            border-color: #6366f1;
            box-shadow: 0 10px 25px rgba(99, 102, 241, 0.2);
        }

        .lesson-header {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            padding: 1.5rem;
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .lesson-icon {
            width: 50px;
            height: 50px;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
        }

        .lesson-title {
            flex: 1;
        }

        .lesson-title h3 {
            font-size: 1.3rem;
            color: white;
            margin-bottom: 0.3rem;
        }

        .lesson-title span {
            font-size: 0.9rem;
            color: rgba(255, 255, 255, 0.8);
        }

        .lesson-body {
            padding: 1.5rem;
        }

        .lesson-description {
            color: #a5a5c8;
            margin-bottom: 1.2rem;
            line-height: 1.6;
        }

        .lesson-meta {
            display: flex;
            gap: 1.5rem;
            margin-bottom: 1.5rem;
            flex-wrap: wrap;
        }

        .meta-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: #8585a8;
            font-size: 0.9rem;
        }

        .meta-item i {
            color: #6366f1;
        }

        .lesson-topics {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 1.2rem;
        }

        .topic-tag {
            background: rgba(99, 102, 241, 0.15);
            color: #8b5cf6;
            padding: 0.4rem 0.8rem;
            border-radius: 6px;
            font-size: 0.85rem;
            border: 1px solid rgba(99, 102, 241, 0.3);
        }

        .lesson-button {
            width: 100%;
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            color: white;
            padding: 0.9rem;
            border: none;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.6rem;
        }

        .lesson-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
        }

        .progress-section {
            background: linear-gradient(135deg, rgba(30, 30, 63, 0.6) 0%, rgba(42, 42, 74, 0.6) 100%);
            border-radius: 12px;
            border: 1px solid rgba(99, 102, 241, 0.2);
            padding: 2rem;
            margin-bottom: 3rem;
        }

        .progress-title {
            font-size: 1.5rem;
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            gap: 0.6rem;
            color: #e8e8e8;
        }

        .progress-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.5rem;
        }

        .stat-box {
            background: rgba(30, 30, 63, 0.6);
            padding: 1.5rem;
            border-radius: 10px;
            border: 1px solid rgba(99, 102, 241, 0.15);
            text-align: center;
        }

        .stat-box h4 {
            font-size: 2rem;
            color: #6366f1;
            margin-bottom: 0.5rem;
        }

        .stat-box p {
            color: #a5a5c8;
        }
    
}

body.atlas-site .embedded-study {
  min-width: 0;
  border-bottom: 1px solid var(--atlas-line);
}

body.atlas-site .embedded-study .container {
  max-width: none;
  padding: 58px 0;
}

body.atlas-site .embedded-study :is(.subjects-grid, .lessons-grid, .features-grid, .stats-grid) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 16px;
}

body.atlas-site .embedded-study :is(.section-title, .progress-title) {
  color: #f4eeff;
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -.04em;
}

body.atlas-site .embedded-study .section-subtitle {
  color: #bdb3d0;
}

body.atlas-site .embedded-study :is(.subject-card, .lesson-card, .feature-item, .stat-item, .progress-section, .quiz-section, .stat-box) {
  border: 1px solid var(--atlas-line);
  border-radius: 13px;
  background: linear-gradient(145deg, #211a31, #15121f);
  box-shadow: none;
}

body.atlas-site .embedded-study :is(.subject-card, .lesson-card, .feature-item, .stat-item):hover {
  border-color: #a989e883;
  box-shadow: 0 10px 24px #00000024;
}

body.atlas-site .embedded-study :is(.features, .stats) {
  padding: 8px 0;
  background: transparent;
  border-color: var(--atlas-line);
}

body.atlas-site .embedded-study :is(.lesson-header, .lesson-button, .cta-button) {
  background: linear-gradient(115deg, #493061, #7452a8);
}

body.atlas-site .embedded-study :is(.subject-icon, .feature-icon, .stat-icon, .topic-tag) {
  color: #c5a7ff;
  background: #a989e81c;
  border-color: #a989e846;
}

body.atlas-site .embedded-study .quiz-option {
  background: #211a31;
  border-color: var(--atlas-line);
}

body.atlas-site .embedded-study .quiz-feedback {
  margin-top: 16px;
  color: #e7d9ff;
  font-weight: 600;
}
