/*
Theme Name: OBD Company — Tacho
Theme URI: https://example.com/obd-company
Author: OBD Company
Description: Custom theme for OBD Company: a plug-in OBD-II telematics device for transport fleets, paired with a phone app. Dark "night dispatch" direction — instrument-backlight amber on petrol black, scroll-drawn route splines, and a sticky phone whose app screens change as you read.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: obd-tacho
Tags: one-column, custom-menu, custom-colors, translation-ready
*/

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
	/* Colour. Amber is a European truck instrument backlight at night;
	   paper is tachograph chart stock. */
	--ink: #06100f;
	--ink-2: #0a1615;
	--slab: #0d1a1b;
	--slab-2: #112223;
	--hair: #1d3230;
	--hair-soft: #162827;
	--amber: #ffa724;
	--amber-dim: #b3701a;
	--signal: #43c7d6;
	--paper: #e8e0cf;
	--paper-ink: #1a1512;
	--fault: #e8562f;

	--text: #dde6e4;
	--text-2: #93a7a4;
	--text-3: #637876;

	/* Type */
	--display: "Archivo", "Archivo Expanded", "Helvetica Neue", Arial, sans-serif;
	--body: "Instrument Sans", "Segoe UI", Helvetica, Arial, sans-serif;
	--mono: "Martian Mono", "SFMono-Regular", ui-monospace, Menlo, monospace;

	/* Fluid scale */
	--fs-mega: clamp(2.75rem, 8.2vw, 7.5rem);
	--fs-h1: clamp(2.25rem, 5.6vw, 4.5rem);
	--fs-h2: clamp(1.75rem, 3.6vw, 3rem);
	--fs-h3: clamp(1.25rem, 1.9vw, 1.6rem);
	--fs-lede: clamp(1.0625rem, 1.35vw, 1.3125rem);
	--fs-body: 1.0625rem;
	--fs-small: 0.9375rem;
	--fs-mono: 0.6875rem;

	/* Space */
	--gutter: clamp(1rem, 4vw, 2.5rem);
	--rail: 4.5rem;
	--measure: 62ch;
	--sec-y: clamp(5rem, 11vh, 9rem);
	--maxw: 1320px;

	--ease: cubic-bezier(0.22, 1, 0.36, 1);
	--ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ==========================================================================
   Reset / base
   ========================================================================== */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--ink);
	color: var(--text);
	font-family: var(--body);
	font-size: var(--fs-body);
	line-height: 1.6;
	font-synthesis: none;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

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

a {
	color: inherit;
	text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
	text-underline-offset: 0.22em;
}

a:hover {
	text-decoration-color: currentColor;
}

button {
	font: inherit;
	color: inherit;
}

:focus-visible {
	outline: 2px solid var(--amber);
	outline-offset: 3px;
	border-radius: 2px;
}

::selection {
	background: var(--amber);
	color: var(--ink);
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1,
h2,
h3,
h4 {
	margin: 0;
	font-family: var(--display);
	font-variation-settings: "wdth" 118;
	font-weight: 700;
	line-height: 0.94;
	letter-spacing: -0.022em;
	text-transform: uppercase;
	text-wrap: balance;
}

p {
	margin: 0;
}

.mega {
	font-size: var(--fs-mega);
	font-variation-settings: "wdth" 122;
	font-weight: 800;
	line-height: 0.88;
	letter-spacing: -0.032em;
}

.h1 {
	font-size: var(--fs-h1);
}

.h2 {
	font-size: var(--fs-h2);
}

.h3 {
	font-size: var(--fs-h3);
	font-variation-settings: "wdth" 112;
	letter-spacing: -0.012em;
}

.lede {
	max-width: 46ch;
	color: var(--text-2);
	font-size: var(--fs-lede);
	line-height: 1.55;
}

.prose {
	max-width: var(--measure);
	color: var(--text-2);
}

.prose + .prose {
	margin-top: 1em;
}

/* The amber word inside a heading — one accent per headline, no more. */
.hl {
	color: var(--amber);
}

.hl-out {
	color: transparent;
	-webkit-text-stroke: 1.25px var(--amber-dim);
}

/* Trip-log stamp: time, coordinates, event. */
.stamp {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.55em;
	margin: 0 0 1.35rem;
	color: var(--text-3);
	font-family: var(--mono);
	font-size: var(--fs-mono);
	font-variation-settings: "wdth" 100;
	font-weight: 400;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	line-height: 1;
}

.stamp__time {
	color: var(--signal);
}

.stamp__event {
	color: var(--amber);
}

.stamp__sep {
	opacity: 0.45;
}

.mono {
	font-family: var(--mono);
	font-size: var(--fs-mono);
	font-variation-settings: "wdth" 100;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

/* ==========================================================================
   Layout primitives
   ========================================================================== */

.wrap {
	width: 100%;
	max-width: var(--maxw);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

/* One spacing system for every band on the page. Only .sec sets vertical
   rhythm, so nothing downstream has to fight it. */
.sec {
	position: relative;
	padding-block: var(--sec-y);
}

.sec--tight {
	padding-block: calc(var(--sec-y) * 0.62);
}

.sec--flush-top {
	padding-block-start: 0;
}

.sec__head {
	max-width: 72ch;
	margin-bottom: clamp(2.25rem, 5vw, 3.75rem);
}

.sec__head .lede {
	margin-top: 1.25rem;
}

.grid {
	display: grid;
	gap: clamp(1rem, 2vw, 1.5rem);
}

.skip-link {
	position: absolute;
	top: 0;
	left: 50%;
	z-index: 200;
	translate: -50% -120%;
	padding: 0.75rem 1.25rem;
	background: var(--amber);
	color: var(--ink);
	font-family: var(--mono);
	font-size: var(--fs-mono);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	transition: translate 0.2s var(--ease);
}

.skip-link:focus {
	translate: -50% 0;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Hairline rule that reads as a measuring edge, not a divider for its own sake. */
.edge {
	height: 1px;
	border: 0;
	margin: 0;
	background: linear-gradient(90deg, var(--hair), color-mix(in srgb, var(--hair) 20%, transparent));
}

/* ==========================================================================
   Reveal on scroll — the one motion contract every section uses
   ========================================================================== */

[data-reveal] {
	opacity: 0;
	translate: 0 1.75rem;
	transition:
		opacity 0.75s var(--ease),
		translate 0.85s var(--ease);
	transition-delay: var(--d, 0ms);
}

[data-reveal].is-in {
	opacity: 1;
	translate: 0 0;
}

[data-reveal="mask"] {
	translate: 0 0;
	clip-path: inset(0 0 100% 0);
	opacity: 1;
	transition: clip-path 1s var(--ease);
}

[data-reveal="mask"].is-in {
	clip-path: inset(0 0 0 0);
}

/* Line-by-line headline lift. */
.line {
	display: block;
	overflow: hidden;
}

.line > span {
	display: block;
	translate: 0 105%;
	transition: translate 1s var(--ease);
	transition-delay: var(--d, 0ms);
}

.is-in .line > span,
.line.is-in > span {
	translate: 0 0;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	[data-reveal],
	[data-reveal="mask"] {
		opacity: 1 !important;
		translate: none !important;
		clip-path: none !important;
		transition: none !important;
	}

	.line > span {
		translate: none !important;
		transition: none !important;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
