/* g1f.fr « Le Gif Français » : direction tricolore (docs/design_handoff_g1f_refonte) */
:root {
	--bg: #f8f5ef;
	--surface: #ece7de;
	--text: #1b1e2b;
	--accent: #d32f22;
	--accent-2: #1e3a8f;
	--divider: color-mix(in srgb, #1b1e2b 16%, transparent);

	--n-100: #fbf9f5; --n-200: #f1ede6; --n-300: #e0dad0; --n-400: #c4bdb1; --n-500: #a59e92;
	--n-600: #857f74; --n-700: #666157; --n-800: #48443d; --n-900: #2b2a2c;
	--r-100: #fdeeec; --r-200: #fbd9d5; --r-300: #f5b3ab; --r-400: #ea7e72; --r-500: #d9503f;
	--r-600: #b52619; --r-700: #911f15; --r-800: #6a1a12; --r-900: #43120d;
	--b-100: #eef1fb; --b-200: #d9e0f6; --b-300: #b4c2ec; --b-400: #7f95d6; --b-500: #4d68b9;
	--b-600: #2f4c9c; --b-700: #233b7c; --b-800: #1a2c5d; --b-900: #111d3d;

	--font-heading: "Caprasimo", Georgia, serif;
	--font-body: "Figtree", system-ui, -apple-system, sans-serif;
	--font-mono: ui-monospace, Menlo, Consolas, monospace;

	--shadow-sm: 0 1px 2px color-mix(in srgb, #2e2b25 14%, transparent);
	--shadow-md: 0 3px 10px color-mix(in srgb, #2e2b25 16%, transparent);
	--shadow-lg: 0 12px 32px color-mix(in srgb, #2e2b25 22%, transparent);

	--gutter: clamp(16px, 4vw, 40px);
	--grid-gap: clamp(10px, 1.4vw, 16px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	overflow-x: hidden;
	background: var(--bg);
	color: var(--text);
	font: 15px/1.55 var(--font-body);
	-webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 400; line-height: 1.08; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--r-700); }
a:hover { color: var(--r-800); }
img { max-width: 100%; }
code { font-family: var(--font-mono); font-size: .92em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.icon { flex: none; }
.muted { font-size: 14px; color: var(--n-700); }
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 60; padding: 8px 14px; border-radius: 999px; background: var(--text); color: var(--bg); }
.skip:focus { left: 8px; }

/* ---------- Boutons */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	height: 44px; padding: 0 20px; border: 0; border-radius: 999px;
	font: 15px/1 var(--font-heading); text-decoration: none; cursor: pointer;
	transition: background-color .15s, color .15s;
}
.btn-accent { background: var(--accent); color: var(--bg); }
.btn-accent:hover { background: var(--r-600); color: var(--bg); }
.btn-accent:active { background: var(--r-700); }
.btn-accent:disabled { opacity: .45; cursor: not-allowed; background: var(--accent); }
.btn-dark { background: var(--text); color: var(--bg); }
.btn-dark:hover { background: var(--n-800); color: var(--bg); }
.btn-outline { border: 1.5px solid var(--text); background: transparent; color: var(--text); }
.btn-outline:hover { background: var(--text); color: var(--bg); }
.btn-navy { background: var(--b-800); color: var(--b-100); }
.btn-navy:hover { background: var(--b-900); color: var(--b-100); }
.btn-outline-navy { border-color: var(--b-800); color: var(--b-900); }
.btn-outline-navy:hover { background: var(--b-800); color: var(--b-100); }
.btn-light { background: var(--r-400); color: var(--n-900); }
.btn-light:hover { background: var(--r-300); }
.btn-lg { height: 48px; padding: 0 22px; font-size: 16px; }
.btn-xl { height: 54px; font-size: 18px; width: 100%; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn-xs { height: 32px; padding: 0 14px; font: 700 13px/1 var(--font-body); }

/* ---------- Header */
.header {
	position: sticky; top: 0; z-index: 20;
	background: color-mix(in srgb, var(--bg) 90%, transparent);
	-webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.header-in { padding-top: 14px; padding-bottom: 10px; display: flex; flex-direction: column; gap: 12px; }
.header-top { display: flex; align-items: center; gap: clamp(6px, 1.5vw, 12px); }
.logo { display: flex; align-items: center; gap: 8px; margin-right: auto; min-width: 0; flex: 1 1 auto; overflow: hidden; color: var(--text); text-decoration: none; }
.logo:hover { color: var(--text); }
.logo-disc {
	width: 42px; height: 42px; flex: none; border-radius: 50%;
	background: linear-gradient(90deg, var(--accent-2) 0 33.4%, var(--n-100) 33.4% 66.6%, var(--accent) 66.6%);
	box-shadow: inset 0 0 0 1px var(--divider);
}
.logo-name { font: clamp(17px, 3.4vw, 22px)/1.1 var(--font-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.badge-18 { flex: none; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--r-800); color: var(--r-100); }
.btn-round {
	width: 44px; height: 44px; flex: none; border-radius: 50%;
	border: 1px solid var(--divider); color: var(--text);
	display: grid; place-items: center; transition: background-color .15s;
}
.btn-round:hover { background: var(--r-100); color: var(--text); }
.btn-propose { flex: none; padding: 0 clamp(12px, 2vw, 18px); }

.search { position: relative; display: flex; align-items: center; }
.search > .icon { position: absolute; left: 20px; color: var(--n-700); pointer-events: none; }
.search input {
	width: 100%; height: 54px; padding: 0 120px 0 52px;
	border-radius: 999px; border: 1.5px solid var(--divider); background: var(--n-100);
	font: 16px var(--font-body); color: var(--text); caret-color: var(--accent);
	outline: none; box-shadow: var(--shadow-sm); -webkit-appearance: none; appearance: none;
}
.search input:focus { border-color: var(--accent); }
.search input::-webkit-search-cancel-button { display: none; }
.search .btn { position: absolute; right: 6px; height: 42px; }

.chips {
	display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
	margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 4px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
	flex: none; padding: 7px 15px; border-radius: 999px;
	background: var(--surface); color: var(--text);
	text-decoration: none; font-size: 14px; font-weight: 600; line-height: 1.3;
	transition: background-color .15s;
}
.chip:hover { background: var(--r-200); color: var(--r-900); }
.chip-blue { padding: 6px 14px; background: var(--b-200); color: var(--b-900); }
.chip-blue:hover { background: var(--b-300); color: var(--b-900); }
.chip-red { padding: 5px 13px; background: var(--r-100); color: var(--r-800); }
.chip-red:hover { background: var(--r-200); color: var(--r-800); }

/* ---------- Contenu */
.main { flex: 1; padding-top: 20px; padding-bottom: 64px; }
.section { margin-bottom: 44px; }
.section:last-child { margin-bottom: 0; }
.section-title { font-size: clamp(22px, 3vw, 28px); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.section-title .icon { color: var(--accent); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head .section-title { margin: 0; }
.section-similar { margin-top: clamp(40px, 7vw, 72px); }
.lead { font-size: clamp(16px, 2vw, 18px); color: var(--n-800); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.related { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.related > .muted { margin-right: 4px; }

.hero { position: relative; isolation: isolate; padding: clamp(24px, 6vw, 64px) 0 clamp(28px, 5vw, 48px); }
.hero h1 { font-size: clamp(38px, 7vw, 76px); line-height: 1.02; margin-bottom: 18px; max-width: 11ch; }
.hero p { font-size: clamp(16px, 2vw, 19px); max-width: 42ch; color: var(--n-800); }
.hero-dot { position: absolute; z-index: -1; border-radius: 50%; aspect-ratio: 1; }
.hero-dot-blue { right: -120px; top: -40px; width: clamp(220px, 40vw, 460px); background: var(--b-300); }
.hero-dot-red { right: clamp(40px, 14vw, 220px); top: clamp(120px, 22vw, 260px); width: clamp(70px, 10vw, 130px); background: var(--r-300); }

.cloud { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; max-width: 900px; }
.cloud-tag {
	padding: 8px 18px; border-radius: 999px; text-decoration: none;
	font-family: var(--font-heading); font-size: calc(14px + var(--w, 1) * 3px); line-height: 1.2;
	transition: transform .15s;
}
.cloud-tag:hover { transform: rotate(-2deg) scale(1.04); }
.cloud-0 { background: var(--r-200); color: var(--r-900); }
.cloud-1 { background: var(--b-200); color: var(--b-900); }
.cloud-2 { background: var(--n-100); color: var(--text); }
.cloud-0:hover { color: var(--r-900); }
.cloud-1:hover { color: var(--b-900); }
.cloud-2:hover { color: var(--text); }

/* ---------- Grille de tuiles carrées */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, calc(50% - 8px)), 1fr)); gap: var(--grid-gap); }
.tile {
	position: relative; display: block; aspect-ratio: 1; border-radius: 24px; overflow: hidden;
	background: repeating-linear-gradient(135deg, var(--n-200) 0 14px, var(--n-300) 14px 28px);
	color: var(--n-900); text-decoration: none;
	transition: transform .18s ease, box-shadow .18s ease;
}
.tile:nth-child(5n+2) { background: repeating-linear-gradient(135deg, var(--r-200) 0 14px, var(--r-300) 14px 28px); }
.tile:nth-child(5n+4) { background: repeating-linear-gradient(135deg, var(--b-200) 0 14px, var(--b-300) 14px 28px); }
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: var(--n-900); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-num, .tile-title { position: absolute; border-radius: 999px; background: color-mix(in srgb, var(--n-100) 88%, transparent); }
.tile-num { top: 10px; left: 10px; padding: 4px 8px; font: 600 10px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--n-700); }
.tile-title { left: 10px; bottom: 10px; max-width: calc(100% - 20px); padding: 6px 12px; background: var(--n-100); font-size: 13px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more { display: flex; margin-top: 28px; }
.more .btn { height: 48px; padding: 0 26px; font-size: 16px; }
.more .btn[aria-busy="true"] { opacity: .6; pointer-events: none; }

/* ---------- Résultats / 404 */
.page-head { padding: clamp(16px, 4vw, 40px) 0 24px; }
.page-head > .muted { margin-bottom: 6px; }
.page-head h1 { font-size: clamp(32px, 5.5vw, 56px); margin-bottom: 18px; }
.page-head-narrow { max-width: 720px; padding-bottom: 28px; }
.page-head-narrow h1 { font-size: clamp(34px, 6vw, 60px); margin-bottom: 12px; }

.oops { position: relative; isolation: isolate; max-width: 720px; padding: clamp(32px, 8vw, 90px) 0 40px; }
.oops-dot { position: absolute; z-index: -1; left: -60px; top: 10px; width: clamp(160px, 28vw, 280px); aspect-ratio: 1; border-radius: 50%; background: var(--r-200); }
.kicker { font: 600 12px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--r-700); margin-bottom: 14px; }
.oops h1 { font-size: clamp(44px, 9vw, 96px); line-height: .98; margin-bottom: 18px; }
.oops .lead { font-size: clamp(17px, 2.2vw, 20px); margin-bottom: 26px; }
.oops .actions { margin-bottom: 34px; }
.oops > .muted { margin-bottom: 10px; }

/* ---------- Page GIF */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; color: var(--n-700); padding: 8px 0 18px; }
.crumbs a { color: inherit; }
.crumbs [aria-current] { color: var(--text); font-weight: 600; }
.gif-page { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: clamp(20px, 4vw, 48px); align-items: start; }
.gif-figure { margin: 0; }
.gif-media {
	border-radius: 32px; overflow: hidden; box-shadow: var(--shadow-md);
	background: repeating-linear-gradient(135deg, var(--r-200) 0 14px, var(--r-300) 14px 28px);
}
.gif-media img { display: block; width: 100%; height: auto; }
.gif-figure figcaption { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 13px; color: var(--n-700); }
.gif-figure figcaption a { color: inherit; }
.gif-side { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.gif-side h1 { font-size: clamp(32px, 5vw, 52px); margin-bottom: 14px; }
.side-title { font-size: 20px; margin-bottom: 12px; }

.share-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.share {
	aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
	padding: 6px; border: 0; border-radius: 22px; background: var(--surface); color: var(--text);
	font: 700 12px/1.15 var(--font-body); text-align: center; text-decoration: none; cursor: pointer;
	transition: background-color .15s;
}
.share:hover, .share[aria-expanded="true"] { background: var(--r-200); color: var(--text); }
.share-brand:hover { background: var(--b-200); }
.share-main { background: var(--accent); color: var(--bg); }
.share-main:hover { background: var(--r-600); color: var(--bg); }
.brand { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.brand-whatsapp { background: #25d366; }
.brand-discord { background: #5865f2; }
.brand-slack { background: #4a154b; }
.brand-x { background: #000; }
.brand-messenger { background: #0866ff; }

.embed { border-radius: 24px; background: var(--n-900); color: var(--n-100); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.embed code { font-size: 13px; line-height: 1.55; word-break: break-all; }
.embed .btn { align-self: flex-start; }
.links { display: flex; flex-direction: column; gap: 8px; }
.link-field { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 16px; border-radius: 999px; background: var(--n-100); border: 1px solid var(--divider); }
.link-kind { font: 600 11px var(--font-mono); color: var(--n-600); text-transform: uppercase; }
.link-url { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Proposer */
.upload-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: clamp(20px, 4vw, 40px); align-items: start; }
.upload-card { padding: clamp(18px, 3vw, 30px); border-radius: 36px; background: var(--surface); display: flex; flex-direction: column; gap: 22px; }
.form-error { padding: 12px 16px; border-radius: 16px; background: var(--r-100); color: var(--r-800); font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.segmented { display: inline-flex; align-self: flex-start; flex-wrap: wrap; padding: 4px; border-radius: 999px; background: var(--n-100); gap: 4px; }
.segmented button { height: 38px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; color: var(--text); font: 700 14px var(--font-body); cursor: pointer; }
.segmented button[aria-selected="true"] { background: var(--text); color: var(--bg); }
.drop {
	position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
	min-height: 200px; padding: 24px; border-radius: 28px; border: 2px dashed var(--n-500); background: var(--n-100);
	text-align: center; cursor: pointer; transition: border-color .15s, background-color .15s;
}
.drop:hover, .drop.is-over, .drop:focus-within { border-color: var(--accent); background: var(--r-100); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-icon { width: 54px; height: 54px; border-radius: 50%; background: var(--r-200); color: var(--r-800); display: grid; place-items: center; }
.drop-label { font: 18px var(--font-heading); word-break: break-all; }
.drop-hint, .hint { font-size: 13px; color: var(--n-700); }
.hint { font-size: 12px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .field-label { font-size: 13px; font-weight: 600; color: var(--n-800); }
.input {
	height: 50px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--divider); background: var(--n-100);
	font: 15px var(--font-body); color: var(--text); outline: none;
}
.input:focus { border-color: var(--accent); }
.tags-box {
	display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 50px;
	padding: 6px 6px 6px 10px; border-radius: 26px; border: 1.5px solid var(--divider); background: var(--n-100);
}
.tags-box:focus-within { border-color: var(--accent); }
.tags-box input { flex: 1; min-width: 140px; height: 36px; border: 0; background: transparent; font: 15px var(--font-body); color: var(--text); outline: none; }
.tag-chip {
	display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 13px; border: 0; border-radius: 999px;
	background: var(--r-200); color: var(--r-900); font: 600 14px var(--font-body); cursor: pointer;
}
.tag-chip:hover { background: var(--r-300); }
.rules { display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }
.rules h2 { font-size: 22px; }
.rules ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.rules li { display: flex; gap: 14px; align-items: flex-start; }
.rules li span { width: 34px; height: 34px; flex: none; margin-top: -6px; border-radius: 50%; background: var(--b-200); color: var(--b-900); display: grid; place-items: center; font-family: var(--font-heading); }
.thanks { max-width: 640px; padding: clamp(24px, 4vw, 40px); border-radius: 36px; background: var(--b-200); color: var(--b-900); display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.thanks h2 { font-size: clamp(24px, 3.4vw, 32px); }
.thanks p { font-size: 16px; }
.thanks .actions { margin-top: 6px; }
.thanks-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--b-700); color: var(--b-100); display: grid; place-items: center; }

/* ---------- Slack */
.steps { display: flex; flex-direction: column; gap: 28px; max-width: 820px; }
.step { display: flex; gap: 16px; align-items: flex-start; }
.step > div { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.step h2 { font-size: 22px; }
.step img { border-radius: 20px; box-shadow: var(--shadow-md); }
.step-num { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--accent); color: var(--bg); display: grid; place-items: center; font-family: var(--font-heading); font-size: 18px; }

/* ---------- Footer */
.footer { background: var(--b-800); color: var(--b-100); border-radius: 40px 40px 0 0; overflow: hidden; }
.footer-flag { display: flex; height: 8px; }
.footer-flag span { flex: 1; }
.footer-flag span:nth-child(1) { background: var(--b-500); }
.footer-flag span:nth-child(2) { background: var(--n-100); }
.footer-flag span:nth-child(3) { background: var(--accent); }
.footer-in { padding-top: 36px; padding-bottom: 28px; display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; }
.footer-about { display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.footer-about p { font-size: 14px; color: var(--b-200); }
.footer-name { font: 22px var(--font-heading); }
.footer-x { font-size: 13px !important; font-weight: 600; color: var(--r-300) !important; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: flex-start; font-size: 14px; font-weight: 600; }
.footer-nav a { color: var(--b-100); }
.footer-nav a:hover { color: #fff; }

/* ---------- Toast */
.toast {
	position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40;
	max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 999px;
	background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600;
	box-shadow: var(--shadow-lg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- +18 */
.age-locked .tile img, .age-locked .gif-media img { filter: blur(18px); }
.gate {
	position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
	background: color-mix(in srgb, var(--n-900) 72%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.gate-box { width: min(460px, 100%); padding: clamp(22px, 4vw, 32px); border-radius: 36px; background: var(--bg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 14px; }
.gate-box h2 { font-size: clamp(24px, 4vw, 30px); }
.gate-box p { font-size: 15px; color: var(--n-800); }
.gate-badge { width: 60px; height: 60px; border-radius: 50%; background: var(--r-800); color: var(--r-100); display: grid; place-items: center; font: 22px var(--font-heading); }
.gate-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.gate-actions .btn { height: 50px; font-size: 16px; flex: 1 1 120px; }
.gate-actions .btn-accent { flex-basis: 200px; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; }
}
