/*
 * Design tokens. Single source of truth for every visual value in the theme.
 * Transcribed from docs/design-system.md plus the tokens agreed in .specs/archive/home-page/design.md.
 *
 * Colors come in two layers. The palette names each Figma color and is read only in
 * this file. The roles name what a color does, point at the palette, and are the only
 * color tokens the components read. A layout change repoints a role, not a selector.
 */

:root {
	/*
	 * Palette: the colors applied in the Figma v4, named after its variables. When a label
	 * of the style guide disagrees with the color applied to the elements, the applied
	 * color wins (Gray 10 is labelled #5D5D5D, Blue Hover #1747AB).
	 */
	--color-blue-10: #193889;
	--color-blue-hover: #405BA3;
	/* Also listed as "Read 20" in the Figma, same value. */
	--color-main-red: #F61A20;
	--color-dark-red: #C1272D;
	/* No Figma variable: the end stop of the featured article gradient. Named here. */
	--color-deep-red: #911D21;
	--color-yellow: #FFCB1F;
	--color-sand: #F2EADF;
	--color-black: #000000;
	--color-white: #FFFFFF;
	--color-gray-10: #626567;
	--color-gray-20: #D1D1D1;
	--color-gray-30: #F0F0F0;
	--color-gray-40: #F6F6F6;
	--color-gray-brand: #8D9093;
	--color-light-gray: #E6E6E6;
	--color-mid-gray: #ADB0B1;
	--color-dark-gray: #8B9091;
	/* No Figma variable: the default background of the segment cards. Named here. */
	--color-off-white: #F5F5F5;

	/*
	 * Roles. "Provisional" marks the ones the Figma does not define: they are our proposal,
	 * pending design validation (.specs/archive/v4-paleta-de-cores/design-handoff.md).
	 */

	/* Roles: surfaces */
	--color-surface: var(--color-white);
	--color-surface-brand: var(--color-main-red);
	--color-surface-footer: var(--color-dark-red);
	--color-surface-muted: var(--color-light-gray);
	--color-surface-subtle: var(--color-gray-30);
	--color-surface-segment: var(--color-off-white);
	/* Behind the featured article photo, seen only while the image loads. */
	--color-surface-article: var(--color-deep-red);
	/* Provisional: hover of list items and of the close buttons without a circle. */
	--color-hover-surface: var(--color-light-gray);
	/* Ingredients box and related recipes band of the recipe page (813:45227). */
	--color-surface-sand: var(--color-sand);
	/*
	 * Band at the top of the recipe page, under the red header (813:45228). Blue in v4;
	 * red since Henrique asked for no blue on any page (figma-desktop-elements, F6).
	 */
	--color-surface-detail: var(--color-main-red);

	/* Roles: text */
	--color-text: var(--color-gray-10);
	--color-text-muted: var(--color-gray-brand);
	/* Used at 64% opacity, as the Figma fields do. */
	--color-text-placeholder: var(--color-dark-gray);
	--color-text-on-brand: var(--color-white);
	--color-text-on-brand-muted: var(--color-gray-20);
	--color-text-on-image: var(--color-gray-30);
	--color-link-on-brand: var(--color-light-gray);

	/*
	 * Roles: headings. Blue in v4; Dark Red since the element nodes of 2026-10-26
	 * (702:93297, 702:98860) and Henrique's call for no blue on any page
	 * (figma-desktop-elements, F6).
	 */
	--color-heading: var(--color-dark-red);
	--color-heading-dialog: var(--color-dark-red);
	--color-title-card: var(--color-main-red);

	/* Roles: interaction */
	--color-link: var(--color-main-red);
	--color-icon-brand: var(--color-main-red);
	--color-icon-accent: var(--color-dark-red);
	--color-selected: var(--color-dark-red);
	--color-indicator: var(--color-dark-red);
	--color-indicator-inactive: var(--color-white);
	--color-indicator-inactive-muted: var(--color-gray-20);
	--color-divider: var(--color-gray-30);
	--color-control-hover: var(--color-gray-20);
	/* Provisional: focus rings and the error state. */
	--color-focus-ring: var(--color-dark-red);
	--color-focus-ring-on-brand: var(--color-white);
	--color-error: var(--color-dark-red);

	/*
	 * Roles: header. The header copies the institutional site, https://www.tirolez.com.br
	 * (.specs/archive/header-institutional-look, findings F1): a Sand bar over the red one,
	 * Sand links on the red bar, Main Red links on the Sand bar, and below 1024px a white
	 * panel with Main Red links and a Yellow burger (#EBC83C there, Yellow here).
	 */
	--color-header-top-bg: var(--color-sand);
	--color-nav-top-link: var(--color-main-red);
	--color-nav-main-link: var(--color-sand);
	--color-nav-panel-bg: var(--color-surface);
	--color-nav-panel-link: var(--color-main-red);
	--color-burger: var(--color-yellow);

	/* Roles: CTAs. The hovers come from the COMPONENTES library (614:16970, desktop-fidelity H). */
	--color-cta-primary-bg: var(--color-main-red);
	--color-cta-primary-text: var(--color-white);
	--color-cta-primary-hover-bg: var(--color-dark-red);
	--color-cta-secondary: var(--color-main-red);
	/* Stroke Dark hover (696:50428): Light Gray fill, Dark Red text, the stroke gone into the fill. */
	--color-cta-secondary-hover-bg: var(--color-light-gray);
	--color-cta-secondary-hover-text: var(--color-dark-red);
	/* "CTA 1ª | DARK", the search button (1046:71261), and its hover 281:20437. */
	--color-cta-dark-bg: var(--color-dark-red);
	--color-cta-dark-text: var(--color-white);
	--color-cta-dark-hover-bg: var(--color-main-red);
	/* Provisional: a CTA on a red surface, where a red CTA would vanish. */
	--color-cta-light-bg: var(--color-white);
	--color-cta-light-text: var(--color-main-red);
	--color-cta-light-hover-bg: var(--color-light-gray);
	--color-float-bg: var(--color-main-red);
	--color-float-border: var(--color-dark-red);
	--color-float-text: var(--color-white);

	/* Composite colors */
	--color-card-border: rgba(209, 209, 209, 0.48);
	--color-hairline-light: rgba(255, 255, 255, 0.08);
	/*
	 * Line under the icon of the technique cards (839:21033): black at 10%. New in
	 * figma-desktop-elements, pending Henrique's approval (stop 3).
	 */
	--color-hairline-dark: rgba(0, 0, 0, 0.1);
	--color-overlay-dark: rgba(0, 0, 0, 0.48);
	/* Scrim of the "Seu Negócio" dropdown overlay: overlayBackground of node 728:38906. */
	--color-overlay-scrim: rgba(0, 0, 0, 0.64);
	/*
	 * Hover of every translucent white circle: the overlay close button and the social
	 * icon. 24% is the value of the CLOSE variant in the overlay nodes, so the 16% we had
	 * invented for the footer was dropped instead of keeping two tokens for one pattern.
	 */
	--color-hairline-light-hover: rgba(255, 255, 255, 0.24);
	/* The social icon hover is 20% in 281:20972, not the 24% of the overlay close (desktop-fidelity H). */
	--color-social-hover: rgba(255, 255, 255, 0.2);
	/*
	 * Segment tag of the recipe tile: rgba(235, 200, 60, 0.32) in the node. Off palette,
	 * close to Yellow but not Yellow at 32%. Handoff question.
	 */
	--color-tag-segment-bg: rgba(235, 200, 60, 0.32);
	/* Gray 20 at 64%, the glass background of the carousel arrows. */
	--color-arrow-bg: rgba(209, 209, 209, 0.64);

	/* Roles: scrims behind the dialogs. The product and recipe one has no v4 frame. */
	--color-scrim-dialog: var(--color-overlay-dark);
	/* Black at 50%, from the background layer of the calculator frames (714:7005). */
	--color-scrim-calculator: rgba(0, 0, 0, 0.5);

	/* Gradient over the featured article image, exact stops from the Figma frame (281:20694). */
	--gradient-article-overlay: linear-gradient(
		180deg,
		rgba(193, 39, 45, 0) 5.9%,
		rgba(193, 39, 45, 0.68) 57.4%,
		var(--color-deep-red) 100%
	);

	/* Font families */
	--font-body: 'Fira Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--font-heading: 'Larken Variable', Georgia, 'Times New Roman', serif;
	--weight-heading: 660;

	/*
	 * Fluid headings. The ramp runs from 375px to 1440px, so the divisor is 1065.
	 * Custom properties do not work inside @media, so the literals stay here.
	 */
	--font-h1: clamp(30px, calc(30px + 18 * (100vw - 375px) / 1065), 48px);
	--font-h2: clamp(28px, calc(28px + 12 * (100vw - 375px) / 1065), 40px);
	--font-h3: clamp(24px, calc(24px + 8 * (100vw - 375px) / 1065), 32px);
	/*
	 * Provisional: the Figma labels this "H4 | 28 B" but the documented scale jumps from
	 * H3/32 to H5/24. Used only by the title of the "Seu Negócio" dropdown.
	 */
	--font-h4: clamp(24px, calc(24px + 4 * (100vw - 375px) / 1065), 28px);
	--font-h5: clamp(20px, calc(20px + 4 * (100vw - 375px) / 1065), 24px);
	/* H6 | 22 B of the recipe tile title. */
	--font-h6: clamp(20px, calc(20px + 2 * (100vw - 375px) / 1065), 22px);
	--font-h7: clamp(18px, calc(18px + 2 * (100vw - 375px) / 1065), 20px);
	/*
	 * Provisional: the 72px Larken Bold numbers of the "Boas práticas" card (806:67937)
	 * have no style in the design system. Pending design validation (docs/BACKLOG.md 86).
	 */
	--font-display-number: clamp(48px, calc(48px + 24 * (100vw - 375px) / 1065), 72px);

	/* Body sizes. --font-p1 drops to --font-p1-mobile below 768px, in base.css. */
	--font-p1: 20px;
	--font-p1-mobile: 18px;
	--font-p2: 18px;
	--font-p3: 16px;
	--font-p4: 14px;
	/* Provisional: the eyebrow badge of the Escola do Queijo cards is 12px in the
	   Figma frame and has no token in the design system. Pending design validation. */
	--font-p5: 12px;
	/* The Figma token is named "CTA | 16 M" but renders at 18px. Confirmed. */
	--font-cta: 18px;

	--lh-heading: 1.2;
	/* -1 %, as every heading node of the library (desktop-fidelity G1). */
	--ls-heading: -0.01em;
	--ls-body: -0.01em;

	/* Spacing scale */
	--space-1: 8px;
	--space-2: 12px;
	--space-3: 16px;
	--space-4: 24px;
	--space-5: 32px;
	--space-6: 40px;
	--space-7: 64px;

	/* One-off gaps that do not belong to the scale */
	--space-gap-metric-grid: 10px;
	--space-gap-calculator: 54px;
	/* Gap between the blocks of a content section, repeated in all four sections. */
	--space-gap-section: 56px;

	/* Radii */
	--radius-thumb: 8px;
	--radius-card: 12px;
	--radius-media: 16px;
	--radius-modal: 24px;
	--radius-pill: 200px;

	/* Shadows */
	--shadow-header: 0 4px 12px rgba(0, 0, 0, 0.16);
	--shadow-modal: 0 4px 12px rgba(0, 0, 0, 0.24);
	/* The calculator results, 752:43341: blur 24 (desktop-fidelity M). */
	--shadow-modal-result: 0 4px 24px rgba(0, 0, 0, 0.24);
	/* Both come from the overlay nodes and sit just off --shadow-modal. See BACKLOG 25. */
	--shadow-search-panel: 0 4px 12px rgba(0, 0, 0, 0.26);
	--shadow-popover: 0 4px 10px rgba(0, 0, 0, 0.2);
	/* Drop shadow of the recipe tile, 0 4 3 at 12% black in the node. */
	--shadow-recipe-tile: 0 4px 3px rgba(0, 0, 0, 0.12);
	/* Hover of the Escola cards: 281:20714 (guide) and 326:17212 (featured), desktop-fidelity H. */
	--shadow-card-hover: 0 4px 8px rgba(0, 0, 0, 0.26);
	--shadow-featured-hover: 0 4px 10px rgba(0, 0, 0, 0.64);
	/*
	 * The Escola do Queijo card (819:85345): 0 4 24 at 32% black. New in
	 * figma-desktop-elements, pending Henrique's approval (stop 3).
	 */
	--shadow-school-banner: 0 4px 24px rgba(0, 0, 0, 0.32);

	/*
	 * Header, from the institutional stylesheet at 1500px and up (findings F1). The top
	 * links are 19px and not the 17px there: Main Red on Sand is 3.46:1, which passes AA
	 * only as large text (findings F3).
	 */
	--font-nav-top: 19px;
	--font-nav-main: 22px;
	--space-nav-main: 58px;
	--logo-header-width: 128px;
	--header-nav-offset: 200px;
	/*
	 * The header runs wider than the sections, as the institutional .wrapper-center does
	 * (max-width 1500px, 50px of padding): logo and menu at the left edge, search at the right.
	 */
	--header-container-max: 1400px;
	--header-gutter: 50px;
	--duration-nav-underline: 200ms;

	/* Layout */
	--header-top-height: 40px;
	--header-main-height: 60px;
	/* Both bars; base.css drops it to the red bar alone below 1024px, where the Sand bar hides. */
	--header-height: calc(var(--header-top-height) + var(--header-main-height));
	--container-max: 1216px;
	--container-gutter: 112px;
	--section-title-max: 800px;
	--section-padding-start: 140px;
	--section-padding-end: 120px;

	/* Layers */
	--z-header: 100;
	--z-float-button: 200;
	/* Above the floating button: the mobile panel covers the whole viewport. */
	--z-nav-panel: 250;
	--z-dialog: 300;

	/*
	 * Motion. Durations taken from the prototype reactions (docs/figma/motion.md):
	 * DISSOLVE is always 300ms, SMART_ANIMATE varies by the size of the change.
	 */
	--duration-fast: 150ms;
	--duration-base: 300ms;
	/* 800ms is the zoom of the Escola thumbnail. The arrow scroll of the carousel is the
	   same 800ms in the prototype but runs on the browser duration of behavior: smooth. */
	--duration-thumb-hover: 800ms;
	--duration-card-hover: 1000ms;
	--duration-enter: 1200ms;
	--ease-out: cubic-bezier(0.2, 0, 0, 1);
}
