/* ============================================================
   Santuy website — shared styles
   The Krysion design language (see the Krysion Website repo's
   DESIGN.md), dark palette, Santuy purple (#AA00FF) accent, Gabarito.
   The header (santuy-header.js) and footer (krysion.com/footer.js)
   read the chrome variables below.
   ============================================================ */

:root {
	--accent: #AA00FF;
	--accent-hover: #c23dff;   /* lighter on dark, so hover reads as "lit" */
	--accent-soft: #3d1663;    /* borders/badges on tinted boxes, icon disks */
	--accent-tint: #26113d;    /* background of highlighted boxes, hover fills */

	/* Santuy's own dark palette: the Krysion dark palette, tinted purple */
	--ink: #f3ecff;
	--ink-soft: #c9b9e6;
	--muted: #8f7db0;

	--bg: #0e0916;
	--bg-alt: #170f27;
	--bg-tint: #1f1534;
	--panel: #170f27;
	--border: #2c1d48;
	--border-strong: #3f2b62;

	--chrome-bg: rgba(14, 9, 22, .82);
	--chrome-solid: #170f27;
	--chrome-ink: #f3ecff;
	--chrome-ink-soft: #c9b9e6;
	--chrome-border: #2c1d48;
	--chrome-hover: var(--accent-tint);

	/* the supporting cast: used for stars, badges, per-card hues, status */
	--gold: #fbbf24;
	--pink: #ff4fa3;
	--teal: #2dd4bf;
	--blue: #60a5fa;
	--green: #6fe0a0;
	--orange: #fb923c;
	--danger: #ff6b6b;
	--success: #6fe0a0;

	--shadow-sm: 0 2px 8px rgba(0, 0, 0, .25);
	--shadow-md: 0 8px 28px rgba(0, 0, 0, .35);
	--shadow-lg: 0 24px 64px rgba(0, 0, 0, .5);

	--radius-sm: 10px;
	--radius: 16px;
	--radius-lg: 24px;
	--radius-pill: 999px;

	--font: "Gabarito", system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

	--maxw: 1120px;
	--header-h: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }

body {
	margin: 0;
	font-family: var(--font);
	color: var(--ink);
	background: var(--bg);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
	min-height: 100vh;
	display: flex; flex-direction: column;
}
main, .page-main { flex: 1; }

a { color: var(--accent-hover); text-decoration: none; }
a:hover { color: #fff; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, h5, h6 { margin: 0; line-height: 1.15; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
p { margin: 0; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.hidden { display: none !important; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 860px; }
.section { padding: 92px 0; }
.center { text-align: center; }
.section-title { font-size: clamp(1.8rem, 4vw, 2.6rem); text-align: center; margin: 0 0 46px; }
.eyebrow { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; }

/* ---------- Page hero (title block under the header) ---------- */
.page-hero { padding: 64px 0 40px; text-align: center; }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin: 0 0 12px; letter-spacing: -.02em; }
.page-hero p { font-size: 1.15rem; color: var(--ink-soft); max-width: 56ch; margin: 0 auto; }
.page-hero.left { text-align: left; }
.page-hero.left p { margin: 0; }

/* ---------- Buttons (no shadow / glow) ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 9px;
	font-family: var(--font); font-weight: 600; font-size: 1.02rem;
	padding: 13px 26px; border-radius: var(--radius-pill);
	border: 2px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none;
	line-height: 1.3;
	transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}
.btn svg { width: 1.1em; height: 1.1em; }
.btn i { font-size: 1.05em; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; transform: translateY(-2px); }
.btn-ghost { background: var(--panel); color: var(--ink); border-color: var(--border-strong); }
.btn-ghost:hover { color: var(--ink); border-color: var(--accent-hover); transform: translateY(-2px); }
.btn-danger { background: var(--panel); color: var(--danger); border-color: var(--border-strong); }
.btn-danger:hover { color: #fff; background: #c0392b; border-color: #c0392b; transform: translateY(-2px); }
.btn-sm { font-size: .95rem; padding: 9px 18px; }
.btn-lg { font-size: 1.1rem; padding: 16px 34px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none !important; }
.btn:active { transform: scale(.97); }

/* ---------- Icon button (Travel Journal style: soft disc, no outline) ---------- */
.icon-btn {
	display: inline-grid; place-items: center;
	width: 40px; height: 40px; border-radius: 50%;
	border: 0; background: var(--bg-tint); color: var(--ink-soft);
	cursor: pointer; transition: background .15s, color .15s, transform .12s; flex: none;
	font-family: var(--font);
}
.icon-btn:hover { background: var(--border-strong); color: var(--ink); }
.icon-btn:active { transform: scale(.95); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn i { font-size: 17px; }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm i { font-size: 14px; }

/* ---------- Cards ---------- */
.card {
	background: var(--panel); border: 1px solid var(--border);
	border-radius: var(--radius); padding: 26px 24px; color: var(--ink);
}
/* clickable cards: a 2px ring drawn just inside the edge on hover (covers the 1px
   border, so the outline reads as thick as a button's without any layout shift) */
a.card, .card.clickable, .ring { outline: 2px solid transparent; outline-offset: -2px; transition: transform .16s ease, outline-color .16s ease; cursor: pointer; }
a.card:hover, .card.clickable:hover, .ring:hover { outline-color: var(--hue, var(--accent-hover)); transform: translateY(-2px); color: var(--ink); }
.card-lesser { background: var(--bg-alt); }
.tinted { background: var(--accent-tint); border: 1px solid var(--accent-soft); border-radius: var(--radius); padding: 18px 22px; }
.ic-disk { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--hue, var(--accent-hover)) 22%, var(--panel)); color: var(--hue, var(--accent-hover)); }
.ic-disk i { font-size: 20px; }


