/* ==========================================================================
   tlddomain.us — Knowledge-base / magazine stylesheet
   Educational guides about TLDs & domain extensions.
   Aesthetic: article-first, generous typography, calm editorial palette,
   CSS-drawn diagrams + callout boxes. Deliberately NOT a data-table grid.
   ========================================================================== */

/* ---- Design tokens ---- */
:root {
  --ink:        #1a2230;   /* primary text */
  --ink-soft:   #46536b;   /* secondary text */
  --ink-faint:  #6b7689;   /* meta / captions */
  --paper:      #ffffff;   /* page background */
  --paper-2:    #f6f7fb;   /* section tint */
  --paper-3:    #eef1f8;   /* card / inset */
  --line:       #e2e6f0;   /* hairlines */
  --line-soft:  #edf0f7;

  --brand:      #2f5fe0;   /* editorial blue */
  --brand-dk:   #1f47b8;
  --brand-tint: #eaf0ff;
  --accent:     #0e9f6e;   /* "correct/answer" green */
  --accent-tint:#e7f7f0;
  --warn:       #b54708;   /* caution */
  --warn-tint:  #fff4e6;
  --note:       #6941c6;   /* note / definition */
  --note-tint:  #f2edff;

  --radius:     14px;
  --radius-sm:  9px;
  --shadow-sm:  0 1px 2px rgba(20,30,55,.05), 0 1px 3px rgba(20,30,55,.06);
  --shadow-md:  0 6px 22px rgba(22,34,64,.08);

  --maxw:       1120px;
  --readw:      720px;   /* optimal article measure */

  --serif: "Iowan Old Style", "Palatino Linotype", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dk); text-decoration: underline; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ==========================================================================
   Header / Nav
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 1.25rem;
  min-height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-weight: 800; font-size: 1.18rem; letter-spacing: -.02em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand .dot {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #5b86ff);
  color: #fff; font-size: .72rem; font-weight: 800;
  font-family: var(--mono); box-shadow: var(--shadow-sm);
}
.brand .tld { color: var(--brand); }
.nav {
  margin-left: auto;
  display: flex; align-items: center; gap: 1.4rem;
  font-size: .96rem; font-weight: 600;
}
.nav a { color: var(--ink-soft); }
.nav a:hover { color: var(--brand); text-decoration: none; }
.nav .cta {
  padding: .42rem .85rem; border-radius: 8px;
  background: var(--brand); color: #fff;
}
.nav .cta:hover { background: var(--brand-dk); color: #fff; }
.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--line);
  border-radius: 8px; padding: .4rem .55rem; cursor: pointer;
  font-size: 1.1rem; color: var(--ink);
}

@media (max-width: 860px) {
  .nav { display: none; }
  .nav-toggle { display: inline-block; }
  .nav.open {
    display: flex; flex-direction: column; align-items: flex-start;
    gap: .2rem; position: absolute; top: 64px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: .6rem 22px 1rem;
  }
  .nav.open a { padding: .55rem 0; width: 100%; border-bottom: 1px solid var(--line-soft); }
  .nav.open .cta { margin-top: .4rem; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  background:
    radial-gradient(1100px 380px at 80% -10%, var(--brand-tint), transparent 60%),
    radial-gradient(900px 320px at 0% 0%, var(--accent-tint), transparent 55%),
    var(--paper);
  border-bottom: 1px solid var(--line);
}
.hero .wrap { padding-top: 3.4rem; padding-bottom: 3rem; }
.hero .eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand-dk); background: #fff;
  border: 1px solid var(--line); border-radius: 999px;
  padding: .3rem .8rem; margin-bottom: 1rem; box-shadow: var(--shadow-sm);
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  line-height: 1.1; letter-spacing: -.02em;
  margin: 0 0 1rem; max-width: 16ch; color: var(--ink);
}
.hero .lede {
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  color: var(--ink-soft); max-width: 60ch; margin: 0 0 1.6rem;
}
.hero .lede b { color: var(--ink); font-weight: 700; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: 1rem;
  padding: .72rem 1.25rem; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-md); }
