/* ============================================================
   FileMakerX — Apple-inspired Stylesheet
   css/style.css
   ============================================================ */

/* ─── Design Tokens (Light / Apple Default) ──────────────── */
:root {
  --bg:        #ffffff;
  --bg2:       #f5f5f7;
  --bg3:       #fbfbfd;
  --surface:   #ffffff;
  --surface2:  #f5f5f7;
  --border:    rgba(0,0,0,.08);
  --border2:   rgba(0,0,0,.15);
  --txt:       #1d1d1f;
  --txt-muted: #6e6e73;
  --txt-dim:   #acacac;
  --accent:    #0071e3;
  --accent2:   #0077ed;
  --gold:      #f5a623;
  --gold2:     #fbbf24;
  --green:     #34c759;
  --r:         18px;
  --r-sm:      10px;
  --max-w:     1200px;
}

/* ─── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 17px; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.47059;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--txt-dim); border-radius: 2px; }

/* ─── Navigation ─────────────────────────────────────────────── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 48px;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  font-weight: 600; font-size: 1rem;
  color: var(--txt); text-decoration: none;
  display: flex; align-items: center; gap: .2rem;
  letter-spacing: -.01em;
}
.nav-logo:hover { text-decoration: none; color: var(--txt); }
.nav-logo-b { color: var(--accent); }
.nav-logo-dot {
  width: 5px; height: 5px;
  background: var(--accent); border-radius: 50%; margin-left: 1px;
  animation: pulse 2s infinite; display: inline-block;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.7)} }
.nav-links { display: flex; gap: 1.75rem; list-style: none; }
.nav-links a {
  font-size: .8235rem;
  color: var(--txt-muted); text-decoration: none; transition: color .15s;
  font-weight: 400;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); text-decoration: none; }
.nav-cta {
  background: var(--accent); color: #fff;
  padding: .4rem 1.1rem; font-size: .8235rem;
  font-weight: 400;
  border-radius: 980px;
  text-decoration: none;
  transition: filter .2s;
  white-space: nowrap;
}
.nav-cta:hover { filter: brightness(1.12); text-decoration: none; color: #fff; }

/* ─── Mobile nav ─────────────────────────────────────────────── */
.hamburger {
  display: none; background: none; border: none;
  padding: .4rem .5rem; cursor: pointer; color: var(--txt);
  font-size: 1.2rem; line-height: 1;
}
.mobile-menu {
  display: none; position: fixed; top: 48px; left: 0; right: 0;
  background: rgba(255,255,255,.97);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem 1.5rem; z-index: 199;
}
.mobile-menu.open { display: block; }
.mobile-menu ul { list-style: none; display: flex; flex-direction: column; gap: .8rem; }
.mobile-menu a {
  font-size: 1rem; color: var(--txt); text-decoration: none;
  font-weight: 400; display: block; padding: .3rem 0;
  border-bottom: 1px solid var(--border);
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: var(--accent); text-decoration: none; }

/* ─── Page Header ────────────────────────────────────────────── */
.page-header {
  padding: 100px 4rem 5rem;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.page-header::before { display: none; }
.page-header-inner {
  position: relative; z-index: 1;
  max-width: var(--max-w); margin: 0 auto;
}
.breadcrumb {
  display: flex; align-items: center; gap: .4rem;
  font-size: .7647rem;
  color: var(--txt-muted); margin-bottom: 1.5rem; flex-wrap: wrap;
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--txt-muted); }
.page-header h1 {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 700; line-height: 1.07143; letter-spacing: -.035em;
  margin-bottom: 1.2rem; color: var(--txt);
}
.page-header h1 em { font-style: normal; color: var(--accent); }
.page-header .lead {
  font-size: 1.176rem; color: var(--txt-muted);
  max-width: 60ch; line-height: 1.52381;
}
.page-header-meta {
  display: flex; align-items: center; gap: 2rem;
  margin-top: 2rem; flex-wrap: wrap;
}
.meta-item {
  font-size: .7647rem;
  color: var(--txt-muted);
}
.meta-item strong { color: var(--accent); font-weight: 600; }

/* ─── Main Layout ────────────────────────────────────────────── */
.site-main {
  max-width: var(--max-w); margin: 0 auto;
  padding: 5rem 4rem;
  display: grid; grid-template-columns: 1fr 300px;
  gap: 4rem; align-items: start;
}

