/* ==========================================================================
   123Essays.net — Clean Minimalist Design System
   Static rebuild. Performance-first: system fonts, no render-blocking deps.
   ========================================================================== */

:root {
  /* Color */
  --ink:        #15161b;
  --muted:      #5b6270;
  --faint:      #8a909c;
  --bg:         #ffffff;
  --bg-soft:    #f6f7f9;
  --bg-sink:    #eef1f5;
  --line:       #e7e9ee;
  --line-strong:#d3d8e0;
  --brand:      #16335c;   /* deep navy — trust */
  --brand-700:  #0f2342;
  --accent:     #1aa292;   /* teal — modern, fresh */
  --accent-700: #0f7d70;
  --gold:       #f5b50a;   /* ratings */
  --danger:     #c0392b;
  --link:       #155e9c;

  /* Type */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Fluid type scale */
  --fs-xs:   0.8125rem;
  --fs-sm:   0.9375rem;
  --fs-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --fs-lg:   clamp(1.125rem, 1.07rem + 0.3vw, 1.25rem);
  --fs-h4:   clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem);
  --fs-h3:   clamp(1.35rem, 1.15rem + 0.9vw, 1.7rem);
  --fs-h2:   clamp(1.6rem, 1.3rem + 1.4vw, 2.15rem);
  --fs-h1:   clamp(2rem, 1.5rem + 2.4vw, 3rem);
  --fs-hero: clamp(2.3rem, 1.6rem + 3.4vw, 3.75rem);

  /* Space */
  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2rem; --sp-7: 3rem; --sp-8: 4rem; --sp-9: 6rem;

  /* Shape */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow:    0 4px 12px rgba(16,24,40,.06), 0 2px 4px rgba(16,24,40,.04);
  --shadow-lg: 0 18px 40px rgba(16,24,40,.10);
  --maxw: 1120px;
  --readw: 720px;
}

/* Reset */
*,*::before,*::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img,svg,video { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 700; }
ul,ol { padding-left: 1.3em; }

/* Layout helpers */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.prose { max-width: var(--readw); }
.center { text-align: center; }
.muted { color: var(--muted); }
.eyebrow {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent-700);
}
.section { padding-block: clamp(2.5rem, 6vw, 5rem); }
.section--soft { background: var(--bg-soft); }
.grid { display: grid; gap: var(--sp-5); }
@media (min-width:640px){ .grid-2 { grid-template-columns: repeat(2,1fr); } }
@media (min-width:880px){ .grid-3 { grid-template-columns: repeat(3,1fr); } .grid-4 { grid-template-columns: repeat(4,1fr); } }

/* Headings */
h1,h2,h3,h4 { line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 750; }
h4 { font-size: var(--fs-h4); font-weight: 700; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9); backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: var(--sp-5); }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 30px; height: 30px; display: grid; place-items: center; background: var(--brand); color:#fff; border-radius: 8px; font-weight: 900; font-size: .95rem; }
.brand b { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: clamp(.6rem,1.6vw,1.4rem); list-style: none; padding: 0; margin: 0; }
.nav-links a { color: var(--ink); font-weight: 600; font-size: var(--fs-sm); }
.nav-links a:hover { color: var(--brand); text-decoration: none; }
.nav-cta { background: var(--brand); color: #fff !important; padding: .5rem .95rem; border-radius: 999px; }
.nav-cta:hover { background: var(--brand-700); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: .4rem; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 4px 0; transition: .2s; }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column;
    align-items: stretch; gap: 0; background: #fff; border-bottom: 1px solid var(--line);
    padding: var(--sp-3) clamp(1rem,4vw,2rem); box-shadow: var(--shadow); display: none;
  }
  .nav[data-open="true"] .nav-links { display: flex; }
  .nav-links li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
  .nav-links li:last-child { border-bottom: 0; }
  .nav-cta { display: inline-block; text-align: center; margin-top: .4rem; }
}

/* ---------- Dropdown submenus ---------- */
.nav-links .has-sub { position: relative; }
.nav-links .caret { font-size: .65em; opacity: .65; margin-left: 1px; }
.submenu {
  list-style: none; margin: 0; padding: .4rem;
  position: absolute; top: 100%; left: 0; min-width: 250px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); display: none; flex-direction: column; gap: 2px; z-index: 60;
}
.nav-links .has-sub:hover > .submenu,
.nav-links .has-sub:focus-within > .submenu { display: flex; }
.submenu li { padding: 0 !important; border: 0 !important; }
.submenu a { display: block; padding: .55rem .7rem; border-radius: 8px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink); white-space: nowrap; }
.submenu a:hover { background: var(--bg-soft); color: var(--brand); text-decoration: none; }
@media (max-width: 860px) {
  .nav-links .has-sub { position: static; }
  .nav-links .caret { display: none; }
  .submenu {
    position: static; display: flex; box-shadow: none; border: 0;
    border-left: 2px solid var(--line); border-radius: 0; min-width: 0;
    margin: .25rem 0 .5rem .4rem; padding: 0 0 0 .6rem;
  }
  .submenu a { padding: .45rem 0; font-weight: 500; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; font-size: var(--fs-sm);
  padding: .7rem 1.3rem; border-radius: 999px; border: 1px solid transparent; cursor: pointer; transition: .15s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-700); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-700); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3rem, 7vw, 6rem); background:
  radial-gradient(1200px 500px at 80% -10%, rgba(26,162,146,.10), transparent 60%),
  radial-gradient(900px 500px at 0% 0%, rgba(22,51,92,.07), transparent 55%); }
