:root {
  --font-body: "Crimson Pro", "Georgia", serif;
  --font-display: "Crimson Pro", "Georgia", serif;
  --font-brand: "Crimson Pro", "Georgia", serif;
  --body-bg: linear-gradient(135deg, #f8f5f1 0%, #e8dfd6 100%);
  --text: #2c2416;
  --muted: #5c5040;
  --accent: #c44536;
  --accent-2: #8b7355;
  --accent-3: #2c2416;
  --line: rgba(44, 36, 22, 0.15);
  --glow: rgba(196, 69, 54, 0.2);
  --brand-grad: linear-gradient(135deg, #c44536, #8b7355);
  --brand-mark-text: #f8f5f1;
  --brand-mark-shadow: 0 8px 24px rgba(44, 36, 22, 0.2);
  --hero-bg: rgba(255, 255, 255, 0.6);
  --hero-border-color: rgba(44, 36, 22, 0.1);
  --hero-shadow: 0 24px 60px rgba(44, 36, 22, 0.08);
  --input-bg: rgba(255, 255, 255, 0.8);
  --input-border-color: rgba(44, 36, 22, 0.15);
  --pill-bg: rgba(255, 255, 255, 0.5);
  --pill-border-color: rgba(44, 36, 22, 0.1);
  --pill-selected-bg: rgba(196, 69, 54, 0.1);
  --pill-selected-border: rgba(196, 69, 54, 0.4);
  --pill-selected-shadow: 0 12px 24px rgba(44, 36, 22, 0.08);
  --button-bg: linear-gradient(135deg, #c44536, #a03828);
  --button-text: #f8f5f1;
  --button-shadow: 0 10px 20px rgba(196, 69, 54, 0.25);
  --cta-bg: rgba(255, 255, 255, 0.5);
  --cta-border: rgba(44, 36, 22, 0.1);
  --cta-text: #5c5040;
  --card-text: #2c2416;
  --card-muted: #5c5040;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--body-bg);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.page {
  padding: 32px 0 64px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 24px;
}


.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--brand-grad);
  display: grid;
  place-items: center;
  font-weight: 600;
  color: var(--brand-mark-text);
  box-shadow: var(--brand-mark-shadow);
}

.brand-name {
  font-family: var(--font-brand);
  font-size: 28px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-tagline {
  font-size: 13px;
  color: var(--muted);
}

.cta-quiet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--cta-border);
  background: var(--cta-bg);
  color: var(--cta-text);
  font-size: 13px;
}

.hero {
  display: grid;
  gap: 24px;
  padding: 28px;
  border-radius: 28px;
  background: var(--hero-bg);
  border: 1px solid var(--hero-border-color);
  box-shadow: var(--hero-shadow);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 38px);
  margin: 0;
}

.hero-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.search-box {
  display: grid;
  gap: 14px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--input-bg);
  border-radius: 16px;
  padding: 12px 14px;
  border: 1px solid var(--input-border-color);
}

.search-field input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  background: transparent;
  color: var(--text);
}

.search-field textarea {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  background: transparent;
  color: var(--text);
  resize: none;
  min-height: 24px;
  max-height: 180px;
  line-height: 1.5;
  font-family: inherit;
}

.search-field button {
  border: none;
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: var(--button-shadow);
}

.engine-panel {
  display: grid;
  gap: 12px;
}

.engine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.engine-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--pill-border-color);
  background: var(--pill-bg);
  color: var(--muted);
  cursor: pointer;
  transition: 0.2s ease;
}

.engine-pill input {
  accent-color: var(--accent);
}

.engine-pill.is-selected {
  background: var(--pill-selected-bg);
  color: var(--text);
  border-color: var(--pill-selected-border);
  box-shadow: var(--pill-selected-shadow);
}

.engine-pill span {
  font-size: 14px;
}

.helper-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 0 16px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.22em;
}

.feed {
  display: grid;
  gap: 14px;
}

