/* =====================================================================
   What's My PageRank — custom design system
   Aesthetic: clean "SEO metrics" — PageRank green + green-charcoal ink,
   geometric sans headings, monospace data accents. Fully self-contained;
   content is ALWAYS visible with CSS alone (no JS gating).
   ===================================================================== */

:root {
  --pr-green: #12a150;
  --pr-green-600: #0e8442;
  --pr-green-700: #0b6a35;
  --pr-green-300: #4fd189;
  --pr-green-050: #e9f7ef;

  --ink: #0f1c16;
  --ink-2: #16271f;
  --ink-3: #1f342a;

  --paper: #f4f8f6;
  --white: #ffffff;
  --card: #ffffff;
  --line: #dbe7e0;
  --line-2: #eef3f0;

  --text: #1b2a22;
  --text-2: #566b60;
  --text-3: #84968c;

  --amber: #c9791a;
  --amber-bg: #fbf1e0;
  --amber-line: #f0d8ad;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15,28,22,.06), 0 1px 3px rgba(15,28,22,.05);
  --shadow: 0 6px 22px rgba(15,28,22,.08);
  --shadow-lg: 0 18px 50px rgba(15,28,22,.14);

  --maxw: 1160px;
  --readw: 730px;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Sora", var(--sans);
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--pr-green-700); text-decoration: none; }
a:hover { color: var(--pr-green-600); text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--ink);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 .6em;
}
h1 { font-size: clamp(2rem, 4.4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); margin-top: 2em; }
h3 { font-size: 1.22rem; margin-top: 1.6em; }
p { margin: 0 0 1.15em; }
strong { color: var(--ink-2); font-weight: 600; }
code {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--pr-green-050);
  color: var(--pr-green-700);
  padding: .12em .4em;
  border-radius: 5px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .25s ease;
}
.site-header.scrolled { box-shadow: var(--shadow-sm); }
.header-inner {
  display: flex; align-items: center; gap: 18px;
  min-height: 66px; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--display); font-weight: 700; color: var(--ink); font-size: 1.06rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand .mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(150deg, var(--pr-green-300), var(--pr-green) 55%, var(--pr-green-700));
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), var(--shadow-sm);
}
.brand .mark svg { width: 19px; height: 19px; }
.brand small { display: block; font-family: var(--mono); font-weight: 500; font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; color: var(--pr-green-700); margin-top: 1px; }

.mainnav { margin-left: auto; }
.mainnav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 2px 4px; margin: 0; padding: 0; }
.mainnav a {
  display: inline-block; padding: 7px 11px; border-radius: 8px;
  color: var(--text-2); font-weight: 500; font-size: .92rem;
}
.mainnav a:hover { background: var(--pr-green-050); color: var(--pr-green-700); text-decoration: none; }
.mainnav a.active { color: var(--pr-green-700); background: var(--pr-green-050); }

/* ---------- Hero (home) ---------- */
.hero {
  background:
    radial-gradient(1100px 380px at 82% -8%, rgba(18,161,80,.13), transparent 60%),
    linear-gradient(180deg, #ffffff, var(--paper));
  border-bottom: 1px solid var(--line);
}
.hero .wrap { padding-top: 54px; padding-bottom: 30px; }
.eyebrow {
  font-family: var(--mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--pr-green-700);
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--pr-green); border-radius: 2px; }

/* ---------- Article layout ---------- */
main { display: block; }
.page { padding: 40px 0 12px; }
.article { max-width: var(--readw); margin: 0 auto; }
.article .lead {
  font-size: 1.22rem; line-height: 1.6; color: var(--ink-3);
  font-weight: 400; margin-bottom: 1.3em;
}
.article ul, .article ol { margin: 0 0 1.3em; padding-left: 1.25em; }
.article li { margin-bottom: .5em; }
.article h2 { padding-top: .2em; }

figure { margin: 1.6em 0 1.9em; }
figure img { border-radius: var(--radius); box-shadow: var(--shadow); background: var(--ink-2); }
.fig-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.fig-inline img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
figcaption { font-size: .82rem; color: var(--text-3); margin-top: .7em; text-align: center; font-family: var(--mono); }

