/* Front page layout and feature styling */

/* =========================================
   FRONT PAGE (ex1.ai)
   ========================================= */

body.frontpage,
body.path-frontpage {
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Hero section */
body.frontpage .ex1-hero {
  background: radial-gradient(
      900px 400px at 50% 10%,
      var(--accent-soft),
      transparent 60%
    ),
    var(--bg-primary);
}

/* Main content card */
body.frontpage .layout-content,
body.frontpage .region-content {
  background: var(--bg-surface-soft);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  border-radius: 18px;
  padding: 32px;
}

/* Headings */
body.frontpage h1,
body.frontpage h2,
body.frontpage h3 {
  color: var(--text-primary);
}

/* Paragraphs */
body.frontpage p {
  color: var(--text-secondary);
}

/* Links */
body.frontpage a {
  color: var(--accent);
}

body.path-frontpage .ex1-heroWrap {
  padding: 56px 40px 40px !important;
  margin-top: -20px;
  margin-bottom: 0 !important;
}

.ex1-heroHead {
  max-width: 62rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.ex1-heroHead .ex1-title {
  margin: 0 0 0.75rem;
}

.ex1-heroHead .ex1-subtitle {
  margin: 0;
}

body.path-frontpage .ex1-heroInner {
  display: block;
  text-align: left;
  gap: 32px;
  max-width: 1280px;
  margin: 0 auto;
}

/* Title block full width */
body.path-frontpage .ex1-heroTitleWrap {
  max-width: 900px;
  margin: 0 auto 32px;
}

body.path-frontpage .ex1-brandRow {
  display: flex;
  justify-content: center;
}

body.path-frontpage .ex1-branding--hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* Make title centered */
body.path-frontpage .ex1-heroTitleWrap h1 {
  text-align: left;
  font-size: clamp(36px, 4vw, 64px);
  line-height: 1.1;
}

/* Subtitle centered */
body.path-frontpage .ex1-heroTitleWrap p {
  text-align: left;
  opacity: 0.75;
  font-size: 18px;
}


/* Row for overlay + image */
body.path-frontpage .ex1-heroContentRow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 72px;
  flex-wrap: nowrap;
}

body.path-frontpage .ex1-heroText,
body.path-frontpage .ex1-heroArt {
  flex: 1 1 0;
}

.ex1-heroText {
  flex: 1 1 52%;
  min-width: 0;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-primary {
  background: #5e7cff;
  color: #ffffff;
  padding: 14px 26px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 12px 40px rgba(94, 124, 255, 0.45);
}

.btn-primary:hover {
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  padding: 14px 26px;
  border-radius: 14px;
  text-decoration: none;
}

.btn-tertiary {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  padding: 14px 10px;
}

.ex1-heroArt {
  flex: 1 1 48%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.ex1-heroArt img,
.ex1-heroArt svg,
.ex1-heroArt picture {
  max-width: min(520px, 100%);
  height: auto;
  display: block;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  max-width: 1100px;
  margin: 100px auto;
  padding: 0 40px;
}

.feature-card {
  padding: 28px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.feature-card h3 {
  margin-bottom: 12px;
  font-size: 20px;
}

.feature-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

@media (max-width: 900px) {
  .ex1-heroInner {
    flex-direction: column;
    align-items: flex-start;
  }

  .ex1-heroArt {
    width: 100%;
    justify-content: center;
  }
}

/* =========================================================
   FRONT PAGE — Professional Hero + Feature Grid Styling
   Scoped to front page only (no !important needed)
   ========================================================= */

html.dark-mode body.path-frontpage {
  background:
    radial-gradient(1000px 600px at 50% 12%, rgba(120,160,255,0.18), transparent 60%),
    #0b0d10;
  color: rgba(255,255,255,0.92);
}

html.dark-mode body.front {
  background:
    radial-gradient(900px 500px at 50% 15%, rgba(120,160,255,0.18), transparent 60%),
    #0b0d10;
}

/* Remove left gray strip on front page */
body.path-frontpage .region-sidebar {
  display: none;
}

body.path-frontpage .social-bar {
  display: none;
}

/* =========================
   HERO SECTION
   ========================= */

body.path-frontpage .frontpage-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 70px;
  align-items: center;
  max-width: 1200px;
  margin: 90px auto 80px;
  padding: 0 40px;
}

body.path-frontpage .frontpage-hero h1 {
  font-size: clamp(44px, 4.5vw, 64px);
  font-weight: 800;
  line-height: 1.08;
  margin-bottom: 24px;
}

body.path-frontpage .frontpage-hero p {
  font-size: 20px;
  opacity: 0.75;
  margin-bottom: 36px;
  max-width: 580px;
  line-height: 1.6;
}

/* Hero image styling */
body.path-frontpage .frontpage-hero img {
  width: 100%;
  max-width: 560px;
  border-radius: 22px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.5);
}

body.path-frontpage .ex1-heroArt img,
body.path-frontpage .ex1-heroArt svg,
body.path-frontpage .ex1-heroArt picture {
  max-width: min(600px, 100%);
}

/* HERO COVER CARD */
body.path-frontpage .hero-cover {
  position: relative;
  width: 100%;
  max-width: 720px;
}

body.path-frontpage .hero-cover::before {
  content: "";
  position: absolute;
  inset: -40px;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(120,140,255,0.15),
    transparent 60%
  );
  z-index: -1;
}

body.path-frontpage .hero-cover img {
  width: 100%;
  max-width: 650px;
  display: block;
  border-radius: 24px;
  box-shadow:
    0 40px 80px rgba(0,0,0,0.6),
    0 0 60px rgba(80,100,255,0.15);
}

/* Overlay panel at bottom of the cover */
body.path-frontpage .hero-cover__overlay {
  position: relative;
  margin: 0 auto;
  width: min(520px, 100%);
  padding: 28px;
  border-radius: 24px;
  background: linear-gradient(
    to bottom,
    rgba(12,14,20,0.65),
    rgba(12,14,20,0.9)
  );
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.08);
}