.hero h1 { font-size: var(--fs-hero); max-width: 16ch; }
.hero p.lead { font-size: var(--fs-lg); color: var(--muted); max-width: 56ch; margin-top: var(--sp-4); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-6); }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: var(--sp-4); }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-5); text-align: center; }
.stat .num { font-size: clamp(1.8rem,1.2rem+2vw,2.6rem); font-weight: 900; color: var(--brand); letter-spacing: -.03em; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--sp-2); }

/* ---------- Cards ---------- */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: .18s; display: flex; flex-direction: column; }
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: var(--line-strong); }
.card .thumb { aspect-ratio: 16/9; object-fit: cover; width: 100%; background: var(--bg-sink); }
.card .body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; }
.card .tag { font-size: var(--fs-xs); font-weight: 700; color: var(--accent-700); text-transform: uppercase; letter-spacing: .05em; }
.card h3 { font-size: var(--fs-h4); }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--brand); text-decoration: none; }
.card .meta { font-size: var(--fs-xs); color: var(--faint); margin-top: auto; }

/* ---------- Article ---------- */
.article-head { padding-top: var(--sp-6); }
.breadcrumb { font-size: var(--fs-xs); color: var(--faint); display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; list-style: none; padding: 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb li::after { content: "/"; margin-left: .4rem; color: var(--line-strong); }
.breadcrumb li:last-child::after { content: ""; }
.article-head h1 { margin-top: var(--sp-3); max-width: 22ch; }
.article-meta { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center; color: var(--muted); font-size: var(--fs-sm); margin-top: var(--sp-4); }
.article-meta .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color:#fff; display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.article-hero { width: 100%; aspect-ratio: 16/8; object-fit: cover; border-radius: var(--radius); margin-block: var(--sp-6); }

.article-layout { display: grid; gap: var(--sp-7); }
@media (min-width: 1000px) { .article-layout { grid-template-columns: minmax(0,1fr) 280px; align-items: start; } }
.article-body { max-width: var(--readw); }
.article-body > * + * { margin-top: var(--sp-5); }
.article-body h2 { margin-top: var(--sp-7); scroll-margin-top: 90px; }
.article-body h3 { margin-top: var(--sp-6); scroll-margin-top: 90px; }
.article-body p, .article-body li { font-size: var(--fs-base); }
.article-body ul, .article-body ol { display: flex; flex-direction: column; gap: .4rem; }
.article-body a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(21,94,156,.35); }
.article-body a:hover { text-decoration-color: var(--link); }
.article-body img { border-radius: var(--radius); }
.article-body figure { margin-block: var(--sp-6); }
.article-body figcaption { font-size: var(--fs-sm); color: var(--faint); text-align: center; margin-top: var(--sp-2); }

/* ---------- Sidebar / TOC ---------- */
.sidebar { position: sticky; top: 90px; display: flex; flex-direction: column; gap: var(--sp-5); }
@media (max-width: 999px){ .sidebar { position: static; } }
.toc { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-5); background: var(--bg-soft); }
.toc h4 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: var(--sp-3); }
.toc ol { list-style: none; padding: 0; counter-reset: toc; display: flex; flex-direction: column; gap: .35rem; }
.toc li { counter-increment: toc; font-size: var(--fs-sm); }
.toc a { color: var(--ink); }
.toc a:hover { color: var(--brand); text-decoration: none; }

