/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

:root {
  --accent-color: #3273DC;
  --bg-color: #fafafa;
  --text-color: #1d1d1f;
  --text-secondary: #6e6e73;
  --border-color: #d2d2d7;
  --white: #ffffff;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* View Transitions */
@view-transition {
  navigation: auto;
}

h1 {
  view-transition-name: page-heading;
}

main {
  view-transition-name: main-content;
}

/* H1: slides out to the left, new H1 slides in from the right */
::view-transition-old(page-heading) {
  animation: 0.3s ease both h1-exit;
}

::view-transition-new(page-heading) {
  animation: 0.3s 0.1s ease both h1-enter;
}

@keyframes h1-exit {
  to { opacity: 0; transform: translateX(-40px); }
}

@keyframes h1-enter {
  from { opacity: 0; transform: translateX(40px); }
}

/* Content: fades to white, then fades back in */
::view-transition-image-pair(main-content) {
  background: #ffffff;
}

::view-transition-old(main-content) {
  animation: 0.25s ease both content-exit;
}

::view-transition-new(main-content) {
  animation: 0.25s 0.25s ease both content-enter;
}

@keyframes content-exit {
  to { opacity: 0; }
}

@keyframes content-enter {
  from { opacity: 0; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: #2861c7;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--accent-color);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: 3rem;
  font-weight: 700;
}

h2 {
  font-size: 2.5rem;
}

h3 {
  font-size: 2rem;
  margin-left: 0;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--text-color);
  text-decoration: none;
  border-bottom: 2px solid var(--accent-color);
  transition: all 0.2s ease;
}

a:hover {
  color: var(--accent-color);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }
}

