/* =========================================================
   Apple Design System — Pure CSS
   ========================================================= */

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #1d1d1f;
  background-color: #f5f5f7;
  transition: color 0.3s ease, background-color 0.3s ease;
  padding-bottom: 90px;
}

body.dark {
  color: #f5f5f7;
  background-color: #000;
}

a { color: #0071e3; text-decoration: none; transition: color 0.3s ease; }
a:hover { color: #0077ed; }

img { max-width: 100%; height: auto; display: block; }

/* --- Utility --- */
.container { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 22px; }
.section { padding: 100px 0; }
.section--small { padding: 60px 0; }

/* --- Typography --- */
.hero-title {
  font-size: clamp(48px, 8vw, 72px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin-bottom: 20px;
}

.heading-lg {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-bottom: 16px;
}

.heading-md {
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 12px;
}

.heading-sm {
  font-size: clamp(19px, 2.5vw, 24px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 10px;
}

.body-lg { font-size: 1.125rem; line-height: 1.7; }
.body-sm { font-size: 0.94rem; line-height: 1.6; }
.text-muted { opacity: 0.6; }
.text-center { text-align: center; }

/* --- Navigation --- Floating Capsule Glass iOS 26 --- */
.nav {
  position: sticky;
  top: 10px;
  z-index: 1000;
  margin: 10px 16px 0;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: saturate(180%) blur(40px) brightness(1.05);
  -webkit-backdrop-filter: saturate(180%) blur(40px) brightness(1.05);
  border: 0.5px solid rgba(255, 255, 255, 0.55);
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.45) inset,
    0 2px 8px rgba(0, 0, 0, 0.06),
    0 8px 32px rgba(0, 0, 0, 0.08);
  background-image:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.65) 0%,
      rgba(255, 255, 255, 0.25) 30%,
      rgba(255, 255, 255, 0.05) 50%,
      rgba(255, 255, 255, 0.25) 70%,
      rgba(255, 255, 255, 0.55) 100%
    );
  background-color: rgba(255, 255, 255, 0.45);
}

body.dark .nav {
  background: rgba(30, 30, 30, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.1) inset,
    0 2px 8px rgba(0, 0, 0, 0.25),
    0 8px 32px rgba(0, 0, 0, 0.35);
  background-image:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.12) 0%,
      rgba(255, 255, 255, 0.03) 30%,
      rgba(255, 255, 255, 0.0) 50%,
      rgba(255, 255, 255, 0.03) 70%,
      rgba(255, 255, 255, 0.08) 100%
    );
  background-color: rgba(30, 30, 30, 0.6);
}

.nav::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.35) 0%,
    rgba(255, 255, 255, 0.0) 50%
  );
  opacity: 0.7;
  z-index: -1;
}

body.dark .nav::before {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.0) 50%
  );
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 18px;
}

.nav__logo {
  font-size: 1.18rem;
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: -0.01em;
}

body.dark .nav__logo { color: #f5f5f7; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav__links a {
  font-size: 0.88rem;
  font-weight: 400;
  color: #1d1d1f;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

body.dark .nav__links a { color: #f5f5f7; }
.nav__links a:hover { opacity: 1; }

/* Dark mode toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.2s ease;
  color: #1d1d1f;
  line-height: 1;
}

body.dark .theme-toggle { color: #f5f5f7; }
.theme-toggle:hover { background: rgba(0,0,0,0.06); }
body.dark .theme-toggle:hover { background: rgba(255,255,255,0.1); }

/* Hamburger */
.nav__hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #1d1d1f;
}

body.dark .nav__hamburger { color: #f5f5f7; }

.nav__hamburger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  margin: 5px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav__hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__hamburger.open span:nth-child(2) { opacity: 0; }
.nav__hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile drawer menu */
.nav__mobile {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
}

.nav__mobile.open { display: block; }

.nav__mobile__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav__mobile.open .nav__mobile__overlay {
  opacity: 1;
}

.nav__mobile__drawer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 80vw;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(40px) brightness(1.08);
  -webkit-backdrop-filter: saturate(180%) blur(40px) brightness(1.08);
  transform: translateX(-100%) scale(0.96);
  opacity: 0.3;
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow:
    4px 0 24px rgba(0, 0, 0, 0.08),
    inset 0.5px 0 0 rgba(255, 255, 255, 0.5);
}

body.dark .nav__mobile__drawer {
  background: rgba(28, 28, 30, 0.88);
  box-shadow:
    4px 0 24px rgba(0, 0, 0, 0.3),
    inset 0.5px 0 0 rgba(255, 255, 255, 0.08);
}

.nav__mobile.open .nav__mobile__drawer {
  transform: translateX(0) scale(1);
  opacity: 1;
}

.nav__mobile__header {
  padding: 60px 20px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

body.dark .nav__mobile__header {
  border-bottom-color: rgba(255,255,255,0.08);
}

.nav__mobile.open .nav__mobile__header {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.04s;
}

.nav__mobile__header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1d1d1f;
}

body.dark .nav__mobile__header h3 {
  color: #f5f5f7;
}

.nav__mobile__header p {
  font-size: 0.82rem;
  color: #86868b;
  margin-top: 4px;
}

.nav__mobile__links {
  padding: 12px 0;
  flex: 1;
}

.nav__mobile__links a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 500;
  color: #1d1d1f;
  transition: background 0.15s ease, transform 0.25s ease, opacity 0.25s ease;
  opacity: 0;
  transform: translateX(-16px);
}