/* ---------- Inputs / search / chips / segmented ---------- */
.input, .textarea, .select {
	width: 100%; font: inherit; color: var(--ink);
	background: var(--bg-tint); border: 1px solid var(--border-strong);
	border-radius: var(--radius-pill); padding: 11px 16px; outline: none;
	transition: border-color .15s, background .15s;
}
.textarea { border-radius: var(--radius); resize: vertical; min-height: 110px; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent-hover); }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.select {
	appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238b839a' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 16px center;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .9rem; font-weight: 600; color: var(--ink); }
.field .hint { font-size: .85rem; color: var(--muted); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 18px; height: 18px; }

.search {
	position: relative; display: flex; align-items: center; gap: 10px;
	background: var(--bg-tint); border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
	padding: 0 8px 0 16px; color: var(--muted); transition: border-color .15s;
}
.search:focus-within { border-color: var(--accent-hover); }
.search i.lead { flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: var(--ink); padding: 11px 0; outline: none; }
.search input::placeholder { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
	font-family: var(--font); font-weight: 600; font-size: .9rem; padding: 7px 14px;
	border-radius: var(--radius-pill); background: var(--panel); border: 1px solid var(--border);
	color: var(--ink-soft); cursor: pointer; transition: background .15s, color .15s, border-color .15s;
	display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.chip:hover { color: var(--ink); border-color: var(--accent-hover); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.seg { display: inline-flex; background: var(--panel); border: 2px solid var(--border); border-radius: var(--radius-pill); padding: 3px; gap: 2px; }
.seg button {
	border: 0; background: none; cursor: pointer; border-radius: var(--radius-pill); padding: 7px 14px;
	font-family: var(--font); font-size: .9rem; font-weight: 600; color: var(--muted);
	display: inline-flex; align-items: center; gap: 6px; transition: background .15s, color .15s;
}
.seg button:hover { color: var(--ink); }
.seg button.active { background: var(--accent); color: #fff; }

/* ---------- Badges ---------- */
.badge {
	display: inline-flex; align-items: center; gap: 5px;
	font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
	color: #fff; background: var(--accent); padding: 4px 11px; border-radius: var(--radius-pill); line-height: 1.4;
}
.badge-soft { background: var(--accent-soft); color: var(--accent-hover); }

/* ---------- Prose (text pages) ---------- */
.prose { max-width: 760px; margin: 0 auto; font-size: 1.06rem; line-height: 1.7; color: var(--ink-soft); }
.prose p { margin: 0 0 1.25em; }
.prose h2 { font-size: 1.6rem; margin: 2.2em 0 .6em; }
.prose h3 { font-size: 1.25rem; margin: 1.6em 0 .5em; }
.prose ul, .prose ol { margin: 0 0 1.25em; padding-left: 1.3em; }
.prose li { margin: .3em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.5em; font-size: .98rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.prose th { color: var(--ink); font-weight: 700; }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--bg-tint); padding: .1em .4em; border-radius: 6px; color: var(--ink); }
.prose blockquote { margin: 22px 0; padding: 16px 22px; border-left: 4px solid var(--accent); background: var(--accent-tint); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prose blockquote p { margin: 0; }
.prose a:hover { text-decoration: underline; }

/* ---------- Modals (Travel Journal structure on the tokens) ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 1500; background: rgba(0, 0, 0, .6); display: none; animation: fadeIn .2s both; }
.modal-backdrop.open { display: block; }
.modal {
	position: fixed; z-index: 1501; left: 50%; top: 50%; transform: translate(-50%, -50%);
	width: min(800px, calc(100vw - 2rem)); max-height: min(88vh, 760px);
	background: var(--panel); color: var(--ink); border: 1px solid var(--border);
	border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
	display: none; flex-direction: column; overflow: hidden;
}
.modal.open { display: flex; animation: modalIn .28s cubic-bezier(.2, .8, .2, 1) both; }
.modal.open.closing { animation: modalOut .2s ease both; }
.modal-backdrop.closing { animation: fadeOut .2s ease both; }
.modal-sm { width: min(480px, calc(100vw - 2rem)); }
.modal-wide { width: min(960px, calc(100vw - 2rem)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 26px; }
.modal-head + .modal-body { padding-top: 2px; }
.modal-head h3 { font-size: 1.3rem; line-height: 1.3; display: flex; align-items: center; gap: 10px; margin: 0; }
.modal-head h3 i { color: var(--accent-hover); }
.modal-sub { font-size: .92rem; color: var(--muted); font-weight: 600; margin: 3px 0 0; }
.modal-head .icon-btn { width: 42px; height: 42px; }
.modal-head .header-tools { display: flex; align-items: center; gap: 14px; }
.modal-tools { padding: 0 26px 16px; }
.modal-body { padding: 0 26px 22px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 26px; border-top: 1px solid var(--border); background: var(--bg-alt); }
.modal-foot .left { margin-right: auto; }
@keyframes fadeIn   { from { opacity: 0 } to { opacity: 1 } }
@keyframes fadeOut  { from { opacity: 1 } to { opacity: 0 } }
@keyframes modalIn  { from { opacity: 0; transform: translate(-50%, -50%) scale(.94) } to { opacity: 1; transform: translate(-50%, -50%) scale(1) } }
@keyframes modalOut { from { opacity: 1; transform: translate(-50%, -50%) scale(1) } to { opacity: 0; transform: translate(-50%, -50%) scale(.96) } }
@keyframes sheetIn  { from { transform: translateY(40px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes sheetOut { from { transform: none; opacity: 1 } to { transform: translateY(30px); opacity: 0 } }
@keyframes fadeUp   { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }
/* for boxes centred by a flex parent (no translate in the transform) */
@keyframes popIn    { from { opacity: 0; transform: scale(.94) } to { opacity: 1; transform: none } }
@keyframes popOut   { from { opacity: 1; transform: none } to { opacity: 0; transform: scale(.96) } }
@keyframes floaty   { 0%, 100% { transform: translate3d(0,0,0) } 50% { transform: translate3d(0,-12px,0) } }
@media (max-width: 600px) {
	.modal, .modal-sm, .modal-wide { left: 0; top: auto; bottom: 0; transform: none; width: 100%; max-height: 92vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-left: 0; border-right: 0; border-bottom: 0; }
	.modal.open { animation: sheetIn .3s cubic-bezier(.2, .8, .2, 1) both; }
	.modal.open.closing { animation: sheetOut .22s ease both; }
	.modal-head { padding: 16px 20px; } .modal-tools { padding: 0 20px 12px; } .modal-body { padding: 0 20px 18px; } .modal-foot { padding: 12px 20px; }
}
body.modal-open { overflow: hidden; }

/* ---------- Tooltip / toast / empty / loading ---------- */
/* Solid-colour pill (DESIGN.md §8.9): accent = info, green = success, red = error.
   Every page uses SantuyUI.toast(); none carries its own toast styles. */
.toast {
	position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(12px); z-index: 10000;
	background: var(--accent); color: #fff; font-weight: 600; padding: 12px 20px; border-radius: var(--radius-pill);
	box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .2s ease, transform .2s ease; pointer-events: none;
	display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); font-size: .95rem; line-height: 1.35;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast i { color: #fff; font-size: 1.05em; flex-shrink: 0; }
.toast.ok { background: #1f9d55; }
.toast.err { background: #d64545; }
.empty-state { text-align: center; color: var(--muted); padding: 48px 16px; display: grid; gap: 14px; justify-items: center; }
.empty-state i { font-size: 2rem; color: var(--accent-soft); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--accent); border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { position: fixed; inset: 0; background: rgba(20, 16, 27, .6); display: grid; place-items: center; z-index: 1400; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .95rem; border: 1px solid; }
.alert-error { background: rgba(255, 107, 107, .1); border-color: rgba(255, 107, 107, .35); color: #ffb3b3; }
.alert-ok { background: rgba(111, 224, 160, .1); border-color: rgba(111, 224, 160, .35); color: var(--success); }

/* ---------- Avatar ---------- */
.avatar { border-radius: 50%; object-fit: cover; background: var(--bg-tint); border: 2px solid var(--border-strong); flex: none; }

/* ---------- Footer (shared krysion.com/footer.js) ---------- */
.krysion-footer {
	--kf-maxw: var(--maxw);
	--kf-bg: var(--bg-alt);
	--kf-border: var(--chrome-border);
	--kf-ink: var(--chrome-ink);
	--kf-ink-soft: var(--chrome-ink-soft);
	--kf-hover: rgba(255, 255, 255, .08);
	--kf-accent: var(--accent-hover);
	margin-top: auto;
}

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
	.reveal { opacity: 1; transform: none; }
	html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
	.section { padding: 60px 0; }
	.section-title { margin-bottom: 32px; }
	.page-hero { padding: 44px 0 32px; }
	.prose { font-size: 1.05rem; }
}