/* ---------- Decorative PageRank bar ---------- */
.pr-bar {
  display: flex; align-items: flex-end; gap: 4px;
  background: var(--ink); border-radius: var(--radius);
  padding: 20px 22px 18px; margin: 1.4em 0 .7em;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.pr-bar-label {
  position: absolute; top: 12px; left: 22px;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .14em;
  text-transform: uppercase; color: #7fa793;
}
.pr-bar .pr-seg {
  flex: 1; border-radius: 3px 3px 2px 2px;
  background: linear-gradient(180deg, var(--pr-green-300), var(--pr-green));
  opacity: .92; margin-top: 22px;
}
.pr-bar .s0 { height: 12px; background: #2b4034; }
.pr-bar .s1 { height: 16px; } .pr-bar .s2 { height: 22px; } .pr-bar .s3 { height: 30px; }
.pr-bar .s4 { height: 40px; } .pr-bar .s5 { height: 52px; } .pr-bar .s6 { height: 66px; }
.pr-bar .s7 { height: 82px; } .pr-bar .s8 { height: 100px; } .pr-bar .s9 { height: 120px; }
.pr-bar .s10 { height: 142px; }
.pr-note { font-size: .9rem; color: var(--text-2); margin-top: 0; }

/* ---------- Notices ---------- */
.notice {
  border-radius: var(--radius); padding: 16px 18px; margin: 1.5em 0;
  font-size: .96rem; border: 1px solid var(--line);
}
.notice-warn {
  background: var(--amber-bg); border-color: var(--amber-line); color: #6b4410;
}
.notice-warn strong { color: #7a4a0f; }

/* ---------- Guide cards (home) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin: 1.4em 0 .5em; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 20px 18px; box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--pr-green-300); }
.card h3 { margin: 0 0 .4em; font-size: 1.1rem; }
.card h3 a { color: var(--ink); } .card h3 a:hover { color: var(--pr-green-700); text-decoration: none; }
.card p { margin: 0; font-size: .93rem; color: var(--text-2); }
.card .ic { width: 30px; height: 30px; color: var(--pr-green); margin-bottom: 10px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--sans); font-weight: 600; font-size: .96rem;
  padding: 12px 20px; border-radius: 10px; border: 1px solid transparent;
  transition: background .15s ease, transform .12s ease, box-shadow .15s ease;
}
.btn-primary { background: var(--pr-green); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--pr-green-600); color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn-ghost { background: #fff; color: var(--pr-green-700); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--pr-green-300); background: var(--pr-green-050); text-decoration: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.5em 0 .4em; }

/* ---------- Contact form ---------- */
.contact-form { display: flex; flex-direction: column; gap: 6px; margin: 1.2em 0 1.6em; max-width: 560px; }
.contact-form label { font-weight: 600; font-size: .85rem; color: var(--ink-2); margin-top: 10px; }
.contact-form input, .contact-form textarea {
  font-family: var(--sans); font-size: 1rem; color: var(--text);
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  width: 100%;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--pr-green); box-shadow: 0 0 0 3px rgba(18,161,80,.14); }
.contact-form button { margin-top: 16px; align-self: flex-start; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #c4d3ca; margin-top: 56px; }
.site-footer a { color: #d7e5db; }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 34px;
  padding: 46px 0 30px;
}
.footer-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; color: #fff; font-size: 1.05rem; margin-bottom: 12px; }
.footer-brand .mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(150deg, var(--pr-green-300), var(--pr-green) 55%, var(--pr-green-700)); display: inline-flex; align-items: center; justify-content: center; }
.footer-brand .mark svg { width: 17px; height: 17px; }
.footer-about { font-size: .9rem; color: #9db6a8; max-width: 34ch; }
.footer-col h4 { color: #fff; font-size: .78rem; font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; margin: 4px 0 14px; font-weight: 600; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; font-size: .92rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.09);
  padding: 18px 0 30px; font-size: .82rem; color: #8aa598;
  display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; align-items: center;
}
.footer-disclaimer {
  background: rgba(255,255,255,.035); border-top: 1px solid rgba(255,255,255,.07);
  font-size: .8rem; color: #86a094; line-height: 1.6;
}
.footer-disclaimer .wrap { padding-top: 16px; padding-bottom: 16px; }

/* ---------- Prev/next & meta ---------- */
.topic-tag {
  display: inline-block; font-family: var(--mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--pr-green-700); background: var(--pr-green-050);
  padding: 4px 10px; border-radius: 20px; margin-bottom: 16px;
}
.related {
  margin-top: 2.4em; padding: 22px; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.related h4 { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin: 0 0 12px; }
.related ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.related li a { font-weight: 500; }

/* ---------- CSS-only entrance ----------
   Transform-only by design: opacity is NEVER touched, so content is
   always fully visible even if animations don't run. No JS involved. */
@keyframes rise { from { transform: translateY(9px); } to { transform: none; } }
.rise { animation: rise .5s ease; }
/* Safeguard: never leave any content hidden waiting on JS */
[data-aos] { opacity: 1 !important; transform: none !important; }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } html { scroll-behavior: auto; } }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 80px 0 40px; }
.notfound .code { font-family: var(--mono); font-size: clamp(4rem, 16vw, 9rem); color: var(--pr-green); line-height: 1; font-weight: 700; letter-spacing: -.03em; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
  .footer-brand-col { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .header-inner { min-height: 58px; }
  .brand small { display: none; }
  .mainnav { width: 100%; margin-left: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
  .mainnav ul { flex-wrap: nowrap; }
  .mainnav a { white-space: nowrap; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero .wrap { padding-top: 38px; }
}
