@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url('../fonts/space-grotesk-latin-ext-wght-normal.woff2') format('woff2-variations'), url('../fonts/space-grotesk-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url('../fonts/space-grotesk-latin-wght-normal.woff2') format('woff2-variations'), url('../fonts/space-grotesk-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: 245, 247, 250;
  --bg-alt: 238, 241, 245;
  --panel: 255, 255, 255;
  --raised: 255, 255, 255;
  --border: 222, 226, 230;
  --text: 20, 23, 30;
  --muted: 100, 116, 139;
  --accent: 14, 165, 233;
  --accent-hover: 2, 132, 199;
  --accent-contrast: 255, 255, 255;
  --brand: 255, 102, 0;
  --radius: 8px;
  --radius-small: 6px;
  --shadow-card: 0 1px 2px rgba(20, 23, 30, 0.04), 0 4px 14px rgba(20, 23, 30, 0.05);
  --shadow-card-hover: 0 2px 4px rgba(20, 23, 30, 0.06), 0 14px 32px rgba(20, 23, 30, 0.1);
  --font: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Hiragino Sans', 'Yu Gothic UI', 'Noto Sans CJK JP', 'Noto Sans KR', sans-serif;
  --page-width: 1240px;
  --page-pad: clamp(1rem, 3vw, 2rem);
  color-scheme: light;
}

:root.dark {
  --bg: 14, 17, 22;
  --bg-alt: 18, 21, 27;
  --panel: 26, 29, 36;
  --raised: 32, 36, 44;
  --border: 42, 47, 58;
  --text: 230, 230, 230;
  --muted: 156, 163, 175;
  --accent: 34, 211, 238;
  --accent-hover: 103, 232, 249;
  --accent-contrast: 14, 17, 22;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.25);
  --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 14px 32px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --bg: 14, 17, 22;
    --bg-alt: 18, 21, 27;
    --panel: 26, 29, 36;
    --raised: 32, 36, 44;
    --border: 42, 47, 58;
    --text: 230, 230, 230;
    --muted: 156, 163, 175;
    --accent: 34, 211, 238;
    --accent-hover: 103, 232, 249;
    --accent-contrast: 14, 17, 22;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.25);
    --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 14px 32px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: rgb(var(--bg));
  color: rgb(var(--text));
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

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

button,
input {
  font: inherit;
  color: inherit;
}

::selection {
  background: rgba(255, 102, 0, 0.22);
}

