/*
Theme Name: Cloxel
Theme URI: https://cloxel.nl
Author: Myriadbits
Description: Website for the Cloxel word clock, with a live word-clock preview, a 3D model, photo slots, a WooCommerce webshop and the legal pages.
Version: 1.9.1
Requires at least: 6.0
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: cloxel
*/

/* ---------- Fonts (self-hosted, no external requests) ---------- */
@font-face {
	font-family: "Space Grotesk";
	src: url("assets/fonts/SpaceGrotesk-Bold.ttf") format("truetype");
	font-weight: 700;
	font-display: swap;
}
@font-face {
	font-family: "Open Sans";
	src: url("assets/fonts/OpenSans-Regular.ttf") format("truetype");
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: "Open Sans";
	src: url("assets/fonts/OpenSans-Semibold.ttf") format("truetype");
	font-weight: 600;
	font-display: swap;
}

/* ---------- Tokens (taken from the Cloxel app) ---------- */
:root {
	--cream: #fcf9f2;
	--sand: #f1efe6;
	--card: #f6f3ec;
	--line: #dfddd4;
	--ink: #393a36;
	--ink-strong: #1f201c;
	--muted: #6b6c64;
	--olive: #4a5240;
	--olive-dark: #2c3125;
	--moss: #6f8a3e;
	--amber: #ffbf00;
	--night: #151613;
	--radius: 14px;
	--wrap: 1120px;
	--heading: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
	--body: "Open Sans", -apple-system, "Segoe UI", system-ui, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
	margin: 0;
	background: var(--cream);
	color: var(--ink);
	font: 400 17px/1.65 var(--body);
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--olive); }
a:hover { color: var(--olive-dark); }
h1, h2, h3 {
	font-family: var(--heading);
	font-weight: 700;
	color: var(--ink-strong);
	line-height: 1.12;
	letter-spacing: -0.01em;
	margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.eyebrow {
	font: 700 0.8rem/1 var(--heading);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--moss);
	margin-bottom: 14px;
	display: inline-flex;
	align-items: center;
	gap: 10px;
}
.eyebrow::before {
	content: "";
	width: 6px; height: 6px; border-radius: 50%;
	background: var(--moss);
	box-shadow: 0 -10px 0 var(--moss), 0 10px 0 var(--moss);
	opacity: 0.8;
	transform: scale(0.8);
}
.section { padding: 88px 0; }
@media (max-width: 719px) { .section { padding: 64px 0; } }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head p { color: var(--muted); font-size: 1.1rem; }
.skip-link {
	position: absolute; left: -9999px; top: 8px;
	background: var(--ink-strong); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex; align-items: center; gap: 10px;
	font: 600 1rem/1 var(--body);
	padding: 15px 24px;
	border-radius: 999px;
	text-decoration: none;
	transition: background-color .2s, color .2s, transform .2s;
}
.btn-primary { background: var(--olive); color: #fff; }
.btn-primary:hover { background: var(--olive-dark); color: #fff; transform: translateY(-1px); }
.btn-ghost { color: var(--ink-strong); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { color: var(--ink-strong); box-shadow: inset 0 0 0 1.5px var(--olive); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-soon { color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line); cursor: default; }
.app-section .btn-soon { background: var(--cream); }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--cream) 88%, transparent);
	backdrop-filter: saturate(1.4) blur(10px);
	-webkit-backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid transparent;
	transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; position: relative; } }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }
.brand img { height: 34px; width: auto; }
.site-nav ul { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.site-nav a {
	display: block; padding: 8px 12px; border-radius: 8px;
	color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem;
}
.site-nav a:hover { background: var(--sand); color: var(--ink-strong); }
@media (max-width: 599px) {
	.site-nav li:not(.nav-keep) { display: none; }
	.brand img { height: 28px; }
}

/* ---------- Hero ---------- */
.hero { padding: 56px 0 88px; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1fr 1.15fr; gap: 56px; } }
.hero h1 span { color: var(--olive); }
.hero-lead { font-size: 1.2rem; color: var(--muted); max-width: 30em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-media { position: relative; }
.hero-media img {
	width: 100%; aspect-ratio: 16 / 11; object-fit: cover;
	border-radius: 20px;
	box-shadow: 0 30px 60px -30px rgba(44, 49, 37, .45);
}

/* ---------- Photo slots ---------- */
.photo-slot {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
	text-align: center; padding: 24px;
	border: 2px dashed var(--line); border-radius: 20px;
	background: repeating-linear-gradient(135deg, var(--card) 0 14px, var(--cream) 14px 28px);
	color: var(--muted); font-size: 0.9rem;
	aspect-ratio: 4 / 3;
}
.photo-slot strong { color: var(--ink); font-family: var(--heading); font-size: 1rem; }
.photo-slot svg { width: 30px; height: 30px; opacity: .55; }

/* ---------- Live word clock ---------- */
.clock-section { background: var(--night); color: #cfd1c6; }
.clock-section h2 { color: #fff; }
.clock-section .eyebrow { color: #a5bd72; }
.clock-section .eyebrow::before { background: #a5bd72; box-shadow: 0 -10px 0 #a5bd72, 0 10px 0 #a5bd72; }
.clock-section .section-head p { color: #9d9f94; }
.clock-grid-wrap { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .clock-grid-wrap { grid-template-columns: minmax(0, 520px) 1fr; gap: 64px; } }
.wordclock {
	--cell: min(calc((100vw - 32px - 40px) / 16), 30px);
	display: grid;
	grid-template-columns: repeat(16, var(--cell));
	grid-auto-rows: var(--cell);
	justify-content: center;
	padding: 20px;
	border-radius: 18px;
	background: radial-gradient(120% 90% at 50% 0%, #1f211c 0%, #0e0f0d 100%);
	box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 40px 80px -40px rgba(0,0,0,.8);
	font: 700 calc(var(--cell) * 0.56)/1 var(--heading);
	user-select: none;
}
.wordclock span {
	display: flex; align-items: center; justify-content: center;
	color: rgba(255,255,255,.1);
	transition: color .6s ease, text-shadow .6s ease;
}
.wordclock span.on-time { color: #ffd766; text-shadow: 0 0 10px rgba(255,191,0,.65), 0 0 22px rgba(255,191,0,.3); }
.wordclock span.on-date { color: #b9d77e; text-shadow: 0 0 10px rgba(150,200,90,.45); }
.wordclock span.on-dot { color: #ffd766; text-shadow: 0 0 10px rgba(255,191,0,.65); }
.clock-readout {
	font: 700 clamp(1.5rem, 3.2vw, 2.2rem)/1.25 var(--heading);
	color: #fff; margin: 0 0 8px;
}
.clock-readout-date { color: #a5bd72; font-weight: 600; margin-bottom: 24px; }
.clock-notes { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.clock-notes li { display: flex; gap: 12px; align-items: baseline; }
.clock-notes i {
	flex: none; width: 10px; height: 10px; border-radius: 50%; transform: translateY(1px);
}

.clock-toolbar {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
	gap: 12px; margin-bottom: 28px;
}
.clock-tabs {
	display: inline-flex; gap: 4px; padding: 4px;
	background: rgba(255,255,255,.06); border-radius: 999px;
	box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.clock-tab, .clock-bg-toggle {
	font: 600 0.95rem/1 var(--body);
	border: 0; cursor: pointer;
	padding: 11px 18px; border-radius: 999px;
	transition: background-color .2s, color .2s;
}
.clock-tab { background: transparent; color: #b9bbb0; }
.clock-tab small { font-weight: 400; opacity: .75; margin-left: 4px; }
.clock-tab:hover { color: #fff; }
.clock-tab[aria-selected="true"] { background: #f1efe6; color: var(--ink-strong); }
.clock-bg-toggle {
	background: transparent; color: #cfd1c6;
	box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.18);
	display: inline-flex; align-items: center; gap: 10px;
}
.clock-bg-toggle::before {
	content: ""; width: 12px; height: 12px; border-radius: 50%;
	background: conic-gradient(#ff6b6b, #ffd766, #7ee08a, #6bb8ff, #c78bff, #ff6b6b);
}
.clock-bg-toggle:hover { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); }
.clock-bg-toggle[aria-pressed="true"] { background: rgba(255,255,255,.12); color: #fff; }
.clock-bg-toggle[hidden] { display: none; }
@media (max-width: 520px) {
	.clock-tabs { width: 100%; }
	.clock-tab { flex: 1; padding: 11px 10px; }
	.clock-tab small { display: block; margin: 4px 0 0; }
}
.bg-effects {
	display: flex; gap: 20px; align-items: flex-start;
	margin-top: 56px; padding: 28px;
	border-radius: var(--radius);
	background: rgba(255,255,255,.04);
	box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.bg-effects h3 { color: #fff; }
.bg-effects p { color: #b3b5aa; max-width: 62em; }
.bg-effects p:last-child { margin-bottom: 0; }
.bg-effects a { color: #c6dd92; font-weight: 600; text-decoration: none; }
.bg-effects a:hover { color: #fff; text-decoration: underline; }
.bg-effects-icon {
	flex: none; width: 44px; height: 44px; border-radius: 12px;
	display: grid; place-items: center;
	background: conic-gradient(from 200deg, #6f8a3e, #ffbf00, #d9674a, #6b8fd6, #6f8a3e);
	color: #fff;
}
.bg-effects-icon svg { width: 22px; height: 22px; }
@media (max-width: 520px) { .bg-effects { flex-direction: column; padding: 22px; } }

/* ---------- Features ---------- */
.features { display: grid; gap: 16px; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 28px;
}
.feature-icon {
	width: 44px; height: 44px; border-radius: 12px;
	display: grid; place-items: center;
	background: var(--olive); color: #fff; margin-bottom: 18px;
}
.feature-icon svg { width: 22px; height: 22px; }
.feature p { color: var(--muted); margin: 0; }

/* ---------- Size and placement (3D model) ---------- */
.design-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .design-section.has-3d .design-grid { grid-template-columns: minmax(0, 1fr) 1fr; gap: 64px; } }
.design-viewer {
	position: relative; overflow: hidden;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 20px;
}
.design-viewer[hidden] { display: none; }
@media (max-width: 899px) { .design-viewer { order: 2; } }
.design-canvas {
	display: block; width: 100%; aspect-ratio: 1 / 1;
	touch-action: pan-y; cursor: grab;
}
.design-canvas:active { cursor: grabbing; }
.design-dim {
	position: absolute; left: 0; top: 0;
	font: 700 0.8rem/1 var(--heading);
	color: var(--ink-strong); white-space: nowrap;
	padding: 5px 8px; border-radius: 999px;
	background: var(--cream);
	box-shadow: inset 0 0 0 1px var(--line);
	pointer-events: none;
}
.design-viewer-bar {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
	gap: 10px; padding: 0 16px 16px;
}
.design-hint { color: var(--muted); font-size: 0.85rem; }
.view-toggle {
	display: inline-flex; gap: 4px; padding: 4px;
	background: var(--sand); border-radius: 999px;
	box-shadow: inset 0 0 0 1px var(--line);
}
.view-toggle button {
	font: 600 0.9rem/1 var(--body);
	border: 0; cursor: pointer;
	padding: 10px 16px; border-radius: 999px;
	background: transparent; color: var(--muted);
	transition: background-color .2s, color .2s;
}
.view-toggle button:hover { color: var(--ink-strong); }
.view-toggle button[aria-pressed="true"] { background: var(--olive); color: #fff; }
.specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 28px 0; }
.specs div {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 14px 16px;
}
.specs dt { color: var(--muted); font-size: 0.85rem; }
.specs dd { margin: 0; font: 700 clamp(1.1rem, 4vw, 1.4rem)/1.3 var(--heading); color: var(--ink-strong); white-space: nowrap; }
.design-list { margin-bottom: 0; }
.design-list strong { color: var(--ink-strong); font-weight: 600; }

/* ---------- Gallery ---------- */
.gallery { display: grid; gap: 16px; }
@media (min-width: 720px) {
	.gallery { grid-template-columns: 1.4fr 1fr; grid-template-rows: auto auto; }
	.gallery > :first-child { grid-row: span 2; }
	.gallery > :first-child img, .gallery > :first-child.photo-slot { height: 100%; aspect-ratio: auto; min-height: 420px; }
}
@media (min-width: 720px) {
	.gallery:has(> :only-child) { grid-template-columns: 1fr; }
	.gallery:has(> :nth-child(2):last-child) { grid-template-columns: 1fr 1fr; }
	.gallery:has(> :nth-child(2):last-child) > :first-child { grid-row: auto; }
	.gallery:has(> :nth-child(2):last-child) > :first-child img { min-height: 0; aspect-ratio: 4 / 3; }
}
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 20px; }
.gallery-admin-note {
	margin-top: 16px; font-size: 0.9rem; color: var(--muted);
}

/* ---------- App ---------- */
.app-section { background: var(--sand); }
.app-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .app-grid { grid-template-columns: 1fr 0.8fr; gap: 72px; } }
.app-list { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 14px; }
.app-list li { display: flex; gap: 14px; align-items: flex-start; }
.app-list svg { width: 22px; height: 22px; flex: none; color: var(--moss); margin-top: 2px; }
.app-media { max-width: 340px; margin: 0 auto; width: 100%; }
.app-media img { border-radius: 36px; box-shadow: 0 30px 60px -30px rgba(44,49,37,.5); }
.app-media .photo-slot { aspect-ratio: 9 / 19; border-radius: 36px; }

/* ---------- Pages (privacy policy etc.) ---------- */
.page-main { padding: 64px 0 96px; }
.prose { max-width: 700px; margin: 0 auto; }
.prose h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.prose h2 { font-size: 1.35rem; margin-top: 2em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose .page-meta { color: var(--muted); margin-bottom: 2em; }
.prose blockquote, .prose .summary {
	margin: 0 0 1.5em; padding: 6px 0 6px 18px;
	border-left: 3px solid var(--moss);
}

/* ---------- Language switch ---------- */
.site-nav .nav-lang {
	display: flex; align-items: center; gap: 2px;
	margin-left: 4px; padding: 3px;
	border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line);
	font: 700 0.8rem/1 var(--heading); letter-spacing: 0.04em;
}
.site-nav .nav-lang a, .site-nav .nav-lang span { padding: 6px 8px; border-radius: 999px; font: inherit; }
.site-nav .nav-lang a { color: var(--muted); }
.site-nav .nav-lang span { background: var(--sand); color: var(--ink-strong); }

@media (max-width: 599px) {
	/* Phones: the shop link replaces the app link, so the menu fits on one line. */
	.site-nav ul:has(.nav-buy) .nav-app { display: none; }
	.site-nav ul { gap: 2px; }
	.site-nav a { padding: 8px 7px; font-size: 0.88rem; white-space: nowrap; }
	.site-nav .nav-lang a, .site-nav .nav-lang span { padding: 6px 6px; }
}

/* ---------- Shop (WooCommerce) ---------- */
.site-nav a.nav-buy { background: var(--olive); color: #fff; }
.site-nav a.nav-buy:hover { background: var(--olive-dark); color: #fff; }
.shop-main { padding-top: 48px; }
.shop-page h1, .woocommerce div.product .product_title { font-size: clamp(2rem, 5vw, 2.8rem); }
.woocommerce div.product { display: grid; gap: 32px; align-items: start; }
.woocommerce div.product::before, .woocommerce div.product::after { display: none; }
@media (min-width: 900px) {
	.woocommerce div.product:has(.cloxel-product-viewer) { grid-template-columns: minmax(0, 1fr) 1fr; gap: 64px; }
}
.woocommerce div.product > * { min-width: 0; }
.woocommerce div.product div.summary { float: none; width: auto; margin: 0; }
.woocommerce div.product .woocommerce-tabs, .woocommerce div.product .related, .woocommerce div.product .up-sells { grid-column: 1 / -1; }
.woocommerce div.product p.price, .woocommerce div.product span.price {
	color: var(--ink-strong); font: 700 1.8rem/1.2 var(--heading);
}
.woocommerce div.product .woocommerce-product-details__short-description { color: var(--muted); }
.woocommerce div.product form.cart { margin-top: 24px; }
.woocommerce div.product form.cart .variations,
.woocommerce div.product form.cart .variations tbody,
.woocommerce div.product form.cart .variations tr,
.woocommerce div.product form.cart .variations th,
.woocommerce div.product form.cart .variations td { display: block; padding: 0; border: 0; text-align: left; }
.woocommerce div.product form.cart .variations tr { margin-bottom: 20px; }
.woocommerce div.product form.cart .variations label { font: 700 1rem/1.4 var(--heading); color: var(--ink-strong); display: block; margin-bottom: 8px; }
.woocommerce div.product form.cart .variations select {
	font: inherit; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--cream); min-width: 14em;
}
.has-option-buttons .variations select, .has-option-buttons .reset_variations { display: none !important; }
.option-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.option-button {
	display: inline-flex; align-items: center; gap: 8px;
	font: 600 0.95rem/1 var(--body);
	border: 0; cursor: pointer;
	padding: 11px 16px; border-radius: 999px;
	background: var(--card); color: var(--ink);
	box-shadow: inset 0 0 0 1.5px var(--line);
	transition: box-shadow .2s, background-color .2s;
}
.option-button:hover { box-shadow: inset 0 0 0 1.5px var(--olive); }
.option-button[aria-pressed="true"] { background: var(--cream); color: var(--ink-strong); box-shadow: inset 0 0 0 2px var(--olive); }
.option-swatch { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.woocommerce .quantity .qty {
	font: inherit; width: 4.5em; padding: 12px 8px;
	border: 1.5px solid var(--line); border-radius: 12px; background: var(--cream); color: var(--ink);
}
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .woocommerce #respond input#submit {
	font: 600 1rem/1 var(--body);
	padding: 15px 24px; border-radius: 999px;
	background: var(--sand); color: var(--ink-strong);
}
.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover { background: var(--line); color: var(--ink-strong); }
.woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt,
.wc-block-components-button:not(.is-link) {
	background: var(--olive); color: #fff; border-radius: 999px;
}
.woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover,
.wc-block-components-button:not(.is-link):hover { background: var(--olive-dark); color: #fff; }
.woocommerce button.button.alt.disabled, .woocommerce button.button.alt:disabled { background: var(--olive); color: #fff; opacity: .5; }
.woocommerce-products-header__title { font-size: clamp(2rem, 5vw, 2.8rem); }
.woocommerce ul.products li.product a img { border-radius: var(--radius); }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font: 700 1.25rem/1.3 var(--heading); color: var(--ink-strong); }
.woocommerce ul.products li.product .price { color: var(--ink-strong); font-weight: 600; }
.woocommerce-message, .woocommerce-info { border-top-color: var(--moss); background: var(--card); color: var(--ink); }
.woocommerce-message::before, .woocommerce-info::before { color: var(--moss); }
.woocommerce-error { background: var(--card); color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer { background: var(--olive-dark); color: #c9ccbd; padding: 56px 0 40px; font-size: 0.95rem; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; align-items: flex-start; }
.footer-brand { font: 700 1.6rem/1 var(--heading); color: #fff; margin-bottom: 10px; }
.footer-brand small { display: block; font: 400 0.95rem/1.5 var(--body); color: #a9ad9c; margin-top: 8px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: #e7e9df; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-company { font-style: normal; line-height: 1.7; }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); color: #8f9384; font-size: 0.85rem; }