/* Bullet styling */
body.path-frontpage .hero-cover__bullets {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  color: rgba(255,255,255,0.88);
  font-size: 14px;
}

body.path-frontpage .hero-cover__bullets li::before {
  content: "✓";
  display: inline-block;
  margin-right: 10px;
  color: rgba(120,160,255,0.95);
  font-weight: 800;
}

/* Buttons inside overlay */
body.path-frontpage .hero-cover__buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Make buttons slightly smaller in the overlay so they fit */
body.path-frontpage .hero-cover__buttons .btn-primary,
body.path-frontpage .hero-cover__buttons .btn-secondary {
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
}

/* =========================
   HERO BUTTONS
   ========================= */

body.path-frontpage .hero-buttons {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

body.path-frontpage .btn-primary {
  background: #5e7cff;
  color: #fff;
  padding: 14px 28px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 14px 40px rgba(94,124,255,0.45);
  transition: all 0.2s ease;
}

body.path-frontpage .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 50px rgba(94,124,255,0.6);
}

body.path-frontpage .btn-secondary {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  padding: 14px 28px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

body.path-frontpage .btn-secondary:hover {
  background: rgba(255,255,255,0.14);
  transform: translateY(-2px);
}

body.path-frontpage .btn-tertiary {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  padding: 14px 14px;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

body.path-frontpage .btn-tertiary:hover {
  opacity: 1;
}

/* =========================
   FEATURE GRID SECTION
   ========================= */

body.path-frontpage .feature-grid {
  max-width: 1280px;
  margin: 40px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  padding: 0 40px;
}

body.path-frontpage .layout-main-wrapper,
body.path-frontpage .layout-main,
body.path-frontpage .main-content {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

body.path-frontpage .feature-card {
  padding: 28px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  transition: all 0.25s ease;
}

body.path-frontpage .feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 35px 90px rgba(0,0,0,0.45);
  border-color: rgba(120,160,255,0.35);
}

body.path-frontpage .feature-card h3 {
  margin: 0 0 12px;
  font-size: 20px;
  color: rgba(255,255,255,0.95);
}

body.path-frontpage .feature-card p {
  margin: 0;
  color: rgba(255,255,255,0.70);
  line-height: 1.6;
}

/* Remove extra vertical space after feature grid */
body.path-frontpage .feature-grid {
  margin-bottom: 0 !important;
}

body.path-frontpage .layout-main-wrapper,
body.path-frontpage .layout-main,
body.path-frontpage .main-content,
body.path-frontpage .main-content__container {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

body.path-frontpage h1 {
  font-size: clamp(48px, 4.5vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

body.path-frontpage .ex1-title__line {
  display: block;
  white-space: nowrap;
}

body.path-frontpage .ex1-branding .mathjax-inline {
  font-size: 52px;
}

body.path-frontpage .hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 80px;
}

body.path-frontpage .layout-main-wrapper {
  min-height: auto;
  display: block;
}

/* FRONT PAGE: remove viewport-height forcing on wrapper */
body.path-frontpage #main-wrapper.layout-main-wrapper {
  min-height: auto;
  padding-top: 0;
}

body.path-frontpage #main-wrapper,
body.path-frontpage .layout-container,
body.path-frontpage .layout-main-wrapper {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* FRONT PAGE: prevent full-viewport wrappers creating bottom void */
body.path-frontpage #page,
body.path-frontpage #main-wrapper,
body.path-frontpage #main {
  min-height: auto !important;
  height: auto !important;
}

/* Remove extra bottom whitespace from wrappers */
body.path-frontpage #main-wrapper,
body.path-frontpage #main,
body.path-frontpage .layout-main-wrapper {
  min-height: auto !important;
  height: auto !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* Front page: remove side bars from constrained containers */
body.path-frontpage .page-wrapper,
body.path-frontpage .layout-container,
body.path-frontpage .main-content__container {
  max-width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  background: transparent !important;
}

body.path-frontpage .layout-main-wrapper,
body.path-frontpage .layout-main {
  background: transparent !important;
}

/* FRONT PAGE: constrain width so it doesn't feel too wide */
body.path-frontpage .layout-container {
  max-width: 1100px !important;
  margin: 0 auto !important;
  padding-left: 28px !important;
  padding-right: 28px !important;
}

body.path-frontpage .site-footer {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Light mode fixes for front page panels + footer */
body.path-frontpage .site-footer {
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  border-top: 1px solid var(--border-subtle) !important;
}

body.path-frontpage .feature-grid {
  margin-bottom: 80px;
}

body.path-frontpage .feature-card {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow: var(--shadow-soft) !important;
}

body.path-frontpage .feature-card h3 {
  color: var(--text-primary) !important;
}

body.path-frontpage .feature-card p {
  color: var(--text-secondary) !important;
}

/* Add space between mid section and footer */
body.path-frontpage .site-footer {
  margin-top: 64px !important;
  padding-top: 32px !important;
}

/* Kill empty region blocks that render as big rectangles */
body.path-frontpage .region--footer-top:empty,
body.path-frontpage .region--footer-bottom:empty,
body.path-frontpage .region--content-below:empty,
body.path-frontpage .region--sidebar:empty,
body.path-frontpage .layout__region:empty {
  display: none !important;
}

/* If those boxes are "block" wrappers with no content */
body.path-frontpage .block:has(> .content:empty),
body.path-frontpage .block:has(> .content > :is(:empty)) {
  display: none !important;
}

body.path-frontpage .site-header,
body.path-frontpage .site-header__inner,
body.path-frontpage .site-header__inner__container {
  padding-top: 0;
  margin-top: 0;
}

/* FRONT PAGE: stop the flex layout from vertically centering/pushing content */
body.path-frontpage #main.layout-main {
  display: block !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  min-height: 0 !important;
}

body.path-frontpage .layout-main {
  display: block !important;
}

body.path-frontpage .main-content__container {
  padding-block-start: 0 !important;
}

/* Header: push menu to the right */
body.path-frontpage .site-header .header-nav,
body.path-frontpage .site-header #header-nav {
  display: flex;
  align-items: center;
}

/* Make the actual menu wrapper take the free space */
body.path-frontpage .site-header .menu--account,
body.path-frontpage .site-header .menu--user-account-menu,
body.path-frontpage .site-header .menu--account-menu,
body.path-frontpage .site-header .region-secondary-menu,
body.path-frontpage .site-header .region--secondary-menu {
  margin-left: auto;
}

/* Olivero / Linear Book header alignment */
body.path-frontpage .site-header .header-nav {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Header nav alignment */
body.path-frontpage .site-header #header-nav,
body.path-frontpage .site-header .header-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

/* Make search icon not look like a random square */
body.path-frontpage #block-linear-book-meili-search {
  margin-left: 0;
}

/* Put header search icon at far right too */
body.path-frontpage #block-linear-book-meili-search {
  margin-left: auto;
}

body.path-frontpage .site-header .region-secondary-menu,
body.path-frontpage .site-header .region--secondary-menu,
body.path-frontpage .site-header .menu--account,
body.path-frontpage .site-header .menu--user-account-menu,
body.path-frontpage .site-header .menu--account-menu {
  margin-left: auto;
}

body.path-frontpage .site-header__inner__container {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 960px !important;
  margin-inline: auto;
  padding-inline: 0 !important;
}

body.path-frontpage .site-header__inner__container > .region-header {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
}

body.path-frontpage .site-header__inner__container > #header-nav {
  margin-left: auto;
}

body.path-frontpage .site-header__inner__container .region-header #block-linear-book-meili-search {
  margin-left: auto;
}

body.path-frontpage .site-header .header-nav .menu,
body.path-frontpage .site-header .header-nav .menu__items {
  gap: 8px;
}

body.path-frontpage .site-header .header-nav .menu__item {
  margin-left: 0;
}

body.path-frontpage .site-header .header-nav .menu__link {
  padding-inline: 0.35rem;
}

/* Remove empty social column if present */
body.path-frontpage .social-bar {
  display: none;
}

/* FRONT PAGE HERO LAYOUT */
body.path-frontpage .main-content {
  display: block;
  margin: 0;
  padding: 0;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 900px) {
  body.path-frontpage .frontpage-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  body.path-frontpage .frontpage-hero img {
    margin: 0 auto;
  }

  body.path-frontpage .hero-buttons {
    justify-content: center;
  }
}
