/* ========================================================
   Clearcoin — Modern Minimal theme
   Design tokens
   ======================================================== */

:root {
  --bg: #FFFFFF;
  --paper: #F7F8FA;
  --ink: #16181D;
  --ink-soft: #5A5F6B;
  --accent: #3D5AFE;
  --accent-deep: #2A3ECF;
  --accent-tint: #EEF0FF;
  --line: #E7E9EE;
  --max: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--ink);
  margin: 0;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); }

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

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

/* ---------- Masthead ---------- */

.masthead {
  padding: 32px 0 0;
  position: relative;
  overflow: hidden;
}

.masthead::before {
  content: "";
  position: absolute;
  top: -90px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--accent-tint);
  z-index: 0;
}

.masthead .wrap {
  position: relative;
  z-index: 1;
}

.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 20px;
}

.wordmark {
  font-family: "Inter", sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
}

.wordmark a {
  display: inline-flex;
  align-items: center;
}

.wordmark-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  margin-right: 9px;
}

.wordmark span {
  color: var(--accent);
}

.tagline {
  color: var(--ink-soft);
  font-size: 14px;
  max-width: 260px;
  text-align: right;
}

nav.primary {
  border-bottom: 1px solid var(--line);
}

nav.primary .wrap {
  display: flex;
  gap: 30px;
  padding-top: 0;
  padding-bottom: 0;
  overflow-x: auto;
}

nav.primary a {
  display: inline-block;
  padding: 14px 0;
  font-size: 14.5px;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-weight: 500;
}