.feed-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(15, 22, 32, 0.8);
  border: 1px solid rgba(35, 49, 70, 0.7);
}

.feed-thumb {
  width: 120px;
  height: 88px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124, 211, 198, 0.2), rgba(154, 168, 255, 0.2));
  border: 1px solid rgba(124, 211, 198, 0.3);
}

.feed-title {
  margin: 0 0 8px;
  font-size: 15px;
}

.feed-meta {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.feed-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(124, 211, 198, 0.15);
  color: var(--accent);
  font-size: 11px;
  margin-top: 10px;
}

.more-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--accent);
}

.footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer-content {
  display: grid;
  gap: 6px;
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.footer-stacked {
  flex-direction: column;
  align-items: stretch;
}

.footer-stacked .footer-actions,
.footer-stacked .footer-content {
  width: 100%;
}

.footer-stacked .footer-actions {
  margin-left: 0;
  justify-content: space-between;
}

.footer-stacked .footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 8px;
  gap: 8px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--cta-border);
  background: var(--cta-bg);
  color: var(--cta-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: 0.2s ease;
}

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

/* Language Selector Dropdown */
.lang-selector {
  position: relative;
}

.lang-current {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--cta-border);
  border-radius: 6px;
  color: var(--cta-text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.2s ease;
}

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

.lang-arrow {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform 0.2s;
}

.lang-selector.is-open .lang-arrow {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  padding: 4px 0;
  background: var(--hero-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--cta-border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 100;
}

.lang-selector.is-open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: block;
  padding: 8px 16px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.lang-option:hover {
  background: var(--accent);
  color: var(--bg, #0b0f14);
}

.lang-option.is-active {
  font-weight: 600;
}

.tools-hero {
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: 24px;
  background: var(--hero-bg);
  border: 1px solid var(--hero-border-color);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.tool-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  display: grid;
  gap: 6px;
  min-height: 120px;
  transition: 0.2s ease;
}

.tool-card:hover {
  border-color: rgba(124, 211, 198, 0.5);
  transform: translateY(-2px);
}

.tool-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(124, 211, 198, 0.18);
  color: var(--accent);
  font-size: 18px;
}

.tool-name {
  font-size: 14px;
  margin: 0;
  color: var(--card-text);
}

.tool-desc {
  font-size: 12px;
  color: var(--card-muted);
  margin: 0;
}

/* Theme Switcher UI */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--cta-border);
  background: var(--cta-bg);
  color: var(--cta-text);
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s ease;
}

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

.theme-toggle svg {
  width: 16px;
  height: 16px;
}


/* Theme Panel Overlay */
.theme-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 999;
}

.theme-panel-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* Theme Panel */
.theme-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 100vw;
  background: var(--hero-bg);
  border-left: 1px solid var(--line);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.theme-panel.is-open {
  transform: translateX(0);
}

.theme-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.theme-panel-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.theme-panel-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: 0.2s ease;
}

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

.theme-panel-close svg {
  width: 18px;
  height: 18px;
}

.theme-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  transition: 0.2s ease;
}

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

.theme-option.is-active {
  border-color: var(--accent);
  background: var(--pill-selected-bg);
}

.theme-preview {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  overflow: hidden;
}

.theme-preview-color {
  flex: 1;
}

.theme-name {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}

.theme-option.is-active .theme-name {
  color: var(--accent);
}

@media (max-width: 700px) {
  .site-header {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .hero {
    padding: 22px;
  }

  .feed-card {
    grid-template-columns: 1fr;
  }

  .feed-thumb {
    width: 100%;
    height: 160px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .theme-panel {
    width: 100vw;
  }

  .theme-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-actions {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
  }

  .footer-stacked .footer-actions,
  .footer-stacked .footer-content {
    width: 100%;
  }

  .footer-stacked .footer-actions {
    justify-content: space-between;
  }

  .footer-stacked .footer-content {
    flex-direction: column;
    align-items: center;
  }

  .header-actions {
    width: auto;
    justify-content: flex-end;
  }
}