.nav__mobile.open .nav__mobile__links a {
  opacity: 1;
  transform: translateX(0);
}

.nav__mobile.open .nav__mobile__links a:nth-child(1) { transition-delay: 0.06s; }
.nav__mobile.open .nav__mobile__links a:nth-child(2) { transition-delay: 0.10s; }
.nav__mobile.open .nav__mobile__links a:nth-child(3) { transition-delay: 0.14s; }
.nav__mobile.open .nav__mobile__links a:nth-child(4) { transition-delay: 0.18s; }

body.dark .nav__mobile__links a {
  color: #f5f5f7;
}

.nav__mobile__links a:hover {
  background: rgba(0,0,0,0.04);
}

body.dark .nav__mobile__links a:hover {
  background: rgba(255,255,255,0.06);
}

.nav__mobile__links a svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav__mobile__footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(0,0,0,0.08);
}

body.dark .nav__mobile__footer {
  border-top-color: rgba(255,255,255,0.08);
}

.nav__mobile__footer a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 0.94rem;
  font-weight: 500;
  color: #1d1d1f;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.nav__mobile.open .nav__mobile__footer a {
  opacity: 1;
  transition-delay: 0.22s;
}

body.dark .nav__mobile__footer a {
  color: #f5f5f7;
}

/* =========================================================
   iOS 26 Bottom Tab Bar (mobile only)
   ========================================================= */
.bottom-bar {
  display: none;
  position: fixed;
  bottom: 12px;
  left: 16px;
  right: 16px;
  z-index: 1001;
  background: rgba(29, 29, 31, 0.78);
  backdrop-filter: saturate(180%) blur(32px) brightness(1.08);
  -webkit-backdrop-filter: saturate(180%) blur(32px) brightness(1.08);
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 30px;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  background-image:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.22) 0%,
      rgba(255, 255, 255, 0.04) 40%,
      rgba(255, 255, 255, 0.18) 100%
    );
  background-color: rgba(29, 29, 31, 0.78);
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.12) inset,
    0 4px 16px rgba(0, 0, 0, 0.15),
    0 8px 32px rgba(0, 0, 0, 0.12);
}

body:not(.dark) .bottom-bar {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.6) inset,
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.06);
  background-image:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.75) 0%,
      rgba(255, 255, 255, 0.25) 40%,
      rgba(255, 255, 255, 0.65) 100%
    );
  background-color: rgba(255, 255, 255, 0.78);
}

.bottom-bar__inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 500px;
  margin: 0 auto;
  padding: 0 4px;
}

.bottom-bar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 12px;
  transition: background 0.2s ease;
  min-width: 56px;
}

.bottom-bar__item:hover {
  background: rgba(255, 255, 255, 0.1);
}

body:not(.dark) .bottom-bar__item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.bottom-bar__item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body:not(.dark) .bottom-bar__item svg {
  stroke: rgba(0, 0, 0, 0.5);
}

.bottom-bar__item.active svg {
  stroke: #0a84ff;
}

body:not(.dark) .bottom-bar__item.active svg {
  stroke: #007aff;
}

.bottom-bar__item span {
  font-size: 0.62rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.01em;
}

body:not(.dark) .bottom-bar__item span {
  color: rgba(0, 0, 0, 0.5);
}

.bottom-bar__item.active span {
  color: #0a84ff;
}

body:not(.dark) .bottom-bar__item.active span {
  color: #007aff;
}


/* =========================================================
   Hero
   ========================================================= */
