/* ==========================================================
   Tangem Art — main stylesheet
   ========================================================== */
:root {
  --ivory: #f7f2ea;
  --paper: #fffdf9;
  --sand: #ece3d4;
  --ink: #1d1a17;
  --ink-soft: #4a433c;
  --muted: #7a7065;
  --line: #ddd2c1;
  --terracotta: #b4532a;
  --terracotta-dark: #8f3f1d;
  --gold: #c8963e;
  --indigo: #24305e;
  --success: #2f6b3a;
  --error: #a12a2a;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(29, 26, 23, .08);
  --max: 1180px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--terracotta); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--terracotta-dark); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }
p { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.3em; margin: 0 0 1.2em; }
li { margin-bottom: .35em; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; }
.eyebrow { display: inline-block; font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--terracotta); font-weight: 600; margin-bottom: .9em; }
.lead { font-size: 1.15rem; color: var(--ink-soft); }
.muted { color: var(--muted); }
.center { text-align: center; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 10px 16px; z-index: 1000; }
.skip-link:focus { left: 10px; top: 10px; }
.placeholder { background: #fff3c4; color: #6b4e00; padding: 0 .3em; border-radius: 4px; font-weight: 600; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(247, 242, 234, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--serif); font-size: 1.65rem; font-weight: 700; letter-spacing: .02em; }
.brand-tag { font-size: .66rem; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.main-nav li { margin: 0; }
.main-nav a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink-soft); text-decoration: none; font-size: .93rem; font-weight: 500; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--ink); background: var(--sand); }
.main-nav a.nav-cta { background: var(--ink); color: var(--ivory); margin-left: 8px; }
.main-nav a.nav-cta:hover { background: var(--terracotta); color: #fff; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; width: 44px; height: 44px; cursor: pointer; color: var(--ink); }
.nav-toggle span { display: block; width: 20px; height: 2px; background: currentColor; margin: 4px auto; transition: transform .2s; }

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .main-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--ivory); border-bottom: 1px solid var(--line); display: none; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; padding: 10px 20px 20px; gap: 2px; }
  .main-nav a { padding: 12px; }
  .main-nav a.nav-cta { margin: 8px 0 0; text-align: center; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: .95rem; text-decoration: none; border: 1.5px solid transparent; cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s; font-family: var(--sans); }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--terracotta); color: #fff; }
.btn-primary:hover { background: var(--terracotta-dark); color: #fff; }
.btn-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: var(--ivory); }
.btn-light { background: var(--ivory); color: var(--ink); }
.btn-light:hover { background: #fff; color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6em; }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section-sm { padding: 56px 0; }
.section-alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-dark { background: var(--ink); color: #efe7da; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .eyebrow { color: var(--gold); }
.section-dark .lead, .section-dark p { color: #d8cfc1; }
.section-head { max-width: 720px; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 88px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.hero h1 { margin-bottom: .35em; }
.hero h1 em { font-style: italic; color: var(--terracotta); }
.hero-art { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hero-art .art-canvas { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hero-art .art-canvas:first-child { grid-row: span 2; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 2.2em; padding-top: 1.6em; border-top: 1px solid var(--line); }
.hero-meta div { font-size: .88rem; color: var(--muted); }
.hero-meta strong { display: block; font-family: var(--serif); font-size: 1.6rem; color: var(--ink); line-height: 1.1; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}

.page-hero { padding: 64px 0 48px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--paper), var(--ivory)); }
.page-hero p { max-width: 720px; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 1.2em; }
.breadcrumb a { color: var(--muted); }

/* ---------- Grids & cards ---------- */
.grid { display: grid; gap: 28px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; }
.card h3 { margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
.card .icon { width: 48px; height: 48px; border-radius: 12px; background: var(--sand); display: grid; place-items: center; margin-bottom: 18px; color: var(--terracotta); }
.card .icon svg { width: 26px; height: 26px; }
.section-dark .card { background: #2a2622; border-color: #3b352f; }
.section-dark .card h3 { color: #fff; }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.card-meta li { font-size: .8rem; background: var(--sand); padding: 4px 10px; border-radius: 999px; margin: 0; color: var(--ink-soft); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split.reverse > :first-child { order: 2; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 36px; } .split.reverse > :first-child { order: 0; } }

.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 22px; }
.steps li { counter-increment: step; position: relative; padding: 24px 24px 24px 84px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin: 0; }
.steps li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 24px; top: 20px; font-family: var(--serif); font-size: 2rem; font-weight: 700; color: var(--terracotta); }
.steps h3 { font-size: 1.3rem; margin-bottom: .25em; }
.steps p { margin: 0; color: var(--ink-soft); }

/* ---------- Artwork cards ---------- */
.art-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.art-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px) { .art-grid, .art-grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .art-grid, .art-grid.cols-3 { grid-template-columns: 1fr; } }
.art-card { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: zoom-in; transition: transform .25s, box-shadow .25s; }
.art-card:hover, .art-card:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow); outline: none; }
.art-card[hidden] { display: none; }
.art-canvas { aspect-ratio: 4 / 5; background: var(--sand); }
.art-canvas svg { width: 100%; height: 100%; }
.art-card figcaption { padding: 16px 18px 18px; }
.art-card .art-title { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; line-height: 1.2; margin: 0 0 4px; }
.art-card .art-info { font-size: .82rem; color: var(--muted); margin: 0; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }
.filter-btn { border: 1px solid var(--line); background: var(--paper); padding: 9px 18px; border-radius: 999px; cursor: pointer; font: 500 .9rem var(--sans); color: var(--ink-soft); }
.filter-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--ivory); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(20, 17, 14, .86); display: none; align-items: center; justify-content: center; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox-inner { background: var(--paper); border-radius: var(--radius); max-width: 980px; width: 100%; max-height: calc(100vh - 40px); overflow: auto; display: grid; grid-template-columns: 1.1fr 1fr; }
.lightbox-art { background: var(--sand); }
.lightbox-art svg { width: 100%; height: 100%; }
.lightbox-body { padding: 36px; position: relative; }
.lightbox-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--ivory); font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink); }
.lightbox dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: .92rem; margin: 18px 0 24px; }
.lightbox dt { color: var(--muted); }
.lightbox dd { margin: 0; }
@media (max-width: 760px) { .lightbox-inner { grid-template-columns: 1fr; } .lightbox-art { aspect-ratio: 4 / 5; } }

