/*
Theme Name: AlgoRank
Theme URI: https://algorank.co.uk
Author: AlgoRank Ltd
Author URI: https://algorank.co.uk
Description: A hand-coded, performance-first theme for AlgoRank Ltd — an SEO consultancy. Editorial serif display type, hairline grids, dark/light bands, no page builder, no jQuery.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: algorank
*/

/* ---------------------------------------------------------------------------
   Fonts (self-hosted variable woff2, latin)
--------------------------------------------------------------------------- */
@font-face {
	font-family: 'Fraunces';
	src: url('assets/fonts/fraunces-var.woff2') format('woff2');
	font-weight: 400 600;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Fraunces';
	src: url('assets/fonts/fraunces-var-italic.woff2') format('woff2');
	font-weight: 400 600;
	font-style: italic;
	font-display: swap;
}
@font-face {
	font-family: 'Inter';
	src: url('assets/fonts/inter-var.woff2') format('woff2');
	font-weight: 400 700;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'JetBrains Mono';
	src: url('assets/fonts/jetbrains-mono-var.woff2') format('woff2');
	font-weight: 400 500;
	font-style: normal;
	font-display: swap;
}

/* ---------------------------------------------------------------------------
   Design tokens
--------------------------------------------------------------------------- */
:root {
	--ink: #0A1428;
	--ink-2: #0E1C3A;
	--ink-3: #12244A;
	--paper: #FAF8F4;
	--cream: #F2EEE6;
	--accent: #0E9F6E;
	--accent-bright: #00B67A;
	--accent-ink: #0A7A55;
	--gold: #E39B2D;
	--text: #1C2436;
	--muted: #5B6478;
	--muted-on-dark: #A7B0C4;
	--hair: rgba(10, 20, 40, 0.14);
	--hair-strong: rgba(10, 20, 40, 0.28);
	--hair-light: rgba(250, 248, 244, 0.16);
	--radius: 6px;
	--shell: 1400px;
	--section-pad: clamp(90px, 11vw, 170px);
	--header-h: 76px;
	--font-display: 'Fraunces', 'Georgia', serif;
	--font-body: 'Inter', -apple-system, 'Segoe UI', sans-serif;
	--font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------------------------------------------------------------------------
   Reset / base
--------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 1.0625rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: var(--accent); }
::selection { background: var(--accent); color: #fff; }

h1, h2, h3, h4 {
	font-family: var(--font-display);
	font-weight: 500;
	color: var(--ink);
	line-height: 1.04;
	letter-spacing: -0.02em;
	margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.9rem, 6.2vw, 5.6rem); }
h2 { font-size: clamp(2.1rem, 4.2vw, 3.6rem); }
h3 { font-size: clamp(1.35rem, 2vw, 1.7rem); line-height: 1.15; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.25em; }

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

/* Accessibility helpers */
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.skip-link {
	position: fixed;
	top: -100px; left: 16px;
	z-index: 200;
	background: var(--ink);
	color: var(--paper);
	padding: 10px 18px;
	border-radius: var(--radius);
	font-size: 0.9rem;
	transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; color: var(--paper); }

/* ---------------------------------------------------------------------------
   Layout primitives
--------------------------------------------------------------------------- */
.shell {
	width: min(var(--shell), 100% - 3rem);
	margin-inline: auto;
}
@media (max-width: 640px) {
	.shell { width: calc(100% - 2.5rem); }
}
.section { padding-block: var(--section-pad); }
.section--cream { background: var(--cream); }
.section--dark { background: var(--ink); color: #E9E6DE; }
.section--dark h1, .section--dark h2, .section--dark h3 { color: var(--paper); }

/* Eyebrow (mono label) + outcome headline pattern */
.eyebrow {
	font-family: var(--font-mono);
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--accent-ink);
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0 0 1.4rem;
}
.eyebrow::before {
	content: '';
	width: 2rem; height: 1px;
	background: var(--accent);
	flex: none;
}
.section--dark .eyebrow { color: var(--accent-bright); }
.lede {
	font-size: clamp(1.08rem, 1.5vw, 1.28rem);
	line-height: 1.6;
	color: var(--muted);
	max-width: 62ch;
}
.section--dark .lede { color: var(--muted-on-dark); }
.section-head { max-width: 880px; margin-bottom: clamp(2.6rem, 5vw, 4.5rem); }

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.95rem 1.7rem;
	border-radius: var(--radius);
	font-family: var(--font-body);
	font-size: 0.98rem;
	font-weight: 600;
	line-height: 1;
	border: 1px solid transparent;
	transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
	cursor: pointer;
}
.btn .btn-arrow { transition: transform 0.25s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(3px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-ink); color: #fff; }
.btn--ghost {
	background: transparent;
	color: var(--ink);
	border-color: var(--hair-strong);
}
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.section--dark .btn--ghost { color: var(--paper); border-color: var(--hair-light); }
.section--dark .btn--ghost:hover { border-color: var(--paper); color: var(--paper); }
.btn--light { background: var(--paper); color: var(--ink); }
.btn--light:hover { background: var(--cream); color: var(--ink); }

/* Animated underline link */
.link-arrow {
	font-weight: 600;
	color: var(--ink);
	background-image: linear-gradient(currentColor, currentColor);
	background-size: 0% 1px;
	background-repeat: no-repeat;
	background-position: 0 100%;
	transition: background-size 0.35s var(--ease), color 0.25s var(--ease);
	padding-bottom: 2px;
}
.link-arrow:hover { background-size: 100% 1px; color: var(--accent-ink); }

/* Reveal-on-scroll (JS adds .is-in; content visible without JS) */
.reveal { opacity: 1; }
.js .reveal {
	opacity: 0;
	transform: translateY(26px);
	transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
	transition-delay: calc(var(--reveal-i, 0) * 110ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

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