nav.primary a:hover,
nav.primary a.current {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ---------- Hero / featured post ---------- */

.hero {
  padding: 50px 0 40px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -170px;
  right: -170px;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: var(--accent-tint);
  z-index: 0;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -150px;
  right: 140px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.07;
  z-index: 0;
}

.hero .wrap {
  position: relative;
  z-index: 1;
}

.kicker {
  display: inline-block;
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 16px;
  background: var(--accent-tint);
  padding: 5px 13px;
  border-radius: 20px;
  letter-spacing: 0.2px;
}

.hero h1 {
  font-size: clamp(30px, 4.2vw, 48px);
  line-height: 1.08;
  max-width: 15ch;
}

.hero .dek {
  margin-top: 18px;
  max-width: 62ch;
  font-size: 19px;
  color: var(--ink-soft);
}

.hero .meta, .row .meta {
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

/* ---------- Main two-column layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 56px;
  padding: 8px 0 60px;
}

.section-label {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
  letter-spacing: normal;
  padding-bottom: 14px;
  margin: 0 0 6px;
}

.row {
  display: block;
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: border-color 0.15s ease;
}

.row:hover {
  border-color: var(--accent);
}

.row .num {
  display: none;
}

.row h3 {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.row .dek {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 58ch;
}

/* ---------- Sidebar ---------- */

.side-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

.side-box h2 {
  font-size: 17px;
  margin-bottom: 14px;
  font-weight: 700;
}

.side-box ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-box li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.side-box li:first-child { border-top: none; }

.side-box.signup {
  background: #16181D;
  color: #F2F3F5;
  border: none;
  position: relative;
  overflow: hidden;
}

.side-box.signup::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.18;
  z-index: 0;
}

.side-box.signup > * {
  position: relative;
  z-index: 1;
}

.side-box.signup h2 { color: #fff; }
.side-box.signup p { color: #A7ABB6; font-size: 14.5px; }

.signup form {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.signup input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid #33363E;
  background: #24262D;
  color: #fff;
  font-size: 14.5px;
  border-radius: 10px;
}

.signup input[type="email"]::placeholder { color: #7A7E89; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 11px 18px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
}

.btn:hover { background: var(--accent-deep); }

.disclosure {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ---------- Ad slot ---------- */

.ad-slot {
  border: 1px dashed var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 13px;
  text-align: center;
  padding: 18px;
  margin: 8px 0 28px;
  border-radius: 12px;
}

/* ---------- Article page ---------- */

body.article-page {
  position: relative;
  overflow-x: hidden;
}

body.article-page::after {
  content: "";
  position: absolute;
  top: 260px;
  left: calc(50% + 360px);
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: var(--accent-tint);
  z-index: -1;
}

.article {
  max-width: 700px;
  margin: 0 auto;
  padding: 50px 28px 70px;
  position: relative;
  z-index: 1;
}

.article .kicker { margin-bottom: 16px; }

.article h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.14;
}

.article .meta {
  margin: 20px 0 36px;
  font-size: 14px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  padding-bottom: 28px;
}

.article h2 {
  font-size: 23px;
  margin: 42px 0 14px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.article p {
  margin: 0 0 18px;
  max-width: 65ch;
}

.article ul, .article ol {
  margin: 0 0 20px;
  padding-left: 22px;
}

.article li { margin-bottom: 8px; max-width: 60ch; }

.pullquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 22px;
  margin: 32px 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--ink);
  max-width: 56ch;
}

/* ---------- Comparison tables (in-article) ---------- */

.article table.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 15.5px;
}

.compare-table th,
.compare-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.compare-table thead th {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 2px solid var(--line);
}

.compare-table td:first-child,
.compare-table th:first-child {
  font-weight: 600;
}

@media (max-width: 560px) {
  .compare-table { font-size: 14px; }
  .compare-table th, .compare-table td { padding: 8px 8px; }
}

/* ---------- Calculators ---------- */

.calc-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  margin: 32px 0;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.calc-field { display: flex; flex-direction: column; }

.calc-field label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.calc-field input, .calc-field select {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

.calc-field input:focus, .calc-field select:focus {
  outline: none;
  border-color: var(--accent);
}

.calc-result {
  background: #16181D;
  color: #fff;
  border-radius: 14px;
  padding: 22px 24px;
  margin-top: 18px;
}

.calc-result .big {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

.calc-result .row-line {
  display: flex;
  justify-content: space-between;
  font-size: 14.5px;
  color: #A7ABB6;
  padding: 6px 0;
  border-top: 1px solid #2A2D35;
}

.calc-result .row-line:first-child { border-top: none; }

.calc-note {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 14px;
}

@media (max-width: 560px) {
  .calc-grid { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 50px;
  margin-top: 20px;
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

footer nav a {
  color: var(--ink-soft);
  margin-left: 18px;
}

footer nav a:first-child { margin-left: 0; }

/* ---------- Secondary button ---------- */

.btn-outline {
  display: inline-block;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 10px 17px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
  font-family: inherit;
}

.btn-outline:hover {
  border-color: var(--ink-soft);
}

/* ---------- In-article side boxes (takeaways / related / author) ---------- */

.article .side-box {
  margin: 32px 0;
}

/* ---------- Feedback ("was this helpful") ---------- */

.feedback-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 24px;
  margin: 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.feedback-box p {
  margin: 0;
  font-weight: 600;
  font-size: 15px;
}

.feedback-buttons {
  display: flex;
  gap: 10px;
}

.feedback-thanks {
  color: var(--ink-soft);
  font-size: 14.5px;
}

/* ---------- FAQ ---------- */

.faq {
  margin: 32px 0;
}

.faq-item {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

.faq-item:last-child {
  border-bottom: 1px solid var(--line);
}

.faq-item h3 {
  font-size: 16.5px;
  font-weight: 700;
  margin-bottom: 8px;
}

.faq-item p {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0;
}

/* ---------- Cookie banner ---------- */

.cookie-banner {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: var(--bg);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(22, 24, 29, 0.08);
  padding: 18px 28px;
}

.cookie-banner.is-visible {
  display: block;
}

.cookie-banner .wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.cookie-banner p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  max-width: 62ch;
}

.cookie-banner p a {
  color: var(--ink);
  text-decoration: underline;
}

.cookie-banner-buttons {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ---------- Breadcrumbs ---------- */

.breadcrumbs {
  padding: 18px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.breadcrumbs a {
  color: var(--ink-soft);
}

.breadcrumbs a:hover {
  color: var(--accent);
}

/* ---------- Share buttons ---------- */

.share-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0;
  flex-wrap: wrap;
}

.share-buttons > span {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-right: 4px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
}

.share-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Dark mode toggle ---------- */

.theme-toggle {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  width: 36px;
  height: 36px;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--ink);
  font-family: inherit;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

html[data-theme="dark"] {
  --bg: #101114;
  --paper: #1A1C21;
  --ink: #F2F3F5;
  --ink-soft: #9A9DA6;
  --line: #2A2D35;
  --accent-tint: #232848;
}

html[data-theme="dark"] .calc-field input,
html[data-theme="dark"] .calc-field select,
html[data-theme="dark"] .share-btn {
  background: var(--paper);
}

/* ---------- Reading progress bar ---------- */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 200;
  transition: width 0.1s linear;
}

/* ---------- Site search ---------- */

.site-search {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}

.site-search input {
  width: 180px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 13.5px;
  font-family: inherit;
  background: var(--paper);
  color: var(--ink);
}

.site-search input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg);
}

.site-search-results {
  display: none;
  position: fixed;
  width: 300px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(22, 24, 29, 0.12);
  padding: 8px;
  z-index: 500;
  max-height: 360px;
  overflow-y: auto;
}

.site-search-results.is-open {
  display: block;
}

.site-search-results a {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
}

.site-search-results a:hover {
  background: var(--paper);
}

.site-search-results .result-kicker {
  color: var(--accent);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-right: 6px;
}

.site-search-empty {
  padding: 9px 10px;
  color: var(--ink-soft);
  font-size: 14px;
}

/* ---------- Pricing ---------- */

.badge-soon {
  display: inline-block;
  background: #16181D;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  margin-left: 10px;
  vertical-align: middle;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 32px 0;
}

.pricing-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  background: var(--bg);
}

.pricing-card.featured {
  border-color: var(--accent);
  background: var(--accent-tint);
  position: relative;
}

.pricing-card h3 {
  font-size: 20px;
  margin-bottom: 4px;
}

.price-amount {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 10px 0 4px;
}

.price-amount span {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
}

.pricing-card ul {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
}

.pricing-card li {
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
}

.pricing-card li:first-child { border-top: none; }

@media (max-width: 640px) {
  .pricing-grid { grid-template-columns: 1fr; }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .tagline { display: none; }
}

@media (max-width: 560px) {
  .cookie-banner .wrap { flex-direction: column; align-items: stretch; }
  .feedback-box { flex-direction: column; align-items: flex-start; }
  .site-search input { width: 130px; }
  .site-search-results { width: 260px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Visible keyboard focus */
a:focus-visible, .btn:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
}