/* ---------- Content components ---------- */
.callout { border-radius: var(--radius); padding: var(--sp-5) var(--sp-5); border: 1px solid var(--line); background: var(--bg-soft); }
.callout--key { border-left: 4px solid var(--accent); background: #f0faf8; }
.callout--info { border-left: 4px solid var(--link); background: #eef5fb; }
.callout--warn { border-left: 4px solid var(--gold); background: #fef8e8; }
.callout h4 { font-size: var(--fs-base); margin-bottom: var(--sp-2); display: flex; align-items: center; gap: .5rem; }
.callout ul { margin: 0; }

.pullquote { border: 0; border-left: 4px solid var(--brand); padding: var(--sp-2) 0 var(--sp-2) var(--sp-5);
  font-family: var(--serif); font-size: var(--fs-lg); font-style: italic; color: var(--brand-700); }
.pullquote cite { display: block; font-style: normal; font-family: var(--sans); font-size: var(--fs-sm); color: var(--muted); margin-top: var(--sp-2); }

/* Tables */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 520px; }
table.data th, table.data td { padding: .75rem .9rem; text-align: left; border-bottom: 1px solid var(--line); }
table.data thead th { background: var(--brand); color: #fff; font-weight: 700; white-space: nowrap; }
table.data tbody tr:nth-child(even) { background: var(--bg-soft); }
table.data tbody tr:hover { background: #eef5fb; }

/* Stat strip inline */
.stat-inline { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: var(--sp-4); margin-block: var(--sp-6); }
.stat-inline .s { text-align: center; padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); }
.stat-inline .s b { display: block; font-size: 1.8rem; font-weight: 900; color: var(--accent-700); line-height: 1; }
.stat-inline .s span { font-size: var(--fs-xs); color: var(--muted); }

/* Process / flow steps */
.flow { display: grid; gap: var(--sp-4); counter-reset: step; margin-block: var(--sp-5); }
.flow .step { display: grid; grid-template-columns: 44px 1fr; gap: var(--sp-4); align-items: start; }
.flow .step::before { counter-increment: step; content: counter(step); width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 800; display: grid; place-items: center; }
.flow .step h4 { margin-bottom: .2rem; }

/* Rating */
.rating { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; }
.stars { --pct: 100%; display: inline-block; font-size: 1.05rem; line-height: 1; position: relative; color: var(--line-strong); }
.stars::before { content: "★★★★★"; }
.stars > span { position: absolute; left: 0; top: 0; width: var(--pct); overflow: hidden; color: var(--gold); white-space: nowrap; }
.stars > span::before { content: "★★★★★"; }

/* Review card (listicle) */
.review { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-5); background: #fff; box-shadow: var(--shadow-sm); }
.review__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.review__rank { width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: var(--brand-700); font-weight: 900; display: grid; place-items: center; }
.review__name { font-size: var(--fs-h4); font-weight: 800; }
.review__score { font-size: 1.4rem; font-weight: 900; color: var(--brand); }
.proscons { display: grid; gap: var(--sp-4); margin-top: var(--sp-4); }
@media (min-width:560px){ .proscons { grid-template-columns: 1fr 1fr; } }
.proscons h5 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .05em; margin-bottom: var(--sp-2); }
.pros h5 { color: var(--accent-700); } .cons h5 { color: var(--danger); }
.proscons ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .3rem; font-size: var(--fs-sm); }
.pros li::before { content: "✓ "; color: var(--accent-700); font-weight: 800; }
.cons li::before { content: "✕ "; color: var(--danger); font-weight: 800; }

/* FAQ accordion (no JS) */
.faq { display: flex; flex-direction: column; gap: var(--sp-3); }
.faq details { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.faq summary { cursor: pointer; padding: var(--sp-4) var(--sp-5); font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: var(--sp-3); align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--accent); font-weight: 400; transition: .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq .faq-a { padding: var(--sp-4) var(--sp-5); color: var(--muted); }

/* Author / E-E-A-T box */
.author-box { display: flex; gap: var(--sp-4); align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-5); background: var(--bg-soft); margin-top: var(--sp-7); }
.author-box .avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; flex-shrink: 0; }
.author-box .name { font-weight: 800; }
.author-box .role { font-size: var(--fs-sm); color: var(--accent-700); }
.author-box p { font-size: var(--fs-sm); color: var(--muted); margin-top: var(--sp-2); }

/* Related posts */
.related { margin-top: var(--sp-8); }
.related h2 { margin-bottom: var(--sp-5); }

/* CTA band */
.cta-band { background: var(--brand); color: #fff; border-radius: var(--radius-lg); padding: clamp(2rem,5vw,3.5rem); text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.85); max-width: 52ch; margin: var(--sp-3) auto var(--sp-5); }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-700); color: #c9d4e4; margin-top: var(--sp-9); }
.site-footer .wrap { padding-block: var(--sp-8) var(--sp-6); }
.footer-grid { display: grid; gap: var(--sp-6); grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width:760px){ .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width:480px){ .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .07em; margin-bottom: var(--sp-4); }
.site-footer a { color: #c9d4e4; font-size: var(--fs-sm); }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.footer-brand .brand { color: #fff; margin-bottom: var(--sp-3); }
.footer-brand p { font-size: var(--fs-sm); color: #9fb0c8; max-width: 38ch; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: var(--sp-6); padding-top: var(--sp-5); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-xs); color: #8ba0bd; }

/* Tag pills */
.pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.pill { font-size: var(--fs-xs); font-weight: 600; padding: .3rem .7rem; border-radius: 999px; background: var(--bg-sink); color: var(--muted); }
a.pill:hover { background: var(--brand); color: #fff; text-decoration: none; }

/* Disclosure note */
.disclosure { font-size: var(--fs-xs); color: var(--faint); background: var(--bg-soft); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); }

/* Utilities */
.mt-0{margin-top:0}.mt-6{margin-top:var(--sp-6)}.mb-4{margin-bottom:var(--sp-4)}
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem 1rem; border-radius: 8px; z-index: 100; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce){ *{ transition: none !important; scroll-behavior: auto; } }
