/* ─────────────────────────────────────────────────────────────────────────
   WETRIPER — Core
   Design system: Bold & Editorial.
   One file covers: tokens, reset, global, header, footer, buttons, atoms.
   ───────────────────────────────────────────────────────────────────────── */

@font-face {
	font-family: "Satoshi";
	font-style: normal;
	font-weight: 300;
	font-display: swap;
	src: url("../fonts/satoshi-300.woff2") format("woff2");
}

@font-face {
	font-family: "Satoshi";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/satoshi-400.woff2") format("woff2");
}

@font-face {
	font-family: "Satoshi";
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url("../fonts/satoshi-500.woff2") format("woff2");
}

@font-face {
	font-family: "Satoshi";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/satoshi-700.woff2") format("woff2");
}

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
	/* Colour palette */
	--c-bg: #fafafa;
	/* base background                           */
	--c-surface: #ffffff;
	/* card / panel backgrounds                  */
	--c-surface-2: #f2f2f2;
	/* subtle inset background                   */
	--c-ink: #121212;
	/* primary text & icons                      */
	--c-ink-2: #404040;
	/* secondary headings                        */
	--c-muted: #a6a6a6;
	/* captions, meta, placeholders              */
	--c-line: #ededed;
	/* borders, dividers                         */
	--c-accent: #121212;
	/* brand accent — monochrome                 */
	--c-accent-bg: #f2f2f2;
	/* subtle accent tint                        */
	--c-dark: #121212;
	/* dark sections, primary button bg          */
	--c-white: #ffffff;
	/* Transparency tokens */
	--c-white-80: #ffffffcc;
	--c-white-30: #ffffff4d;
	--c-white-10: #ffffff1a;
	--c-bg-trans: #fafafae6;
	--c-bg-50: #fafafa99;

	/* Typography */
	--font: "Satoshi", system-ui, sans-serif;

	/* Fluid type scale */
	--text-xs: 0.75rem;
	/* 12px */
	--text-sm: 0.875rem;
	/* 14px */
	--text-base: 1rem;
	/* 16px */
	--text-lg: 1.125rem;
	/* 18px */
	--text-xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
	--text-2xl: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
	--text-3xl: clamp(2rem, 1.4rem + 2.4vw, 3rem);
	--text-4xl: clamp(2.8rem, 1.8rem + 4vw, 5rem);
	--text-5xl: clamp(3.2rem, 2rem + 5.5vw, 6.5rem);
	--text-hero: clamp(3.6rem, 2rem + 7vw, 9rem);

	/* Spacing */
	--sp-1: 4px;
	--sp-2: 8px;
	--sp-3: 12px;
	--sp-4: 16px;
	--sp-5: 24px;
	--sp-6: 32px;
	--sp-7: 48px;
	--sp-8: 64px;
	--sp-9: 88px;
	--sp-10: 120px;

	/* Radii */
	--r-xs: 4px;
	--r-sm: 8px;
	--r-md: 14px;
	--r-lg: 20px;
	--r-xl: 32px;
	--r-pill: 999px;

	/* Shadows */
	--shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.05);
	--shadow-card-hover: 0 4px 4px rgba(0, 0, 0, 0.04), 0 8px 20px rgba(0, 0, 0, 0.06);

	/* Layout */
	--container: 1320px;
	--gutter: clamp(20px, 4vw, 48px);

	/* Header height (used by sticky sidebar) */
	--header-h: 72px;
}

/* ── Dark mode tokens ───────────────────────────────────────────────────── */
[data-theme="dark"] {
	--c-bg:         #111111;
	--c-surface:    #1c1c1c;
	--c-surface-2:  #272727;
	--c-ink:        #ededed;
	--c-ink-2:      #c0c0c0;
	--c-muted:      #ababab;
	--c-line:       #2c2c2c;
	--c-accent:     #ededed;
	--c-accent-bg:  #272727;
	/* --c-dark and --c-white intentionally NOT overridden —
	   they are used for always-dark sections (hero, CTA, primary btn)
	   and must stay #121212 / #ffffff in both modes. */
	--c-bg-trans:   #111111e6;
	--c-bg-50:      #11111199;
}

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

html {
	min-height: 100%;
	scroll-behavior: smooth;
}

body {
	min-height: 100%;
	overflow-x: hidden; /* fallback */
	overflow-x: clip;   /* modern: clips without creating a scroll container; sticky still works */
	margin: 0;
	background: var(--c-bg);
	color: var(--c-ink);
	font-family: var(--font);
	font-size: var(--text-base);
	font-weight: 400;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

body.is-menu-open {
	overflow: hidden;
}

img,
picture,
svg,
video {
	display: block;
	max-width: 100%;
}

img {
	height: auto;
}

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

p,
h1,
h2,
h3,
h4,
h5,
h6,
figure {
	margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font);
	font-weight: 600;
	line-height: 0.95;
	letter-spacing: -0.04em;
	color: var(--c-ink);
}