/* ─── Article Content ────────────────────────────────────────── */
.article-content h2 {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700; line-height: 1.125; letter-spacing: -.025em;
  margin: 3.5rem 0 1rem; color: var(--txt);
}
.article-content h2:first-of-type { margin-top: 0; }
.article-content h3 {
  font-size: 1.0588rem; font-weight: 600;
  margin: 2rem 0 .6rem; color: var(--txt); letter-spacing: -.01em;
}
.article-content p {
  font-size: 1rem; color: var(--txt-muted);
  margin-bottom: 1.4rem; line-height: 1.7;
}
.article-content strong { color: var(--txt); font-weight: 600; }
.article-content em { color: var(--accent); font-style: normal; }
.article-content ul, .article-content ol {
  margin: 0 0 1.4rem 1.5rem; color: var(--txt-muted); font-size: 1rem;
}
.article-content li { margin-bottom: .5rem; line-height: 1.7; }
.article-content a { color: var(--accent); }
.article-content a:hover { text-decoration: underline; }

/* Figure */
.article-figure {
  margin: 2.5rem 0;
  overflow: hidden; background: var(--bg2);
  border-radius: var(--r);
}
.article-figure img { width: 100%; height: 280px; object-fit: cover; }
.article-figure figcaption {
  padding: .8rem 1.2rem; font-size: .7647rem;
  color: var(--txt-muted); text-align: center;
}

/* Highlight / quote box */
.highlight-box {
  border-left: 3px solid var(--accent);
  background: var(--bg2);
  padding: 1.5rem 2rem; margin: 2.5rem 0;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.highlight-box p { margin: 0; color: var(--txt-muted); font-size: 1rem; line-height: 1.7; }
.highlight-box cite {
  display: block; margin-top: .8rem;
  font-size: .7647rem; color: var(--txt-dim);
}

/* ─── Feature Grid ───────────────────────────────────────────── */
.feature-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1rem; margin: 1.5rem 0 2rem;
}
.feature-card {
  background: var(--bg2); border: none;
  padding: 1.75rem; position: relative; overflow: hidden;
  transition: transform .3s cubic-bezier(.25,.46,.45,.94), box-shadow .3s;
  border-radius: var(--r);
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
}
.feature-card::before { display: none; }
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 8px 40px rgba(0,0,0,.1); }
.feature-icon { font-size: 1.75rem; margin-bottom: 1rem; display: block; }
.feature-card h3 { font-size: 1rem; font-weight: 600; margin: 0 0 .5rem; color: var(--txt); letter-spacing: -.01em; }
.feature-card p { font-size: .882rem; color: var(--txt-muted); margin: 0; line-height: 1.65; }

/* ─── Info List ──────────────────────────────────────────────── */
.info-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.info-list li {
  display: flex; align-items: flex-start; gap: .8rem;
  padding: .9rem 0; border-bottom: 1px solid var(--border);
  font-size: .9412rem; color: var(--txt-muted);
}
.info-list li:last-child { border-bottom: none; }
.info-list li::before {
  content: '↗'; color: var(--accent);
  flex-shrink: 0; margin-top: .05rem; font-size: .9rem;
}
.info-list strong { color: var(--txt); font-weight: 600; }