/* ---------- Collections ---------- */
.collection { padding: 56px 0; border-bottom: 1px solid var(--line); }
.collection:last-child { border-bottom: 0; }
.collection-head { display: grid; grid-template-columns: 1fr 1.3fr; gap: 48px; margin-bottom: 30px; }
@media (max-width: 900px) { .collection-head { grid-template-columns: 1fr; gap: 10px; } }

/* ---------- Prose (policies, journal) ---------- */
.prose { max-width: 820px; }
.prose h2 { font-size: 1.9rem; margin-top: 1.6em; }
.prose h3 { font-size: 1.4rem; margin-top: 1.4em; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: .94rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--sand); }
.table-wrap { overflow-x: auto; }
.updated { font-size: .88rem; color: var(--muted); }
.toc { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; margin: 0 0 36px; }
.toc h2 { font-size: 1.2rem; margin: 0 0 .6em; font-family: var(--sans); font-weight: 600; }
.toc ol { margin: 0; columns: 2; column-gap: 32px; }
@media (max-width: 640px) { .toc ol { columns: 1; } }
.note { background: var(--paper); border-left: 4px solid var(--gold); padding: 16px 20px; border-radius: 0 10px 10px 0; margin: 0 0 1.4em; }

.article { padding: 48px 0; border-bottom: 1px solid var(--line); }
.article:last-child { border-bottom: 0; }
.article-meta { font-size: .85rem; color: var(--muted); margin-bottom: 1em; }

/* FAQ */
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 0 22px; margin-bottom: 12px; }
.faq summary { cursor: pointer; padding: 18px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--terracotta); }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 0 18px; color: var(--ink-soft); }
.faq-group { margin-bottom: 44px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 56px; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-details { list-style: none; padding: 0; margin: 0 0 28px; }
.contact-details li { display: flex; gap: 14px; margin-bottom: 18px; }
.contact-details svg { width: 22px; height: 22px; flex: none; color: var(--gold); margin-top: 3px; }
.contact-details strong { display: block; color: #fff; font-weight: 600; }
.map-frame { border: 0; width: 100%; height: 260px; border-radius: var(--radius); filter: grayscale(.25); }
.form-card { background: var(--paper); color: var(--ink); border-radius: var(--radius); padding: 36px; }
.form-card h3 { color: var(--ink); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } .form-card { padding: 24px; } }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .86rem; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
.field input, .field select, .field textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font: 400 1rem var(--sans); background: #fff; color: var(--ink); }
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--ink-soft); margin-bottom: 20px; }
.check input { margin-top: 5px; }
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.form-status { display: none; padding: 14px 16px; border-radius: 10px; margin-bottom: 18px; font-size: .95rem; }
.form-status.show { display: block; }
.form-status.success { background: #e5f2e7; color: var(--success); }
.form-status.error { background: #f8e3e3; color: var(--error); }

/* ---------- CTA band ---------- */
.cta-band { background: var(--terracotta); color: #fff; border-radius: 22px; padding: 56px; display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin: 0 0 .2em; }
.cta-band p { margin: 0; color: #fbe6dc; }
@media (max-width: 640px) { .cta-band { padding: 36px 26px; } }

/* ---------- Footer ---------- */
.site-footer { background: #15120f; color: #b9ae9f; padding: 72px 0 28px; font-size: .92rem; }
.site-footer a { color: #d9cfc1; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-family: var(--sans); font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 1.1em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .55em; }
.site-footer .brand { color: #fff; margin-bottom: 16px; }
.site-footer .brand-tag { color: #8d8274; }
.footer-bottom { margin-top: 52px; padding-top: 22px; border-top: 1px solid #2c2722; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .84rem; color: #8d8274; }

/* ---------- Cookie banner ---------- */
.cookie-banner { position: fixed; left: 20px; right: 20px; bottom: 20px; z-index: 150; max-width: 560px; background: var(--ink); color: #e9e1d4; padding: 20px 22px; border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.25); font-size: .9rem; display: none; }
.cookie-banner.show { display: block; }
.cookie-banner p { margin: 0 0 12px; }
.cookie-banner a { color: var(--gold); }
.cookie-banner .btn { padding: 9px 18px; font-size: .86rem; }

/* ---------- Misc ---------- */
.pill-list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; }
.pill-list li { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; margin: 0; font-size: .9rem; }
.sitemap-list { columns: 2; column-gap: 40px; }
@media (max-width: 640px) { .sitemap-list { columns: 1; } }
.sitemap-list li { break-inside: avoid; margin-bottom: .9em; }
.sitemap-list span { display: block; font-size: .88rem; color: var(--muted); }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .art-card { transition: none; }
}