h1 {
	font-size: var(--text-4xl);
}

h2 {
	font-size: var(--text-2xl);
}

h3 {
	font-size: var(--text-lg);
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1.2;
}

h4 {
	font-size: var(--text-xl);
	font-weight: 500;
}

p {
	color: var(--c-muted);
	line-height: 1.65;
}

button,
input,
select,
textarea {
	font: inherit;
}

/* Stop iOS Safari from zooming in on focus: it auto-zooms whenever a form
   field's font-size is below 16px. Forcing 16px on small screens prevents it
   without disabling pinch-zoom (which would hurt accessibility). */
@media (max-width: 768px) {
	input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
	select,
	textarea {
		font-size: 16px;
	}
}

button {
	cursor: pointer;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
	width: 100%;
	appearance: none;
	border: 1px solid var(--c-line);
	border-radius: var(--r-lg);
	background: var(--c-surface);
	color: var(--c-ink);
	padding: 0.9rem 1.1rem;
	transition: border-color 150ms, box-shadow 150ms;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
	outline: none;
	border-color: var(--c-ink);
	box-shadow: 0 0 0 3px rgba(0, 0, 0, .05);
}

input:not([type="checkbox"]):not([type="radio"])::placeholder,
textarea::placeholder {
	color: var(--c-muted);
}

/* Select: custom chevron */
select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 1.1rem center;
	padding-right: 2.6rem;
	cursor: pointer;
}

textarea {
	min-height: 8rem;
	resize: vertical;
	line-height: 1.65;
}

button:focus-visible,
a:focus-visible {
	outline: 2px solid var(--c-accent);
	outline-offset: 3px;
	border-radius: var(--r-xs);
}

label {
	color: var(--c-ink);
	font-size: var(--text-sm);
	font-weight: 600;
}

/* Stack label text above its input — only for field labels, not for inline choices */
label:has(> input:not([type="checkbox"]):not([type="radio"])),
label:has(> select),
label:has(> textarea) {
	display: grid;
	gap: var(--sp-2);
}

.sr-only,
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.site-frame {
	min-height: 100dvh;
}

.site-main {
	padding-block: 0 var(--sp-10);
}

.shell {
	width: min(var(--container), calc(100% - var(--gutter) * 2));
	margin-inline: auto;
}

/* Flex row utility */
.row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--sp-3);
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	height: var(--header-h);
	background: var(--c-bg);
}

.site-header__inner {
	display: flex;
	align-items: center;
	height: 100%;
	gap: var(--sp-6);
	justify-content: space-between;

}