:focus-visible {
  outline: 2px solid rgb(var(--accent));
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 200;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  background: rgb(var(--accent));
  color: rgb(var(--accent-contrast));
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(var(--bg), 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid rgb(var(--border));
}

.header-row {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0.75rem var(--page-pad) 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  flex: 0 0 auto;
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand-meva {
  color: rgb(var(--text));
}

.brand-search {
  color: rgb(var(--brand));
}

.brand-product {
  margin-left: 0.45rem;
  padding: 0.2rem 0.45rem 0.25rem;
  border: 1px solid rgb(var(--border));
  border-radius: var(--radius-small);
  color: rgb(var(--muted));
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transform: translateY(-0.12rem);
}

.search {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  max-width: 34rem;
  margin-left: auto;
}

.search-input {
  width: 100%;
  height: 2.5rem;
  padding: 0 2.9rem 0 1rem;
  border: 1px solid rgb(var(--border));
  border-radius: 999px;
  background: rgb(var(--panel));
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.search-input::placeholder {
  color: rgb(var(--muted));
}

.search-input:focus {
  outline: none;
  border-color: rgb(var(--accent));
  box-shadow: 0 0 0 3px rgba(var(--accent), 0.18);
}

.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-submit {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border: 0;
  border-radius: 999px;
  background: rgb(var(--accent));
  color: rgb(var(--accent-contrast));
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-submit:hover {
  background: rgb(var(--accent-hover));
}

.icon-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgb(var(--border));
  border-radius: var(--radius);
  background: rgb(var(--panel));
  color: rgb(var(--muted));
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.icon-button:hover {
  color: rgb(var(--accent));
  border-color: rgb(var(--accent));
}

.theme-toggle .icon-sun {
  display: none;
}

:root.dark .theme-toggle .icon-sun {
  display: block;
}

:root.dark .theme-toggle .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) .theme-toggle .icon-sun {
    display: block;
  }

  :root:not(.light) .theme-toggle .icon-moon {
    display: none;
  }
}

.category-nav {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.category-nav ul {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-nav ul::-webkit-scrollbar {
  display: none;
}

.category-nav li {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.category-nav a {
  position: relative;
  display: block;
  padding: 0.55rem 0.7rem 0.7rem;
  color: rgb(var(--muted));
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.category-nav a:hover {
  color: rgb(var(--text));
}

.category-nav a.is-active {
  color: rgb(var(--text));
  font-weight: 600;
}

.category-nav a.is-active::after {
  content: '';
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: rgb(var(--accent));
}

.page {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2.25rem) var(--page-pad) 3rem;
}

.section-title {
  margin-bottom: 1rem;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.section-title-small {
  font-size: 1.15rem;
  letter-spacing: -0.015em;
  margin-bottom: 0.9rem;
}

.lead {
  margin-bottom: 2.5rem;
}

.lead-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.lead-side {
  display: flex;
  flex-direction: column;
  border: 1px solid rgb(var(--border));
  border-radius: var(--radius);
  background: rgb(var(--panel));
  box-shadow: var(--shadow-card);
}

.lead-side li + li {
  border-top: 1px solid rgb(var(--border));
}

.card {
  height: 100%;
}

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.card-grid .card,
.card-hero {
  border: 1px solid rgb(var(--border));
  border-radius: var(--radius);
  background: rgb(var(--panel));
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.card-grid .card:hover,
.card-hero:hover,
.card-grid .card:focus-within,
.card-hero:focus-within {
  border-color: rgb(var(--accent));
  box-shadow: var(--shadow-card-hover);
}

.card-link:focus-visible {
  outline-offset: -3px;
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: rgb(var(--bg-alt));
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(var(--muted), 0.35);
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1 1 auto;
  padding: 0.9rem 1rem 1rem;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  color: rgb(var(--muted));
  font-size: 0.8rem;
  line-height: 1.2;
}

.source-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 4px;
  background: rgb(var(--text));
  color: rgb(var(--bg));
  font-size: 0.7rem;
  font-weight: 700;
}

.source-name {
  overflow: hidden;
  color: rgb(var(--text));
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta time {
  flex: 0 0 auto;
  white-space: nowrap;
}

.card-meta time::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 3px;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
}

.card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  overflow-wrap: anywhere;
  transition: color 0.15s ease;
}

.card-link:hover .card-title {
  color: rgb(var(--accent-hover));
}

.card-excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  color: rgb(var(--muted));
  font-size: 0.9rem;
  line-height: 1.45;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.25rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid rgb(var(--border));
  border-radius: 999px;
  color: rgb(var(--muted));
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
}

.tag-paywall {
  border-color: rgba(var(--brand), 0.45);
  color: rgb(var(--brand));
}

.card-hero .card-body {
  gap: 0.65rem;
  padding: 1.1rem 1.25rem 1.3rem;
}

.card-hero .card-title {
  -webkit-line-clamp: 4;
  line-clamp: 4;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.card-hero .card-excerpt {
  -webkit-line-clamp: 3;
  line-clamp: 3;
  font-size: 1rem;
}

.card-compact .card-body {
  padding: 0.95rem 1.05rem;
}

.card-compact .card-title {
  font-size: 0.98rem;
}

.card-compact .card-link:hover .card-title {
  color: rgb(var(--accent-hover));
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr));
  gap: 1.25rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.5rem 1.1rem;
  border: 1px solid rgb(var(--border));
  border-radius: var(--radius);
  background: rgb(var(--panel));
  color: rgb(var(--text));
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

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

.button-primary {
  border-color: rgb(var(--accent));
  background: rgb(var(--accent));
  color: rgb(var(--accent-contrast));
}

.button-primary:hover {
  border-color: rgb(var(--accent-hover));
  background: rgb(var(--accent-hover));
  color: rgb(var(--accent-contrast));
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.5rem;
}

.page-status {
  color: rgb(var(--muted));
  font-size: 0.9rem;
}

.empty-state {
  max-width: 34rem;
  margin: clamp(2rem, 8vw, 5rem) auto;
  text-align: center;
}

.empty-state h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.empty-state p {
  margin-bottom: 0.5rem;
  color: rgb(var(--muted));
}

.empty-state .empty-title {
  color: rgb(var(--text));
  font-weight: 600;
}

.empty-state .button {
  margin-top: 1.25rem;
}

.error-code {
  font-size: clamp(3.5rem, 12vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
  color: rgb(var(--brand)) !important;
}

.prose {
  max-width: 44rem;
}

.prose h1 {
  margin-bottom: 1rem;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.prose h2 {
  margin: 2rem 0 0.6rem;
  font-size: 1.2rem;
  letter-spacing: -0.015em;
}

.prose p,
.prose li {
  color: rgb(var(--text));
  line-height: 1.65;
}

.prose ul {
  padding-left: 1.2rem;
  list-style: disc;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.prose .prose-meta {
  margin-bottom: 1.5rem;
  color: rgb(var(--muted));
  font-size: 0.9rem;
}

.prose li + li {
  margin-top: 0.4rem;
}

.prose pre {
  margin: 0.75rem 0;
  padding: 0.8rem 1rem;
  border: 1px solid rgb(var(--border));
  border-radius: var(--radius);
  background: rgb(var(--bg-alt));
  overflow-x: auto;
  font-size: 0.88rem;
}

.site-footer {
  border-top: 1px solid rgb(var(--border));
  background: rgb(var(--bg-alt));
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 2rem;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 2.25rem var(--page-pad) calc(2.25rem + env(safe-area-inset-bottom, 0px));
}

.footer-languages h2 {
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.footer-languages ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.2rem 1rem;
}

.footer-languages a {
  display: inline-block;
  padding: 0.25rem 0;
  color: rgb(var(--muted));
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-languages a:hover {
  color: rgb(var(--accent-hover));
}

.footer-languages a.is-current {
  color: rgb(var(--text));
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgb(var(--accent));
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  color: rgb(var(--muted));
  font-size: 0.85rem;
  line-height: 1.55;
}

.footer-meta a {
  margin-right: 1rem;
  color: rgb(var(--text));
  text-underline-offset: 0.2em;
}

.footer-meta a:hover {
  color: rgb(var(--accent-hover));
}

.language-banner {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 150;
  width: min(34rem, calc(100% - 2rem));
  padding: 1rem 1.1rem;
  border: 1px solid rgb(var(--border));
  border-radius: var(--radius);
  background: rgb(var(--raised));
  box-shadow: var(--shadow-card-hover);
  transform: translateX(-50%);
  animation: banner-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.language-banner-text {
  margin-bottom: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
}

.language-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.language-banner-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  color: rgb(var(--muted));
  font-size: 0.88rem;
  cursor: pointer;
}

.language-banner-remember input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: rgb(var(--accent));
}

@keyframes banner-in {
  from {
    opacity: 0;
    transform: translate(-50%, 0.75rem);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

html.images-off .card-media {
  display: none;
}

html.btn-style-square .button,
html.btn-style-square .icon-button,
html.btn-style-square .tag,
html.btn-style-square .source-mark {
  border-radius: 0;
}

html.btn-style-futuristic .button,
html.btn-style-futuristic .icon-button {
  border-color: transparent;
  border-radius: 0;
  background: rgb(var(--bg-alt));
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

html.btn-style-futuristic .button:hover,
html.btn-style-futuristic .icon-button:hover {
  border-color: transparent;
  background: rgb(var(--accent));
  color: rgb(var(--accent-contrast));
}

html.btn-style-futuristic .button-primary {
  background: rgb(var(--accent));
  color: rgb(var(--accent-contrast));
}

html.btn-style-futuristic .tag {
  border-radius: 0;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

html.search-style-square .search-input,
html.search-style-square .search-submit {
  border-radius: 0;
}

html.search-style-futuristic .search-input {
  border-radius: 0;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

html.search-style-futuristic .search-input:focus {
  box-shadow: none;
}

html.search-style-futuristic .search-submit {
  border-radius: 0;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

@media (max-width: 900px) {
  .lead-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .header-row {
    flex-wrap: wrap;
    row-gap: 0.6rem;
  }

  .search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .theme-toggle {
    margin-left: auto;
  }

  .category-nav {
    padding-right: 0;
  }

  .category-nav ul {
    padding-right: var(--page-pad);
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }

  .card-grid {
    gap: 1rem;
  }

  .language-banner-remember {
    margin-left: 0;
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .pagination,
  .language-banner {
    display: none;
  }
}

.card-hero.has-no-image .card-media {
  aspect-ratio: 21 / 9;
}
