:root {
  --ink: #1f2421;
  --muted: #626862;
  --paper: #f2efe8;
  --white: #fffdf8;
  --line: #d0ccc2;
  --coral: #db6248;
  --gold: #d9aa42;
  --green: #24473f;
  --wine: #70404c;
  --blue: #2e5876;
  --leaf: #416b4d;
  --sans: "Manrope", "Noto Sans SC", sans-serif;
  --mono: "DM Mono", "Noto Sans SC", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.75; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
.layout { width: min(1240px, calc(100% - 80px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

.site-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; width: min(1340px, calc(100% - 80px)); height: 74px; margin: auto; border-bottom: 1px solid var(--line); background: rgba(242, 239, 232, .95); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 11px; min-width: 245px; }
.brand strong { display: block; font-size: 15px; font-weight: 800; }
.brand small { display: block; margin-top: 1px; color: var(--muted); font-family: var(--mono); font-size: 9px; }
.brand-mark { position: relative; display: inline-block; width: 28px; height: 28px; }
.brand-mark i { position: absolute; width: 10px; height: 10px; border: 2px solid var(--ink); border-radius: 50%; }
.brand-mark i:nth-child(1) { top: 1px; left: 1px; background: var(--coral); }
.brand-mark i:nth-child(2) { top: 14px; left: 2px; background: #e5c94c; }
.brand-mark i:nth-child(3) { top: 7px; left: 15px; background: #75a68c; }
.site-header nav { display: flex; align-items: center; gap: 31px; height: 100%; }
.site-header nav a { position: relative; padding: 27px 0 25px; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.site-header nav a:hover, .site-header nav a.active { color: var(--ink); }
.site-header nav a.active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; background: var(--coral); content: ""; }
.header-tools { display: flex; align-items: center; justify-content: flex-end; gap: 16px; min-width: 245px; }
.icon-button { position: relative; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: transparent; }
.icon-button span::before { position: absolute; top: 8px; left: 8px; width: 8px; height: 8px; border: 1.5px solid var(--ink); border-radius: 50%; content: ""; }
.icon-button span::after { position: absolute; top: 17px; left: 17px; width: 6px; height: 1.5px; background: var(--ink); content: ""; transform: rotate(45deg); transform-origin: left center; }
.icon-button:hover { border-color: var(--ink); background: var(--white); }
.profile-button { border: 0; padding: 0; background: transparent; color: var(--ink); font-size: 11px; font-weight: 800; }

.topic-showcase { padding-top: 44px; }
.topic-row { --accent: var(--coral); position: relative; display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(360px, .86fr); min-height: 470px; margin-bottom: 74px; overflow: hidden; background: var(--white); box-shadow: 0 18px 46px rgba(36, 37, 32, .08); isolation: isolate; transition: box-shadow .28s ease, transform .28s ease; }
.topic-row:nth-child(even) { grid-template-columns: minmax(360px, .86fr) minmax(0, 1.14fr); }
.topic-row::after { position: absolute; right: 0; bottom: 0; left: 0; height: 5px; background: var(--accent); content: ""; transform: scaleX(.12); transform-origin: left; transition: transform .35s ease; }
.topic-row:nth-child(even)::after { transform-origin: right; }
.topic-row:hover, .topic-row:focus-visible { box-shadow: 0 24px 60px rgba(36, 37, 32, .15); outline: 0; transform: translateY(-5px); }
.topic-row:hover::after, .topic-row:focus-visible::after { transform: scaleX(1); }
.topic-content { position: relative; display: flex; min-width: 0; flex-direction: column; justify-content: center; padding: 58px 62px 54px; }
.topic-index { display: grid; grid-template-columns: auto 46px auto; align-items: center; justify-content: start; gap: 13px; margin-bottom: 35px; color: var(--accent); font-family: var(--mono); }
.topic-index span { font-size: 24px; font-weight: 500; line-height: 1; }
.topic-index i { height: 1px; background: currentColor; }
.topic-index b { font-size: 11px; font-weight: 500; }
.topic-content h2 { max-width: 510px; margin: 0 0 20px; font-size: clamp(34px, 3.4vw, 52px); font-weight: 800; line-height: 1.14; }
.topic-content > p { max-width: 520px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.9; }
.topic-tags { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; margin: 30px 0 0; padding: 0; color: #4f554f; font-family: var(--mono); font-size: 10px; }
.topic-tags li { position: relative; padding-left: 12px; }
.topic-tags li::before { position: absolute; top: .8em; left: 0; width: 4px; height: 4px; background: var(--accent); content: ""; transform: translateY(-50%); }
.topic-action { display: flex; align-items: center; gap: 18px; margin-top: 44px; color: var(--ink); font-size: 12px; font-weight: 800; }
.topic-action i { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid var(--ink); border-radius: 50%; font-size: 17px; font-style: normal; font-weight: 400; transition: background .2s, color .2s, transform .2s; }
.topic-row:hover .topic-action i { background: var(--ink); color: var(--white); transform: translateX(5px); }

.topic-visual { position: relative; min-width: 0; min-height: 470px; overflow: hidden; }
.photo-visual img, .acid-rain-visual > img { display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(.83) contrast(1.05); transition: transform .6s ease; }
.topic-row:hover .photo-visual img, .topic-row:hover .acid-rain-visual > img { transform: scale(1.035); }
.visual-tint { position: absolute; inset: 0; background: rgba(31, 36, 33, .15); }
.visual-caption { position: absolute; right: 30px; bottom: 28px; left: 30px; margin: 0; border-left: 3px solid var(--accent); padding: 9px 13px; background: rgba(24, 27, 24, .76); color: #fffdf8; font-size: 11px; line-height: 1.5; backdrop-filter: blur(4px); }
.visual-caption span { display: block; margin-bottom: 2px; color: #e9c65f; font-family: var(--mono); font-size: 8px; }

.topic-conversion { --accent: #d2aa43; grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr); min-height: 500px; background: #fbf8ee; }
.conversion-visual { background: #24473f; color: #fffdf8; }
.graph-grid { position: absolute; inset: 0; opacity: .16; background-image: linear-gradient(rgba(255,255,255,.24) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.24) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to bottom right, #000, transparent 82%); }
.graph-line { position: absolute; top: 50%; left: 50%; width: 1px; height: 135%; background: rgba(255, 253, 248, .38); transform-origin: center; }
.line-one { transform: translate(-50%, -50%) rotate(36deg); }
.line-two { transform: translate(-50%, -50%) rotate(-46deg); }
.line-three { transform: translate(-50%, -50%) rotate(82deg); }
.line-four { transform: translate(-50%, -50%) rotate(128deg); }
.graph-node { position: absolute; display: grid; place-items: center; width: 66px; height: 66px; border: 1px solid rgba(255,255,255,.8); border-radius: 50%; background: #e7bb4b; color: #1f2421; font-family: var(--mono); font-size: 15px; box-shadow: 0 9px 22px rgba(0,0,0,.15); }
.node-center { top: 50%; left: 50%; width: 112px; height: 112px; background: #fffaf0; font-family: var(--sans); font-size: 23px; font-weight: 800; transform: translate(-50%, -50%); }
.node-na { top: 12%; left: 14%; background: #df6d52; }
.node-s { top: 11%; right: 16%; background: #e4c64e; }
.node-n { top: 43%; right: 8%; background: #6aa18a; color: #fff; }
.node-fe { bottom: 14%; left: 18%; background: #8c4c45; color: #fff; }
.node-ion { right: 23%; bottom: 10%; background: #5e8e80; color: #fff; }

.topic-organic { --accent: var(--wine); grid-template-columns: minmax(360px, .78fr) minmax(0, 1.22fr); min-height: 450px; background: #faf5f4; }
.organic-visual { background: var(--wine); color: #fffdf8; }
.organic-kicker { position: absolute; top: 30px; left: 32px; color: #f0cf6c; font-family: var(--mono); font-size: 10px; }
.molecule { position: absolute; width: 82px; height: 82px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; }
.molecule span { position: absolute; top: 50%; left: 50%; width: 43px; height: 2px; background: #fff9ef; transform-origin: left center; }
.molecule span:nth-child(1) { transform: rotate(0deg); }
.molecule span:nth-child(2) { transform: rotate(90deg); }
.molecule span:nth-child(3) { transform: rotate(180deg); }
.molecule span:nth-child(4) { transform: rotate(270deg); }
.molecule span:nth-child(5) { transform: rotate(42deg); }
.molecule-start { top: 25%; left: 10%; }
.molecule-middle { top: 48%; left: 39%; width: 96px; height: 96px; }
.reaction-arrow { position: absolute; width: 112px; border-top: 1px solid rgba(255,255,255,.75); color: #f0cf6c; }
.reaction-arrow::after { position: absolute; top: -4px; right: -1px; width: 7px; height: 7px; border-top: 1px solid #fff; border-right: 1px solid #fff; content: ""; transform: rotate(45deg); }
.reaction-arrow span { position: absolute; top: -25px; left: 50%; font-family: var(--mono); font-size: 9px; transform: translateX(-50%); white-space: nowrap; }
.arrow-one { top: 42%; left: 23%; transform: rotate(27deg); }
.arrow-two { top: 47%; right: 18%; transform: rotate(-22deg); }
.target-card { position: absolute; top: 19%; right: 8%; display: flex; width: 150px; min-height: 168px; border: 1px solid rgba(255,255,255,.75); flex-direction: column; justify-content: center; padding: 24px; background: rgba(255,255,255,.08); }
.target-card small { color: #f0cf6c; font-family: var(--mono); font-size: 8px; }
.target-card strong { margin: 10px 0 14px; font-size: 22px; }
.target-card span { color: #dfcfd2; font-size: 9px; }

.topic-alcohol { --accent: #b94e38; grid-template-columns: minmax(0, .98fr) minmax(380px, 1.02fr); min-height: 505px; }
.topic-alcohol .visual-tint { background: linear-gradient(115deg, rgba(85,28,20,.48), rgba(25,27,24,.08)); }
.breath-meter { position: absolute; top: 33px; right: 31px; display: grid; grid-template-columns: auto auto; align-items: baseline; min-width: 184px; border: 1px solid rgba(255, 253, 248, .72); padding: 16px 18px; background: rgba(25, 24, 21, .78); color: #fffdf8; }
.breath-meter span { grid-column: 1 / 3; color: #f0c252; font-family: var(--mono); font-size: 8px; }
.breath-meter strong { font-family: var(--mono); font-size: 38px; line-height: 1.2; }
.breath-meter small { margin-left: 6px; color: #d7d3ca; font-family: var(--mono); font-size: 9px; }

.topic-rare-earth { --accent: var(--blue); grid-template-columns: minmax(380px, .9fr) minmax(0, 1.1fr); min-height: 455px; background: #f5f7f7; }
.rare-earth-visual .visual-tint { background: linear-gradient(120deg, rgba(29,51,68,.16), rgba(18,42,59,.48)); }
.element-strip { position: absolute; top: 32px; left: 30px; display: flex; gap: 8px; }
.element-strip span { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid rgba(255,255,255,.8); background: rgba(35,78,106,.9); color: #fff; font-family: var(--mono); font-size: 17px; }
.element-strip span:nth-child(2) { background: rgba(185,137,42,.93); }
.element-strip span:nth-child(3) { background: rgba(115,61,71,.93); }
.element-strip small { align-self: start; justify-self: start; margin: 4px 0 -10px 5px; font-size: 7px; opacity: .75; }

.topic-fertilizer { --accent: var(--leaf); grid-template-columns: minmax(0, 1.22fr) minmax(350px, .78fr); min-height: 500px; background: #f9f8f1; }
.fertilizer-visual .visual-tint { background: linear-gradient(120deg, rgba(28,64,35,.12), rgba(30,59,35,.34)); }
.nutrient-mark { position: absolute; top: 31px; right: 31px; display: flex; }
.nutrient-mark span { display: grid; place-items: center; width: 72px; height: 72px; border: 1px solid rgba(255,255,255,.84); border-radius: 50%; background: rgba(48,97,60,.91); color: #fff; font-family: var(--mono); font-size: 20px; }
.nutrient-mark span + span { margin-left: -9px; }
.nutrient-mark span:nth-child(2) { background: rgba(191,139,45,.94); }
.nutrient-mark span:nth-child(3) { background: rgba(157,72,51,.94); }

.topic-acid-rain { --accent: #65747a; grid-template-columns: minmax(400px, .92fr) minmax(0, 1.08fr); min-height: 470px; background: #f4f3ee; }
.acid-rain-visual { background: #d8ddda; }
.acid-rain-visual > img { object-fit: contain; padding: 36px 42px 94px; background: #e7ebe7; filter: saturate(.72) contrast(1.03); }
.acid-rain-visual .visual-tint { pointer-events: none; background: linear-gradient(140deg, rgba(61,74,80,.05), rgba(48,59,64,.22)); }
.ph-scale { position: absolute; top: 29px; right: 28px; display: grid; grid-template-columns: auto auto 65px auto; align-items: center; gap: 7px; border: 1px solid rgba(255,255,255,.82); padding: 12px 15px; background: rgba(44,55,59,.86); color: #fff; font-family: var(--mono); }
.ph-scale span { color: #e9cb63; font-size: 9px; }
.ph-scale b { font-size: 16px; font-weight: 500; }
.ph-scale i { height: 3px; background: linear-gradient(90deg, #d4684a, #d9bc4f); }
.ph-scale small { grid-column: 1 / 5; color: #d9ddda; font-size: 7px; text-align: right; }

.footer { display: flex; align-items: center; justify-content: space-between; margin-top: 30px; padding: 30px 0 38px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.footer strong { margin-right: 10px; color: var(--ink); }
.footer-links { display: flex; align-items: center; gap: 26px; }
.footer-links button { border: 0; padding: 0; background: transparent; color: inherit; font-size: inherit; }
.footer-links a:hover, .footer-links button:hover { color: var(--ink); }

.overline { margin: 0 0 17px; color: var(--muted); font-family: var(--mono); font-size: 10px; }
.overline::before { display: inline-block; width: 25px; height: 1px; margin: 0 9px 3px 0; background: var(--dialog-accent, var(--coral)); content: ""; vertical-align: middle; }
.dialog-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(31,36,33,.56); }
.dialog-backdrop[hidden] { display: none; }
.dialog { position: relative; width: min(630px, 100%); border-top: 5px solid var(--dialog-accent, var(--coral)); padding: 40px; background: var(--paper); box-shadow: 14px 14px 0 rgba(31,36,33,.22); }
.dialog h2 { margin: 0 0 12px; font-size: 32px; line-height: 1.2; }
.dialog > p:not(.overline) { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.85; }
.dialog-close { position: absolute; top: 14px; right: 18px; border: 0; background: transparent; color: var(--ink); font-size: 26px; line-height: 1; }
.dialog-map { display: flex; flex-wrap: wrap; gap: 9px 19px; margin-top: 27px; padding-top: 21px; border-top: 1px solid var(--line); }
.dialog-map span { border-bottom: 2px solid var(--dialog-accent, var(--coral)); padding: 5px 1px; color: #4d544f; font-size: 11px; }
.dialog-action { margin-top: 29px; border: 0; padding: 13px 17px; background: var(--ink); color: var(--white); font-size: 11px; font-weight: 700; }
.dialog-action:disabled { opacity: .62; cursor: default; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; padding: 11px 14px; background: var(--ink); color: var(--white); font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: .2s; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 1080px) {
  .brand, .header-tools { min-width: 190px; }
  .site-header nav { gap: 18px; }
  .topic-row, .topic-row:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(320px, .85fr); min-height: 430px; }
  .topic-content { padding: 46px 43px; }
  .topic-visual { min-height: 430px; }
}

@media (max-width: 820px) {
  .layout, .site-header { width: min(100% - 36px, 680px); }
  .site-header { height: auto; min-height: 68px; flex-wrap: wrap; gap: 8px; padding: 11px 0; }
  .brand, .header-tools { min-width: auto; }
  .site-header nav { order: 3; width: 100%; height: 33px; justify-content: space-between; overflow-x: auto; gap: 18px; }
  .site-header nav a { flex: 0 0 auto; padding: 6px 0 8px; font-size: 11px; }
  .topic-showcase { padding-top: 28px; }
  .topic-row, .topic-row:nth-child(even) { grid-template-columns: 1fr; margin-bottom: 38px; }
  .topic-row:nth-child(even) .topic-content { order: 2; }
  .topic-row:nth-child(even) .topic-visual { order: 1; }
  .topic-visual { min-height: 360px; }
  .topic-content { min-height: 390px; padding: 42px 38px 40px; }
  .topic-content h2 { font-size: 38px; }
}

@media (max-width: 540px) {
  body { font-size: 14px; }
  .header-tools { gap: 10px; }
  .profile-button { font-size: 10px; }
  .topic-row { box-shadow: 0 12px 32px rgba(36,37,32,.08); }
  .topic-visual { min-height: 300px; }
  .topic-content { min-height: 370px; padding: 35px 27px 34px; }
  .topic-index { grid-template-columns: auto 30px auto; margin-bottom: 27px; }
  .topic-index span { font-size: 21px; }
  .topic-content h2 { font-size: 33px; }
  .topic-content > p { font-size: 14px; line-height: 1.85; }
  .topic-action { margin-top: 34px; }
  .graph-node { width: 52px; height: 52px; font-size: 12px; }
  .node-center { width: 88px; height: 88px; font-size: 19px; }
  .target-card { right: 5%; width: 128px; min-height: 146px; padding: 18px; }
  .target-card strong { font-size: 18px; }
  .element-strip span { width: 53px; height: 53px; }
  .nutrient-mark span { width: 58px; height: 58px; }
  .acid-rain-visual > img { padding: 32px 24px 90px; }
  .visual-caption { right: 20px; bottom: 19px; left: 20px; }
  .footer { align-items: flex-start; flex-direction: column; gap: 15px; }
  .dialog { padding: 35px 24px 29px; }
}