/* Logo */
.site-branding__link {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.site-branding__mark img {
	width: auto;
	height: 40px;
}

.custom-logo-link img {
	width: auto;
	max-height: 40px;
}

/* ── App nav (icon + label · top on desktop, floating bottom bar on mobile) ─ */
.app-nav {
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 4px;
	background: var(--c-dark);
	border-radius: var(--r-pill);
}

[data-theme="dark"] .app-nav {
	border: 1px solid var(--c-line);
}

.app-nav__item {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 6px 18px;
	border-radius: var(--r-pill);
	color: rgba(255, 255, 255, 0.6);
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none;
	transition: color 150ms, background 150ms;
}

.app-nav__item i {
	font-size: 1.05rem;
	line-height: 1;
}

.app-nav__item:hover {
	color: #fff;
}

.app-nav__item.is-active {
	background: #fff;
	color: var(--c-dark);
}

.app-nav__avatar {
	display: block;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	overflow: hidden;
	flex-shrink: 0;
}

.app-nav__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Notification badge on the Account item */
.app-nav__ico-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.app-nav__badge {
	position: absolute;
	top: -7px;
	right: -10px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	box-sizing: border-box;
	border-radius: 999px;
	background: #e11d48;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	line-height: 16px;
	text-align: center;
	box-shadow: 0 0 0 2px var(--c-dark);
}

/* Dark mode toggle (header) */
.site-header__theme {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 1px solid var(--c-line);
	background: var(--c-surface);
	color: var(--c-ink);
	cursor: pointer;
	flex-shrink: 0;
	transition: background 150ms, border-color 150ms;
}

.site-header__theme:hover {
	background: var(--c-surface-2);
	border-color: var(--c-ink);
}

.site-header__theme i {
	font-size: 1rem;
	line-height: 1;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
	background: #121212;
	color: #ffffff;
	padding-block: var(--sp-8) var(--sp-6);
}

.site-footer__inner {
	display: grid;
	grid-template-columns: 1.5fr 1fr 1fr 1fr;
	gap: var(--sp-7);
}

.site-footer__brand {
	display: grid;
	gap: var(--sp-4);
}

.site-footer__logo img {
	width: 120px;
	height: auto;
}

/* ── Logo theme swap ─────────────────────────────────────────────────────── */
.logo--dark { display: none; }

[data-theme="dark"] .logo--light { display: none; }
[data-theme="dark"] .logo--dark  { display: block; }

.site-footer__tagline {
	color: rgba(255, 255, 255, 0.5);
	font-size: var(--text-sm);
	line-height: 1.6;
}

.site-footer__col h4 {
	color: var(--c-white);
	font-size: var(--text-sm);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	margin-bottom: var(--sp-4);
}

.site-footer__col ul {
	display: grid;
	gap: var(--sp-3);
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer__col a {
	color: rgba(255, 255, 255, 0.55);
	font-size: var(--text-sm);
	transition: color 150ms;
}

.site-footer__col a:hover {
	color: var(--c-white);
}

.site-footer__bottom {
	margin-top: var(--sp-7);
	padding-top: var(--sp-5);
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-4);
	color: rgba(255, 255, 255, 0.35);
	font-size: var(--text-xs);
}

/* ── Footer dark-mode toggle ────────────────────────────────────────────── */
.footer-theme-toggle {
	display: inline-flex;
	align-items: center;
	gap: var(--sp-2);
	background: none;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: var(--r-pill);
	padding: 0.35rem 0.85rem;
	color: rgba(255, 255, 255, 0.5);
	font-family: inherit;
	font-size: var(--text-xs);
	font-weight: 500;
	cursor: pointer;
	transition: border-color 150ms, color 150ms;
}

.footer-theme-toggle:hover {
	border-color: rgba(255, 255, 255, 0.4);
	color: rgba(255, 255, 255, 0.85);
}

.footer-theme-toggle i {
	font-size: 0.95rem;
	line-height: 1;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn,
.button,
.c-button,
button[type="submit"],
input[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--sp-2);
	min-height: 44px;
	padding: 0.7rem 1.4rem;
	border: 1.5px solid var(--c-dark);
	border-radius: var(--r-pill);
	background: var(--c-dark);
	color: var(--c-white);
	font-size: var(--text-sm);
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none;
	cursor: pointer;
	transition: background 150ms, border-color 150ms, color 150ms, transform 150ms;
}

.btn:hover,
.button:hover,
.c-button:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
	background: var(--c-accent);
	border-color: var(--c-accent);
	color: var(--c-white);
}

/* Secondary / ghost button */
.btn--secondary,
.button-secondary,
.c-button--secondary {
	background: transparent;
	border-color: var(--c-line);
	color: var(--c-ink);
}

.btn--secondary:hover,
.button-secondary:hover,
.c-button--secondary:hover {
	background: var(--c-surface);
	border-color: var(--c-ink);
	color: var(--c-ink);
}

/* Accent button */
.btn--accent {
	background: var(--c-accent);
	border-color: var(--c-accent);
}

.btn--accent:hover {
	background: #333333;
	border-color: #333333;
}

/* White button — for use on dark/image backgrounds */
.btn--white {
	background: var(--c-white);
	border-color: var(--c-white);
	color: var(--c-dark);
}

.btn--white:hover {
	background: var(--c-bg);
	border-color: var(--c-bg);
	color: var(--c-dark);
}

/* Large button */
.btn--lg {
	min-height: 52px;
	padding: 0.9rem 2rem;
	font-size: var(--text-base);
}

/* ── Eyebrow label ───────────────────────────────────────────────────────── */
p.eyebrow,
span.eyebrow,
.eyebrow {
	display: inline-block;
	width: fit-content;
	padding: 0.25rem 0.75rem;
	background: var(--c-white);
	border-radius: var(--r-pill);
	font-size: var(--text-xs);
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--c-muted);
}

/* ── Section heading ─────────────────────────────────────────────────────── */
.section-head {
	display: grid;
	gap: var(--sp-3);
	max-width: 52rem;
}

.section-head--row {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--sp-5);
	max-width: none;
}

/* ── Notice / alert ─────────────────────────────────────────────────────── */
.catm-notice {
	padding: var(--sp-4) var(--sp-5);
	border-radius: var(--r-md);
	font-size: var(--text-sm);
	font-weight: 500;
}

.catm-notice-success {
	background: #EAF7F0;
	color: #1A6B40;
	border: 1px solid #B6E4CC;
}

.catm-notice-error {
	background: #FEF2F2;
	color: #991B1B;
	border: 1px solid #FECACA;
}