/* Header and Navigation */
.site-header {
  background-color: rgba(250, 250, 250, 0.95);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.nav-brand a {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: none;
  font-weight: 600;
  font-size: 1.2rem;
}

.logo-placeholder {
  width: 32px;
  height: 32px;
  background: var(--accent-color);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 30px;
  align-items: center;
}

.nav-menu li a {
  font-size: 14px;
  border-bottom: none;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.nav-menu li a:hover {
  background-color: rgba(116, 192, 252, 0.1);
}

.nav-portal {
  background-color: var(--accent-color);
  color: var(--white) !important;
  padding: 8px 16px !important;
  border-radius: 6px;
}

.nav-portal:hover {
  background-color: #2861c7 !important;
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.hamburger-line {
  width: 25px;
  height: 3px;
  background-color: var(--text-color);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.hamburger.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

@media (max-width: 768px) {
  .nav-container {
    flex-direction: row;
    justify-content: space-between;
    height: 60px;
    padding: 0 20px;
  }

  .nav-brand a {
    font-size: 1rem;
    gap: 8px;
  }

  .logo-placeholder {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background-color: var(--white);
    flex-direction: column;
    gap: 0;
    padding: 20px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-menu li {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-menu li:last-child {
    border-bottom: none;
  }

  .nav-menu li a {
    display: block;
    font-size: 16px;
    padding: 15px 20px;
    border-bottom: none;
    border-radius: 0;
  }

  .nav-menu li a:hover {
    background-color: rgba(116, 192, 252, 0.1);
  }

  .nav-portal {
    padding: 15px 20px !important;
    border-radius: 0 !important;
  }
}

/* Hero Section */
.hero {
  background-color: var(--white);
  padding: 100px 0;
  text-align: center;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.hero .tagline {
  font-size: 1.75rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 2rem;
}

.hero .value-prop {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.7;
}

@media (max-width: 768px) {
  .hero {
    padding: 40px 0;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero .tagline {
    font-size: 1.1rem;
  }

  .hero .value-prop {
    font-size: 0.95rem;
  }
}

/* Product Sections - Apple Style Alternating */
.product-section {
  padding: 80px 0;
  background-color: var(--white);
}

.product-section:nth-child(even) {
  background-color: var(--bg-color);
}

@media (max-width: 768px) {
  .product-section {
    padding: 50px 0;
  }
}

.product-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

.product-row.reverse {
  direction: rtl;
}

.product-row.reverse > * {
  direction: ltr;
}

.product-image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.product-text h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.product-text p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

@media (max-width: 768px) {
  .product-row {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .product-row.reverse {
    direction: ltr;
  }

  .product-text h2 {
    font-size: 1.75rem;
  }

  .product-text p {
    font-size: 1rem;
  }
}

/* Feature Grid */
.features-section {
  background-color: var(--bg-color);
  padding: 80px 0;
}

@media (max-width: 768px) {
  .features-section {
    padding: 50px 0;
  }
}

.features-header {
  text-align: center;
  margin-bottom: 60px;
}

.features-header h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.features-header p {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

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

.feature-card {
  background: var(--white);
  padding: 40px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(116, 192, 252, 0.15);
  border-color: var(--accent-color);
}

.feature-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.feature-badge {
  display: inline-block;
  background: rgba(116, 192, 252, 0.1);
  color: var(--accent-color);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 10px;
}

@media (max-width: 768px) {
  .features-header h2 {
    font-size: 2rem;
  }

  .features-header p {
    font-size: 1rem;
  }

  .features-grid {
    gap: 30px;
  }

  .feature-card {
    padding: 30px;
  }

  .feature-card h3 {
    font-size: 1.3rem;
  }
}

/* Page Content */
.page-content,
.post {
  padding: 60px 0 40px;
  background-color: var(--white);
}

@media (max-width: 768px) {
  .page-content,
  .post {
    padding: 40px 0 28px;
  }
}

.page-header,
.post-header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.page-body,
.post-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.1rem;
  line-height: 1.8;
}

.page-body ol,
.page-body ul,
.post-content ol,
.post-content ul {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.page-body ol li,
.page-body ul li,
.post-content ol li,
.post-content ul li {
  margin-bottom: 0.5rem;
}

.post-content img,
.page-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  max-height: 45vh;
}

.post-meta {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 10px;
}

@media (max-width: 768px) {
  .page-header,
  .post-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
  }

  .page-header h1,
  .post-header h1 {
    font-size: 2rem;
  }
}

/* Blog */
.blog-list {
  max-width: 900px;
  margin: 0 auto;
}

.blog-post {
  background: var(--white);
  padding: 40px;
  margin-bottom: 40px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-post:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.blog-post h2 {
  margin-bottom: 0.5rem;
}

.blog-post h2 a {
  border-bottom: none;
  color: var(--accent-color);
}

.blog-post h2 a:hover {
  color: #2861c7;
}

.blog-post .post-meta {
  margin-bottom: 1rem;
}

.blog-post .excerpt {
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .blog-post {
    padding: 30px 25px;
    margin-bottom: 30px;
  }

  .blog-post h2 {
    font-size: 1.5rem;
  }
}

/* Documentation index */
.page-content.docs-index h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
}

.page-content.docs-index h2:first-of-type {
  margin-top: 0.5rem;
}

/* Individual doc pages */
.page-content.documentation:not(.docs-index) .doc-body h2 {
  font-size: 2rem;
}

.page-content.documentation:not(.docs-index) .doc-body h3 {
  font-size: 1.5rem;
}

/* Documentation page layout with sticky TOC */
.doc-layout {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 60px;
  align-items: start;
}

.doc-body {
  font-size: 1rem;
  line-height: 1.6;
  min-width: 0;
}

.doc-body ol,
.doc-body ul {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.doc-body ol li,
.doc-body ul li {
  margin-bottom: 0.5rem;
}

.doc-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  max-height: 45vh;
}

figure figcaption {
  text-align: center;
  font-style: italic;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.doc-toc {
  position: sticky;
  top: 80px;
}

.doc-toc-inner {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px 24px;
}

.doc-toc-title {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.doc-toc nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.doc-toc nav ul li {
  margin-bottom: 4px;
}

.doc-toc nav ul li.h3 {
  padding-left: 14px;
}

.doc-toc nav ul li a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  border-bottom: none;
  display: block;
  padding: 3px 0;
  transition: color 0.2s ease;
  line-height: 1.4;
}

.doc-toc nav ul li a:hover,
.doc-toc nav ul li a.active {
  color: var(--accent-color);
}

@media (max-width: 900px) {
  .doc-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .doc-toc {
    position: static;
    order: -1;
  }
}

.docs-list {
  max-width: 900px;
  margin: 0 auto;
}

.doc-item {
  background: var(--white);
  padding: 14px 18px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease;
}

.doc-item:hover {
  transform: translateX(4px);
  border-color: var(--accent-color);
}

.doc-item h3 {
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.doc-item h3 a {
  border-bottom: none;
  color: var(--accent-color);
}

.doc-item p {
  color: var(--text-secondary);
  margin-bottom: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 40px;
  max-width: 1200px;
  margin: 60px auto 0;
  padding: 0 40px;
}

.pricing-card {
  background: var(--white);
  padding: 50px;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pricing-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(116, 192, 252, 0.2);
  border-color: var(--accent-color);
}

.pricing-card h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.price {
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent-color);
  margin: 20px 0;
}

.price-period {
  font-size: 1.25rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.features-list {
  list-style: none;
  margin: 30px 0;
  text-align: left;
}

.features-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.features-list li:last-child {
  border-bottom: none;
}

@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .pricing-card {
    padding: 40px 30px;
  }

  .pricing-card h3 {
    font-size: 1.5rem;
  }

  .price {
    font-size: 2.5rem;
  }
}

/* About */
.about-section {
  max-width: 800px;
  margin: 0 auto;
}

.about-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  margin: 0 auto 30px;
  display: block;
  border: 4px solid var(--accent-color);
}

@media (max-width: 768px) {
  .about-photo {
    width: 150px;
    height: 150px;
    border: 3px solid var(--accent-color);
  }
}

.about-photo-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0 30px;
}

.about-photo-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid var(--border-color);
}

@media (max-width: 480px) {
  .about-photo-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Contact */
.contact-info {
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.2rem;
}

.contact-info p {
  margin-bottom: 2rem;
}

/* Footer */
.site-footer {
  background-color: var(--text-color);
  color: var(--bg-color);
  padding: 40px 0 24px;
  margin-top: 0;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

.footer-section p {
  margin-bottom: 0.5rem;
  line-height: 1.8;
}

.site-footer a {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

.site-footer a:hover {
  color: #2861c7;
  border-bottom-color: #2861c7;
}

@media (max-width: 768px) {
  .site-footer {
    padding: 40px 0 20px;
    margin-top: 60px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 20px;
  }

  .footer-section p {
    font-size: 0.95rem;
  }
}

/* ================================================
   Image Dialog / Lightbox
   ================================================ */

#img-dialog {
  z-index: 10;
  padding: 0rem;
  margin: auto;
  background: none;
  border: none;
  border-radius: 0;
  min-height: 9rem;
  animation: popin 0.3s;
  min-width: 300px;
  width: 95%;
  max-width: 1200px;
}

#img-dialog::backdrop {
  background: rgba(0, 0, 0, 0.8);
  animation: fadein_onlyopacity 0.2s ease-out;
}

#img-dialog-content {
  display: flex;
  justify-content: center;
  align-items: center;
}

#img-dialog-content img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 0.5rem;
  border: none;
  animation: none;
  height: auto;
}

#img-dialog-content img:hover {
  cursor: default;
}

.announcement-img-lightbox {
  cursor: pointer;
}

@keyframes popin {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes fadein_onlyopacity {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