.hero {
  padding: 140px 0 100px;
  text-align: center;
  background: linear-gradient(180deg, #f5f5f7 0%, #ffffff 100%);
}

body.dark .hero {
  background: linear-gradient(180deg, #000000 0%, #111111 100%);
}

.hero__subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 400;
  color: #6e6e73;
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

body.dark .hero__subtitle { color: #86868b; }

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 980px;
  background: #0071e3;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  transition: background 0.3s ease, transform 0.2s ease;
}

.hero__cta:hover {
  background: #0077ed;
  color: #fff;
  transform: scale(1.02);
}

/* --- Cards (Articles) --- */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.dark .card {
  background: #1c1c1e;
  border-color: rgba(255, 255, 255, 0.08);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

body.dark .card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.card__image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card__body { padding: 24px; }

.card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #86868b;
  margin-bottom: 8px;
}

body.dark .card__meta { color: #6e6e73; }

.card__read-time {
  display: inline-flex;
  align-items: center;
}

.card__category {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0071e3;
  margin-bottom: 8px;
}

.card__title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 8px;
  color: #1d1d1f;
}

body.dark .card__title { color: #f5f5f7; }

.card__excerpt {
  font-size: 0.94rem;
  color: #6e6e73;
  line-height: 1.5;
}

body.dark .card__excerpt { color: #86868b; }

/* --- About Section --- */
.about__image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 24px;
  border: 3px solid rgba(0,113,227,0.15);
}

.about__content {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.about__content p {
  font-size: 1.125rem;
  line-height: 1.7;
  color: #6e6e73;
  margin-top: 16px;
}

body.dark .about__content p { color: #86868b; }

/* --- Contact Form --- */
.form {
  max-width: 580px;
  margin: 0 auto;
}

.form__group {
  margin-bottom: 24px;
}

.form__label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: #1d1d1f;
}

body.dark .form__label { color: #f5f5f7; }

.form__input,
.form__textarea {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid #d2d2d7;
  background: #fff;
  color: #1d1d1f;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  outline: none;
}

body.dark .form__input,
body.dark .form__textarea {
  background: #1c1c1e;
  border-color: #38383a;
  color: #f5f5f7;
}

.form__input:focus,
.form__textarea:focus {
  border-color: #0071e3;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.form__textarea { min-height: 160px; resize: vertical; }

.form__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 40px;
  border-radius: 980px;
  border: none;
  background: #0071e3;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  width: 100%;
}

.form__btn:hover { background: #0077ed; transform: scale(1.01); }

/* Alert messages */
.alert {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 0.94rem;
  font-weight: 500;
}

.alert--success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

body.dark .alert--success {
  background: rgba(46, 125, 50, 0.15);
  color: #81c784;
  border-color: rgba(46, 125, 50, 0.3);
}

/* --- Article Show --- */
.article-header {
  padding: 100px 0 40px;
  text-align: center;
}

.article-header .card__category { margin-bottom: 16px; }

.article-header .heading-lg {
  max-width: 720px;
  margin: 0 auto 16px;
}

.article-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: #86868b;
  margin-bottom: 12px;
}

.article-meta__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #86868b;
  display: inline-block;
}

body.dark .article-meta { color: #6e6e73; }
body.dark .article-meta__dot { background: #6e6e73; }

.article-content {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.125rem;
  line-height: 1.8;
  color: #1d1d1f;
}

body.dark .article-content { color: #e5e5e7; }

.article-content p { margin-bottom: 24px; }
.article-content h2 { font-size: 1.75rem; font-weight: 600; margin: 40px 0 16px; }
.article-content h3 { font-size: 1.375rem; font-weight: 600; margin: 32px 0 12px; }
.article-content ul, .article-content ol { padding-left: 24px; margin-bottom: 24px; }
.article-content li { margin-bottom: 8px; }
.article-content img { border-radius: 12px; margin: 32px 0; }
.article-content blockquote {
  border-left: 3px solid #0071e3;
  padding-left: 20px;
  margin: 32px 0;
  font-style: italic;
  opacity: 0.8;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 0.94rem;
  font-weight: 500;
  transition: background 0.2s ease;
  border: 1px solid rgba(0,0,0,0.08);
}

body.dark .pagination a, body.dark .pagination span {
  border-color: rgba(255,255,255,0.1);
}

.pagination a {
  background: #fff;
  color: #1d1d1f;
}

body.dark .pagination a { background: #1c1c1e; color: #f5f5f7; }
.pagination a:hover { background: #0071e3; color: #fff; border-color: #0071e3; }

.pagination .active {
  background: #0071e3;
  color: #fff;
  border-color: #0071e3;
}

/* --- Footer --- */
.footer {
  padding: 40px 0;
  text-align: center;
  font-size: 0.82rem;
  color: #6e6e73;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

body.dark .footer {
  color: #86868b;
  border-top-color: rgba(255, 255, 255, 0.06);
}

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: 60px 0;
  opacity: 0.6;
}

/* --- Admin link --- */
.admin-link {
  font-size: 0.82rem;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.admin-link:hover { opacity: 1; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav__hamburger { display: block; }
  .bottom-bar { display: block; }
  body { padding-bottom: 90px; }

  .section { padding: 60px 0; }
  .hero { padding: 80px 0 60px; }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .container { padding: 0 20px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================================================
   Animations
   ========================================================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 0.6s ease forwards;
}

.animate-in-delay { animation-delay: 0.15s; opacity: 0; }


/* --- Articles Section (dark mode safe) --- */
.section--articles {
  background: #fff;
}

body.dark .section--articles {
  background: #0a0a0a;
}

.section--articles .card {
  background: #fff;
}

body.dark .section--articles .card {
  background: #1c1c1e;
}


@media (max-width: 768px) {
  .nav {
    margin: 6px 10px 0;
    border-radius: 24px;
  }
  .hero { padding-top: 100px; }
}

@media (max-width: 480px) {
  .nav {
    margin: 4px 6px 0;
    border-radius: 22px;
  }
  .nav__inner { padding: 0 12px; height: 44px; }
  .hero { padding-top: 80px; }
}

@media (max-width: 480px) {
  .bottom-bar {
    left: 6px;
    right: 6px;
    bottom: 4px;
    border-radius: 24px;
    padding: 4px 2px calc(4px + env(safe-area-inset-bottom, 0px));
  }
}