.btn-primary:hover { background: var(--brand-dk); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

/* Hero anatomy diagram (CSS-drawn, no images) */
.anatomy {
  margin-top: 2.4rem; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem 1.5rem 1.2rem;
  box-shadow: var(--shadow-md); max-width: 640px;
}
.anatomy-title { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: .9rem; }
.anatomy-url {
  font-family: var(--mono); font-size: clamp(1.1rem, 2.6vw, 1.7rem);
  display: flex; flex-wrap: wrap; gap: .1ch; align-items: flex-end; line-height: 1.2;
}
.anatomy-url .seg { position: relative; padding-bottom: .55rem; font-weight: 600; }
.anatomy-url .seg::after {
  content: attr(data-label);
  position: absolute; left: 0; right: 0; bottom: -1.1rem;
  font-family: var(--sans); font-size: .64rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; text-align: center; white-space: nowrap;
}
.anatomy-url .seg { border-bottom: 3px solid transparent; }
.seg.sub  { color: var(--ink-faint); border-color: #c9d2e6; }
.seg.sld  { color: var(--ink);       border-color: var(--accent); }
.seg.tld  { color: var(--brand-dk);  border-color: var(--brand); font-weight: 800; }
.seg.dot  { color: var(--ink-faint); padding-bottom: .55rem; }
.anatomy-legend { margin-top: 2.1rem; font-size: .82rem; color: var(--ink-soft); }
.anatomy-legend b { color: var(--brand-dk); }

/* ==========================================================================
   Generic section + headings
   ========================================================================== */
.section { padding: 3.2rem 0; }
.section.tint { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: var(--readw); margin: 0 0 1.8rem; }
.section-head .kicker {
  font-size: .78rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--brand); margin-bottom: .5rem;
}
.section-head h2 {
  font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .6rem; color: var(--ink);
}
.section-head p { color: var(--ink-soft); margin: 0; font-size: 1.06rem; }

/* ==========================================================================
   Topic / guide card grid (homepage hub)
   ========================================================================== */
.card-grid {
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.3rem 1.35rem;
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #cdd7ee; text-decoration: none; }
.card .ic {
  width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center; margin-bottom: .9rem;
  background: var(--brand-tint); color: var(--brand-dk);
  font-family: var(--mono); font-weight: 800; font-size: 1rem;
}
.card h3 { margin: 0 0 .4rem; font-size: 1.16rem; letter-spacing: -.01em; color: var(--ink); }
.card p { margin: 0; color: var(--ink-soft); font-size: .96rem; line-height: 1.55; }
.card .more { margin-top: .9rem; font-weight: 700; font-size: .9rem; color: var(--brand); }
.card:hover .more { color: var(--brand-dk); }
/* accent variants for visual rhythm */
.card.v-green .ic { background: var(--accent-tint); color: #0a7a54; }
.card.v-note  .ic { background: var(--note-tint);  color: var(--note); }
.card.v-warn  .ic { background: var(--warn-tint);  color: var(--warn); }

/* ==========================================================================
   Article layout
   ========================================================================== */
.article-shell { padding: 2.4rem 0 3rem; }
.article-grid {
  display: grid; gap: 2.4rem;
  grid-template-columns: minmax(0, 1fr) 250px;
  align-items: start;
}
@media (max-width: 940px) { .article-grid { grid-template-columns: 1fr; } }

.breadcrumb {
  font-size: .85rem; color: var(--ink-faint); margin-bottom: 1.1rem;
  display: flex; flex-wrap: wrap; gap: .35rem; align-items: center;
}
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb .sep { color: var(--line); }

.article {
  max-width: var(--readw);
}
.article header.art-head { margin-bottom: 1.6rem; }
.article .art-cat {
  font-size: .78rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--brand);
}
.article h1 {
  font-family: var(--serif); font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.12; letter-spacing: -.02em; margin: .4rem 0 .7rem; color: var(--ink);
}
.article .standfirst {
  font-size: 1.18rem; color: var(--ink-soft); line-height: 1.6; margin: 0 0 1rem;
}
.byline {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
  font-size: .9rem; color: var(--ink-faint);
  padding: .8rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.byline .author { color: var(--ink); font-weight: 700; }
.byline .updated { color: var(--accent); font-weight: 600; }
.byline .reading { margin-left: auto; }

/* Article typography */
.article-body { font-size: 1.075rem; }
.article-body > * + * { margin-top: 1.15rem; }
.article-body p { color: var(--ink); }
.article-body h2 {
  font-family: var(--serif); font-size: clamp(1.45rem, 2.6vw, 1.85rem);
  line-height: 1.2; letter-spacing: -.015em; margin: 2.4rem 0 .2rem;
  padding-top: .4rem; color: var(--ink); scroll-margin-top: 80px;
}
.article-body h3 {
  font-size: 1.22rem; margin: 1.8rem 0 .1rem; color: var(--ink); letter-spacing: -.01em;
  scroll-margin-top: 80px;
}
.article-body ul, .article-body ol { padding-left: 1.3rem; color: var(--ink); }
.article-body li { margin: .4rem 0; }
.article-body li::marker { color: var(--brand); }
.article-body strong { color: var(--ink); font-weight: 700; }
.article-body code {
  font-family: var(--mono); font-size: .88em;
  background: var(--paper-3); padding: .12em .4em; border-radius: 5px;
  border: 1px solid var(--line); color: var(--brand-dk);
}
.article-body a { text-decoration: underline; text-decoration-color: #bcd; text-underline-offset: 2px; }
.article-body blockquote {
  margin: 1.6rem 0; padding: .4rem 0 .4rem 1.3rem;
  border-left: 4px solid var(--brand); color: var(--ink-soft);
  font-style: italic; font-size: 1.1rem;
}

/* ==========================================================================
   "Answer-first" lead box (AI-citation feature)
   ========================================================================== */
.answer-box {
  background: var(--accent-tint);
  border: 1px solid #bfe7d6; border-left: 5px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.3rem; margin: 0 0 1.6rem;
}
.answer-box .qa-label {
  font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: #0a7a54; margin-bottom: .4rem; display: flex; align-items: center; gap: .4rem;
}
.answer-box p { margin: 0; font-size: 1.1rem; color: var(--ink); line-height: 1.6; }
.answer-box p + p { margin-top: .6rem; }

/* ==========================================================================
   Callout / note / definition boxes
   ========================================================================== */
.callout {
  border-radius: var(--radius-sm); padding: 1rem 1.2rem;
  margin: 1.6rem 0; border: 1px solid var(--line);
  display: grid; grid-template-columns: auto 1fr; gap: .9rem; align-items: start;
}
.callout .cico {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  font-weight: 800; font-size: .95rem; flex: none;
}
.callout .ctitle { font-weight: 800; margin: 0 0 .15rem; font-size: .98rem; }
.callout p { margin: 0; font-size: .98rem; color: var(--ink-soft); }
.callout.note { background: var(--note-tint); border-color: #ddd0fb; }
.callout.note .cico { background: #fff; color: var(--note); }
.callout.note .ctitle { color: var(--note); }
.callout.tip  { background: var(--accent-tint); border-color: #bfe7d6; }
.callout.tip .cico { background: #fff; color: #0a7a54; }
.callout.tip .ctitle { color: #0a7a54; }
.callout.warn { background: var(--warn-tint); border-color: #fcd9aa; }
.callout.warn .cico { background: #fff; color: var(--warn); }
.callout.warn .ctitle { color: var(--warn); }

/* Definition block (DefinedTerm visual) */
.definition {
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--note);
  border-radius: var(--radius-sm); padding: 1.1rem 1.3rem; margin: 1.6rem 0;
  box-shadow: var(--shadow-sm);
}
.definition .term {
  font-family: var(--mono); font-weight: 800; color: var(--note);
  font-size: 1.05rem; margin-bottom: .35rem;
}
.definition .gloss { margin: 0; color: var(--ink); }

/* ==========================================================================
   Comparison tables (concept-vs-concept) — editorial, not a data grid
   ========================================================================== */
.table-scroll { overflow-x: auto; margin: 1.6rem 0; -webkit-overflow-scrolling: touch; }
table.compare {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: .98rem; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
}
table.compare caption {
  caption-side: bottom; text-align: left; font-size: .82rem;
  color: var(--ink-faint); padding: .6rem .2rem 0;
}
table.compare th, table.compare td {
  padding: .7rem .9rem; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
}
table.compare thead th {
  background: var(--paper-2); font-size: .82rem; letter-spacing: .03em;
  text-transform: uppercase; color: var(--ink-soft); font-weight: 800;
  border-bottom: 2px solid var(--line);
}
table.compare tbody th {
  font-weight: 700; color: var(--ink); background: #fbfcff; white-space: nowrap;
}
table.compare tr:last-child td, table.compare tr:last-child th { border-bottom: 0; }
table.compare td .yes { color: var(--accent); font-weight: 700; }
table.compare td .no  { color: #b42318; font-weight: 700; }

/* ==========================================================================
   FAQ accordion
   ========================================================================== */
.faq { margin-top: 1.4rem; }
.faq details {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; margin-bottom: .7rem; overflow: hidden;
  transition: border-color .15s ease;
}
.faq details[open] { border-color: #cdd7ee; box-shadow: var(--shadow-sm); }
.faq summary {
  list-style: none; cursor: pointer; padding: 1rem 1.2rem;
  font-weight: 700; font-size: 1.04rem; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-family: var(--mono); font-size: 1.4rem; font-weight: 400;
  color: var(--brand); transition: transform .2s ease; line-height: 1;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-a { padding: 0 1.2rem 1.1rem; color: var(--ink-soft); }
.faq .faq-a p { margin: 0; }
.faq .faq-a p + p { margin-top: .7rem; }

/* ==========================================================================
   "Key takeaways" / TL;DR list
   ========================================================================== */
.takeaways {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.3rem 1.5rem; margin: 2rem 0;
}
.takeaways h3 { margin: 0 0 .7rem; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; color: var(--ink); }
.takeaways ul { margin: 0; padding-left: 1.1rem; }
.takeaways li { margin: .45rem 0; color: var(--ink-soft); }
.takeaways li::marker { content: "→ "; color: var(--brand); font-weight: 700; }

/* ==========================================================================
   Sidebar (sticky TOC + related)
   ========================================================================== */
.sidebar { position: sticky; top: 84px; align-self: start; font-size: .94rem; }
@media (max-width: 940px) { .sidebar { position: static; } }
.side-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 1.1rem 1.2rem; margin-bottom: 1.2rem;
}
.side-card h4 {
  margin: 0 0 .7rem; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint);
}
.toc ol { margin: 0; padding-left: 1.1rem; }
.toc li { margin: .35rem 0; }
.toc a { color: var(--ink-soft); }
.toc a:hover { color: var(--brand); text-decoration: none; }
.side-links { list-style: none; margin: 0; padding: 0; }
.side-links li { margin: 0; border-top: 1px solid var(--line-soft); }
.side-links li:first-child { border-top: 0; }
.side-links a { display: block; padding: .55rem 0; color: var(--ink-soft); font-weight: 600; }
.side-links a:hover { color: var(--brand); text-decoration: none; }

/* ==========================================================================
   Ad slots (AdSense containers, reserved space, no CLS spikes)
   ========================================================================== */
.ad-slot {
  margin: 2.2rem auto; text-align: center;
  max-width: var(--readw); clear: both;
}
.ad-slot::before {
  content: "Advertisement"; display: block;
  font-size: .64rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: .4rem;
}
.ad-slot ins { display: block; }
.ad-inline { min-height: 100px; }
.ad-leader { min-height: 90px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: #131a28; color: #c2cbdc; margin-top: 3rem;
  border-top: 1px solid #232c40;
}
.site-footer .wrap { padding: 2.6rem 22px 1.6rem; }
.foot-grid {
  display: grid; gap: 2rem;
  grid-template-columns: 1.4fr repeat(3, 1fr);
}
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-brand .brand { color: #fff; }
.foot-brand .brand .dot { box-shadow: none; }
.foot-brand p { color: #93a0b8; font-size: .92rem; margin: .8rem 0 0; max-width: 34ch; }
.foot-col h5 {
  margin: 0 0 .8rem; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: #7d8aa3;
}
.foot-col ul { list-style: none; margin: 0; padding: 0; }
.foot-col li { margin: .45rem 0; }
.foot-col a { color: #c2cbdc; font-size: .94rem; }
.foot-col a:hover { color: #fff; text-decoration: none; }
.foot-bottom {
  margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid #232c40;
  display: flex; flex-wrap: wrap; gap: .6rem; justify-content: space-between;
  font-size: .85rem; color: #7d8aa3;
}
.foot-bottom a { color: #93a0b8; }
.foot-disclaimer { max-width: 70ch; line-height: 1.55; }

/* ==========================================================================
   Utilities
   ========================================================================== */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.muted { color: var(--ink-faint); }
.pill {
  display: inline-block; font-size: .74rem; font-weight: 700;
  padding: .18rem .55rem; border-radius: 999px;
  background: var(--brand-tint); color: var(--brand-dk);
}
.lead-cta {
  text-align: center; padding: 2.2rem; margin: 2.4rem 0 0;
  background: linear-gradient(135deg, var(--brand-tint), #fff);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.lead-cta h3 { font-family: var(--serif); font-size: 1.5rem; margin: 0 0 .5rem; }
.lead-cta p { color: var(--ink-soft); margin: 0 0 1.1rem; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