/* ─── FAQ ────────────────────────────────────────────────────── */
.faq-section { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.faq-item {
  background: var(--bg2); border: none;
  padding: 1.25rem 1.5rem; cursor: pointer; margin-bottom: .5rem;
  transition: background .2s; border-radius: var(--r-sm);
}
.faq-item:hover { background: #eee; }
.faq-q {
  font-size: .9412rem; font-weight: 600; color: var(--txt);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  letter-spacing: -.01em;
}
.faq-q .ic {
  color: var(--accent); font-size: 1.2rem; flex-shrink: 0;
  transition: transform .2s; line-height: 1;
}
.faq-item.open .faq-q .ic { transform: rotate(45deg); }
.faq-a {
  font-size: .882rem; color: var(--txt-muted);
  line-height: 1.7; margin-top: .8rem; display: none;
}
.faq-item.open .faq-a { display: block; }

/* ─── Sidebar ────────────────────────────────────────────────── */
.sidebar { position: sticky; top: 68px; }
.sidebar-widget {
  background: var(--bg2); border: none;
  border-radius: var(--r);
  padding: 1.5rem; margin-bottom: 1.2rem;
}
.sidebar-widget h3 {
  font-size: .7647rem;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--txt-dim); margin-bottom: 1rem; font-weight: 600;
}
.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li a {
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem 0; border-bottom: 1px solid var(--border);
  font-size: .882rem; color: var(--txt-muted);
  text-decoration: none; transition: color .15s;
}
.sidebar-nav li:last-child a { border-bottom: none; }
.sidebar-nav li a:hover { color: var(--accent); text-decoration: none; }
.sidebar-nav li a.active { color: var(--accent); font-weight: 600; }
.sidebar-nav li a::before {
  content: '›'; color: var(--txt-dim);
  font-size: 1.1rem; flex-shrink: 0;
}
.sidebar-nav li a.active::before { color: var(--accent); }
.cta-box {
  background: linear-gradient(145deg, var(--accent) 0%, #1d4ed8 100%);
  padding: 1.75rem; text-align: center;
  border-radius: var(--r);
}
.cta-box h3 {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.1rem; font-weight: 700; color: #fff; margin-bottom: .7rem;
  letter-spacing: -.015em;
}
.cta-box p { font-size: .835rem; color: rgba(255,255,255,.8); margin-bottom: 1.2rem; line-height: 1.55; }
.cta-box a {
  display: inline-block;
  background: #fff; color: var(--accent);
  padding: .55rem 1.4rem; border-radius: 980px;
  font-size: .835rem; letter-spacing: 0;
  text-decoration: none; font-weight: 600; transition: box-shadow .15s;
}
.cta-box a:hover { text-decoration: none; box-shadow: 0 4px 16px rgba(0,0,0,.25); }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn-glow {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .75rem 1.75rem;
  background: var(--accent);
  color: #fff;
  font-size: .9412rem; font-weight: 400;
  text-decoration: none; border-radius: 980px;
  transition: filter .2s;
  box-shadow: none; text-transform: none; letter-spacing: 0;
}
.btn-glow:hover { filter: brightness(1.12); text-decoration: none; color: #fff; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .75rem 1.75rem; background: transparent; color: var(--accent);
  font-size: .9412rem; letter-spacing: 0; text-transform: none;
  text-decoration: none; border: 1px solid var(--accent);
  transition: background .2s; border-radius: 980px;
  font-weight: 400;
}
.btn-ghost:hover { background: rgba(0,113,227,.06); text-decoration: none; }

/* ─── Tags ───────────────────────────────────────────────────── */
.tag {
  display: inline-block; padding: .25rem .75rem;
  font-size: .7647rem; letter-spacing: 0;
  background: rgba(0,113,227,.1); color: var(--accent);
  border: 1px solid rgba(0,113,227,.15); border-radius: 980px;
  margin: .2rem; font-weight: 500;
}
.tag-gold { background: rgba(245,166,35,.1); color: #b45309; border-color: rgba(245,166,35,.2); }
.tag-green { background: rgba(52,199,89,.1); color: #15803d; border-color: rgba(52,199,89,.2); }

/* ─── Section Tag ────────────────────────────────────────────── */
.stag {
  font-size: .7647rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .8rem; display: block; font-weight: 600;
}
.stag::before { content: none; }

/* ─── Stats Row ──────────────────────────────────────────────── */
.stats-row {
  display: flex; gap: 3rem; flex-wrap: wrap;
  padding: 2.5rem 0; border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.stat-num {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  font-size: 2.5rem; line-height: 1; color: var(--txt);
  font-weight: 700; letter-spacing: -.04em;
}
.stat-num sup { font-size: 1rem; color: var(--accent); font-weight: 400; }
.stat-lbl {
  font-size: .7647rem; letter-spacing: 0;
  color: var(--txt-muted); margin-top: .4rem;
}

/* ─── Related Pages ──────────────────────────────────────────── */
.related-pages {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 5rem 4rem;
}
.related-pages-inner { max-width: var(--max-w); margin: 0 auto; }
.related-pages h2 {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700; letter-spacing: -.03em;
  margin-bottom: 2.5rem; line-height: 1.1;
}
.related-pages h2 em { font-style: normal; color: var(--accent); }
.related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.related-card {
  background: var(--surface); border-radius: var(--r);
  padding: 1.5rem; position: relative; overflow: hidden;
  transition: transform .3s cubic-bezier(.25,.46,.45,.94), box-shadow .3s;
  text-decoration: none; display: block; color: var(--txt);
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  border: none;
}
.related-card::before { display: none; }
.related-card:hover { transform: scale(1.02); box-shadow: 0 8px 30px rgba(0,0,0,.1); text-decoration: none; }
.related-card-cat {
  font-size: .7647rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .7rem; font-weight: 600;
}
.related-card h3 { font-size: .9412rem; font-weight: 600; color: var(--txt); margin-bottom: .4rem; letter-spacing: -.01em; }
.related-card p { font-size: .8235rem; color: var(--txt-muted); line-height: 1.6; margin: 0; }
.related-card-arrow { margin-top: .8rem; font-size: .8235rem; color: var(--accent); }

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 4rem;
}
.ft-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem; margin-bottom: 3rem;
  max-width: var(--max-w); margin-left: auto; margin-right: auto;
}
.ft-brand p {
  font-size: .8235rem; color: var(--txt-muted);
  line-height: 1.7; max-width: 28ch; margin-top: 1rem;
}
.ft-col h4 {
  font-size: .7647rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--txt-dim); margin-bottom: 1rem; font-weight: 600;
}
.ft-col ul { list-style: none; display: flex; flex-direction: column; gap: .65rem; }
.ft-col a { font-size: .8235rem; color: var(--txt-muted); text-decoration: none; transition: color .15s; }
.ft-col a:hover { color: var(--accent); }
.ft-btm {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 1.5rem; border-top: 1px solid var(--border);
  flex-wrap: wrap; gap: 1rem;
  max-width: var(--max-w); margin: 0 auto;
}
.ft-btm p { font-size: .7647rem; color: var(--txt-muted); }
.ft-btm a { color: var(--txt-muted); text-decoration: none; }
.ft-btm a:hover { color: var(--accent); }

/* ─── Animations ─────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
.reveal.on { opacity: 1; transform: none; }
.rl { opacity: 0; transform: translateX(-20px); transition: opacity .7s ease, transform .7s ease; }
.rl.on { opacity: 1; transform: none; }
.rr { opacity: 0; transform: translateX(20px); transition: opacity .7s ease, transform .7s ease; }
.rr.on { opacity: 1; transform: none; }
.d1 { transition-delay: .1s; } .d2 { transition-delay: .2s; } .d3 { transition-delay: .3s; }
.d4 { transition-delay: .4s; } .d5 { transition-delay: .5s; }

/* ─── Article CTA strip ──────────────────────────────────────── */
.article-ctas {
  display: flex; gap: 1rem; flex-wrap: wrap;
  margin-top: 3rem; padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .site-nav { padding: 0 1rem; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .hamburger { display: block; }
  .page-header { padding: 80px 1.5rem 3rem; }
  .site-main { padding: 3rem 1.5rem; grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .feature-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .ft-grid { grid-template-columns: 1fr 1fr; gap: 2rem; padding: 0 1.5rem; margin-bottom: 2.5rem; }
  .site-footer { padding: 3rem 1.5rem; }
  .related-pages { padding: 3rem 1.5rem; }
  .stats-row { gap: 2rem; }
}
@media (max-width: 640px) {
  .related-grid { grid-template-columns: 1fr; }
  .ft-grid { grid-template-columns: 1fr; }
  .stats-row { gap: 1.5rem; }
  .page-header h1 { font-size: 2rem; }
  .article-ctas { flex-direction: column; }
}

/* ─── Dark Mode ──────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:        #000000;
  --bg2:       #1c1c1e;
  --bg3:       #2c2c2e;
  --surface:   #1c1c1e;
  --surface2:  #2c2c2e;
  --border:    rgba(255,255,255,.1);
  --border2:   rgba(255,255,255,.18);
  --txt:       #f5f5f7;
  --txt-muted: #a1a1a6;
  --txt-dim:   #636366;
  --accent:    #0a84ff;
  --accent2:   #409cff;
  --green:     #30d158;
}
[data-theme="dark"] body {
  background: var(--bg);
  color: var(--txt);
}
[data-theme="dark"] .site-nav {
  background: rgba(0,0,0,.85);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .mobile-menu {
  background: rgba(28,28,30,.97);
}
[data-theme="dark"] .page-header {
  background: #0a0a0a;
}
[data-theme="dark"] .feature-card {
  background: var(--bg2);
  box-shadow: none;
}
[data-theme="dark"] .feature-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
[data-theme="dark"] .related-card {
  background: var(--surface);
  box-shadow: none;
}
[data-theme="dark"] .related-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
[data-theme="dark"] .sidebar-widget {
  background: var(--bg2);
}
[data-theme="dark"] .faq-item {
  background: var(--bg2);
}
[data-theme="dark"] .faq-item:hover {
  background: var(--bg3);
}
[data-theme="dark"] .highlight-box {
  background: var(--bg2);
}
[data-theme="dark"] .related-pages {
  background: var(--bg2);
}
[data-theme="dark"] .site-footer {
  background: var(--bg2);
}
[data-theme="dark"] .tag-gold { color: var(--gold2); }
[data-theme="dark"] .tag-green { color: #30d158; }

/* ─── Theme Toggle Button ────────────────────────────────────── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--txt-muted);
  cursor: pointer;
  padding: .3rem .65rem;
  border-radius: 980px;
  font-size: .8rem;
  display: flex;
  align-items: center;
  gap: .3rem;
  transition: border-color .2s, color .2s;
  margin-left: .5rem;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--txt);
}
.theme-toggle .t-icon { font-size: .9rem; line-height: 1; }
.theme-toggle .t-label { font-size: .75rem; }