/* ── Dark mode overrides for hardcoded semantic colours ─────────────────── */
[data-theme="dark"] .catm-notice-success {
	background: #052e16;
	color: #86efac;
	border-color: #166534;
}
[data-theme="dark"] .catm-notice-error {
	background: #2d0c0c;
	color: #fca5a5;
	border-color: #991b1b;
}

/* ── Dark mode: eyebrow pill ─────────────────────────────────────────────── */
/* In dark mode --c-white stays #fff, making eyebrows glow white on dark bg.
   Replace with the subtle dark surface. */
[data-theme="dark"] p.eyebrow,
[data-theme="dark"] span.eyebrow,
[data-theme="dark"] .eyebrow {
	background: var(--c-surface-2);   /* #272727 — visible on #111 page bg   */
	color: var(--c-muted);
}

/* CTA banner is already dark (#121212); keep the eyebrow pill readable there */
[data-theme="dark"] .cta-banner .eyebrow {
	background: rgba(255, 255, 255, 0.1);
	color: rgba(255, 255, 255, 0.55);
}

/* ── Dark mode: button fixes ─────────────────────────────────────────────── */
/* --c-dark (#121212) ≈ --c-bg (#111111) in dark mode, so dark-bg buttons
   become invisible. Invert submit buttons to white background + dark text. */
[data-theme="dark"] button[type="submit"],
[data-theme="dark"] input[type="submit"] {
	background: var(--c-white);
	border-color: var(--c-white);
	color: var(--c-dark);
}

/* Primary button hover → accent bg becomes light (#ededed), text must go dark */
[data-theme="dark"] .btn:hover,
[data-theme="dark"] .button:hover,
[data-theme="dark"] button[type="submit"]:hover,
[data-theme="dark"] input[type="submit"]:hover {
	color: var(--c-dark);
}

/* Secondary button hover keeps its own light ink text — restore it after the
   broad override above (same specificity, but later in file = cascade wins) */
[data-theme="dark"] .btn--secondary:hover,
[data-theme="dark"] .button-secondary:hover,
[data-theme="dark"] .c-button--secondary:hover {
	color: var(--c-ink);   /* --c-ink = #ededed in dark mode → readable on --c-surface */
}

/* Accent-variant button: light bg in dark mode — must use dark text */
[data-theme="dark"] .btn--accent {
	color: var(--c-dark);
}
[data-theme="dark"] .btn--accent:hover {
	color: var(--c-dark);
}


/* ── Dark mode: CTA banner ───────────────────────────────────────────────── */
/* --c-dark (#121212) is almost identical to --c-bg (#111111) in dark mode —
   the card blends into the page. Use surface + border to restore separation. */
[data-theme="dark"] .cta-banner {
	background: var(--c-surface);      /* #1c1c1c — clearly distinct from page */
	border: 1px solid var(--c-line);
}

/* ── Pagination ─────────────────────────────────────────────────────────── */
.nav-links,
.pagination {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sp-2);
	margin-top: var(--sp-7);
}

.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding-inline: var(--sp-3);
	border: 1.5px solid var(--c-line);
	border-radius: var(--r-md);
	background: var(--c-surface);
	color: var(--c-ink);
	font-size: var(--text-sm);
	font-weight: 500;
	transition: background 150ms, border-color 150ms;
}

.page-numbers:hover {
	border-color: var(--c-ink);
}

.page-numbers.current {
	background: var(--c-ink);
	border-color: var(--c-ink);
	color: var(--c-white);
}

.page-numbers.dots {
	border: none;
	background: none;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
	.site-footer__inner {
		grid-template-columns: 1fr 1fr;
		gap: var(--sp-6);
	}
}

@media (max-width: 768px) {
	:root {
		--header-h: 64px;
	}

	/* App nav drops to a floating bottom bar; items stack icon-over-label */
	.app-nav {
		position: fixed;
		bottom: 14px;
		left: 12px;
		right: 12px;
		z-index: 200;
		justify-content: space-around;
		gap: 2px;
		padding: 5px;
		box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
	}

	.app-nav__item {
		flex: 1;
		flex-direction: column;
		gap: 3px;
		padding: 6px 8px;
		font-size: 10px;
		justify-content: center;
	}

	.app-nav__item i {
		font-size: 1.2rem;
	}

	.app-nav__avatar {
		width: 21px;
		height: 21px;
	}

	/* Clear space so content isn't hidden behind the floating bar */
	.site-main {
		padding-bottom: 88px;
	}

	.section-head--row {
		flex-direction: column;
		align-items: flex-start;
	}

	.site-footer__inner {
		grid-template-columns: 1fr 1fr;
	}

	.site-footer__brand {
		grid-column: 1 / -1;
	}
}

@media (max-width: 480px) {
	.site-footer__inner {
		grid-template-columns: 1fr;
	}
}