:root {
  --bg: #0a0a0c;
  --bg-gradient: radial-gradient(ellipse 120% 80% at 50% 100%, rgba(255, 100, 50, 0.08) 0%, transparent 55%),
    linear-gradient(180deg, #0a0a0c 0%, #0f0f12 100%);
  --surface: rgba(22, 22, 26, 0.65);
  --surface-solid: rgba(18, 18, 22, 0.95);
  --border: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(255, 140, 0, 0.25);
  --text: #f0f0f2;
  --text-muted: #9ca3af;
  --accent: #ff8c00;
  --accent-bright: #ffa726;
  --accent-dim: #e67e00;
  --accent-glow: rgba(255, 140, 0, 0.35);
  --ct: #22c55e;
  --t: #ef4444;
  --radius: 12px;
  --radius-lg: 16px;
  --font-sans: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --blur: 16px;
  --blur-strong: 24px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.main {
  /* extra breathing room above the footer on all pages */
  padding-bottom: 3rem;
}

/* Header — glass bar */
.header {
  background: rgba(15, 15, 18, 0.75);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  padding: 1rem 0;
  margin-bottom: 2rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  transition: opacity 0.2s;
}

.logo:hover {
  opacity: 0.9;
}

.logo-img {
  height: 32px;
  width: auto;
  display: block;
  vertical-align: middle;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem 1.5rem;
}

.nav-search-wrap {
  flex: 1;
  max-width: 280px;
  min-width: 0;
  margin: 0 0.5rem;
  position: relative;
}

.nav-search {
  width: 100%;
  padding: 0.4rem 2rem 0.4rem 2.25rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, background 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.6rem 50%;
  background-size: 1rem;
}

.nav-search-clear {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
}

.nav-search-clear:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.nav-search-wrap--has-value .nav-search-clear {
  display: flex;
}

.nav-search::placeholder {
  color: var(--text-muted);
}

.nav-search:focus {
  outline: none;
  border-color: rgba(255, 140, 0, 0.4);
  background-color: rgba(255, 255, 255, 0.08);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link--active {
  color: var(--accent);
  font-weight: 600;
  background: rgba(255, 140, 0, 0.12);
}

/* Mobile header / nav layout (e.g. iPhone 15 Pro ~393px wide) */
@media (max-width: 640px) {
  .header-inner {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .logo {
    margin-bottom: 0.25rem;
  }

  .nav {
    order: 2;
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .nav-link {
    padding-inline: 0.7rem;
  }

  .nav-search-wrap {
    order: 3;
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .nav-search {
    font-size: 0.9rem;
  }
}

/* Hero */
.hero {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Articles — glass cards */
.articles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .articles {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.article-card {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: background-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  transform: translateY(-4px);
}

.article-card-link {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.75rem 0.75rem 1.25rem;
  gap: 1rem;
}

.article-card-body {
  padding: 0.75rem 0 0.5rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-date {
  color: var(--accent);
}

.article-card h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.article-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
}

.article-card-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.article-card a {
  color: inherit;
  text-decoration: none;
  display: block;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  background: var(--surface);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* Calculator */
.calc-hero {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.calc-hero h1 {
  font-size: 1.85rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.calc-hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.calc-form-section {
  margin-bottom: 1.5rem;
}

.calc-form {
  background: var(--surface);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.calc-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.calc-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.calc-input {
  flex: 1;
  min-width: 200px;
  padding: 0.65rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(10, 10, 12, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.calc-input::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.calc-input:focus {
  outline: none;
  border-color: rgba(255, 140, 0, 0.4);
  box-shadow: 0 0 0 1px rgba(255, 140, 0, 0.12);
}

.calc-btn {
  padding: 0.65rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: #0a0a0c;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.calc-btn:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
}

.calc-btn:active {
  transform: translateY(0);
}

.calc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.calc-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.calc-status {
  min-height: 0;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.calc-status.calc-status--error {
  color: var(--t);
}

.calc-status.calc-status--success {
  color: var(--ct);
}

.calc-result {
  display: none;
  background: var(--surface);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.calc-total {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow);
}

.calc-items {
  margin-top: 1rem;
}

.calc-items table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.calc-items th,
.calc-items td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.calc-items th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.calc-items tr:last-child td {
  border-bottom: none;
}

.calc-items .item-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 0.5rem;
}

.calc-items .item-name {
  vertical-align: middle;
}

.calc-items .item-price {
  font-family: var(--font-mono);
  color: var(--accent);
}

/* Footer — glass */
.footer {
  margin-top: auto;
  padding: 2rem 0;
  background: rgba(15, 15, 18, 0.5);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Article detail (single view) */
.article-full {
  max-width: 680px;
  margin: 0 auto 3rem;
}

.article-full .article-meta {
  margin-bottom: 1rem;
}

.article-full h1 {
  font-size: 1.85rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.article-full .content {
  color: var(--text);
}

.article-full .content p {
  margin-bottom: 1rem;
  color: var(--text);
}

.article-full .content p.lead {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.article-full-img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  display: block;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.article-full .content h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
}

.article-full .content a {
  color: #ff8c00;
}

.article-full .content a:visited {
  color: #ff8c00;
}

.article-full .content a:hover {
  color: #ffa726;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  background: rgba(255, 140, 0, 0.1);
  border: 1px solid var(--border-accent);
  transition: background 0.2s, box-shadow 0.2s;
}

.back-link:hover {
  background: rgba(255, 140, 0, 0.18);
}

/* Breadcrumb and internal linking (SEO) */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
  color: var(--accent-bright);
}

.breadcrumb span[aria-hidden] {
  margin: 0 0.35rem;
}

/* FAQ in articles — expandable dropdowns */
.article-faq {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.article-faq__title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.article-faq__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-item:hover {
  border-color: rgba(255, 140, 0, 0.3);
}

.faq-item[open] {
  border-color: rgba(255, 140, 0, 0.4);
  box-shadow: 0 0 0 1px rgba(255, 140, 0, 0.15);
}

.faq-item__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.faq-item__question::-webkit-details-marker {
  display: none;
}

.faq-item__question::after {
  content: "";
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  margin-top: -0.2rem;
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-item__question::after {
  transform: rotate(-135deg);
  margin-top: 0.2rem;
}

.faq-item__answer {
  padding: 0 1rem 1rem;
  padding-top: 0;
}

.faq-item__answer p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.faq-item__answer p:last-child {
  margin-bottom: 0;
}

.faq-item__answer ul,
.faq-item__answer ol {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.related-articles {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.related-articles__title {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.related-articles__list {
  list-style: none;
}

.related-articles__list li {
  margin-bottom: 0.5rem;
}

.related-articles__list a,
.related-articles__list a:link,
.related-articles__list a:visited {
  color: #ff8c00 !important;
  text-decoration: none;
  font-weight: 500;
}

.related-articles__list a:hover,
.related-articles__list a:focus {
  color: #ffa726 !important;
  text-decoration: underline;
}
