/* Fonts are served from here, so no visitor's browser contacts a font CDN (SIL Open Font License 1.1) */
@font-face { font-family: "Atkinson"; src: url("assets/fonts/atkinson-hyperlegible-next-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("assets/fonts/atkinson-hyperlegible-next-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Familjen"; src: url("assets/fonts/familjen-grotesk-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
	--ink: #10302e;       /* text: deep teal, not grey-black */
	--ink-soft: #46605d;
	--paper: #f6f9f8;
	--teal: #0f766e;      /* brand, active shifts */
	--teal-dark: #0b5b55;
	--night: #1e40af;     /* sleepovers */
	--marigold: #d9930d;  /* two workers together, things waiting: a fill, with --ink text on it */
	--amber-text: #8a5a00; /* marigold dark enough for text on white */
	--mint: #d6f0e4;
	--line: #d3dfdc;
	--surface: #ffffff;    /* cards and the form */
	--link: #0b5b55;
	--on-fill: #ffffff;    /* text on teal and sleepover fills */
	--on-marigold: #10302e;
	--open-a: #fff4dc; --open-b: #fde9bd; --open-text: #7a5208;
	color-scheme: light;

	--display: "Familjen", "Arial Narrow", system-ui, sans-serif;
	--body: "Atkinson", system-ui, -apple-system, "Segoe UI", sans-serif;

	--step-0: 1.0625rem;
	--step-1: 1.3125rem;
	--step-2: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
	--step-3: clamp(2.25rem, 1.4rem + 3.6vw, 4rem);
	--gutter: clamp(16px, 4vw, 40px);
}

/* Dark: follows the device unless the visitor picked light or dark (main.js sets data-theme on <html>) */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--ink: #e2eeec;
		--ink-soft: #a6bcb8;
		--paper: #0d1817;
		--surface: #142321;
		--line: #29403d;
		--mint: #12302b;
		--link: #6ee0cf;
		--amber-text: #f2c35c;
		--open-a: #3a2c0c; --open-b: #46350f; --open-text: #f2c35c;
		color-scheme: dark;
	}
}
:root[data-theme="dark"] {
	--ink: #e2eeec;
	--ink-soft: #a6bcb8;
	--paper: #0d1817;
	--surface: #142321;
	--line: #29403d;
	--mint: #12302b;
	--link: #6ee0cf;
	--amber-text: #f2c35c;
	--open-a: #3a2c0c; --open-b: #46350f; --open-text: #f2c35c;
	color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 var(--step-0)/1.6 var(--body);
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: var(--step-3); max-width: 19ch; letter-spacing: -0.025em; }
h2 { font-size: var(--step-2); max-width: 24ch; }
h3 { font-size: var(--step-1); }
p { margin: 0; }

.wrap { width: min(1120px, 100%); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Buttons */
.btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 48px; padding: 0 22px; border-radius: 999px;
	font: 700 1rem/1 var(--body); text-decoration: none; cursor: pointer;
	border: 2px solid transparent; transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--teal); color: var(--on-fill); }
.btn-primary:hover { background: var(--teal-dark); color: var(--on-fill); }
.btn-line { border-color: var(--ink); color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn-quiet { min-height: 40px; padding: 0 16px; border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-quiet:hover { border-color: var(--teal); color: var(--link); }

/* Header */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 600 1.15rem/1 var(--display); }
.brand img { border-radius: 9px; }
.top-nav { display: flex; align-items: center; gap: 22px; }
.top-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-size: .98rem; }
.top-nav a:not(.btn):hover { color: var(--teal); }

.theme-btn {
	width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
	border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.theme-btn:hover { border-color: var(--teal); }
.theme-btn svg { display: none; }
.theme-btn[data-mode="system"] .ic-system, .theme-btn[data-mode="light"] .ic-light, .theme-btn[data-mode="dark"] .ic-dark,
.theme-btn:not([data-mode]) .ic-system { display: block; }

/* Hero */
.hero { padding: clamp(48px, 8vw, 96px) 0 0; }
.lede { margin-top: 22px; max-width: 60ch; font-size: var(--step-1); line-height: 1.5; color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* The day at a house: the page's one moving picture */
.day { margin: clamp(40px, 6vw, 64px) 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(18px, 3vw, 32px); }
.day-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 22px; }
.day-head strong { font: 600 var(--step-1)/1.2 var(--display); }
.day-head span { color: var(--ink-soft); }
.day-grid { --who: 72px; display: grid; gap: 10px; }
.hours { display: flex; justify-content: space-between; margin-left: var(--who); font-size: .82rem; color: var(--ink-soft); }
.hours span { width: 0; display: flex; justify-content: center; white-space: nowrap; }
.lane { display: grid; grid-template-columns: var(--who) 1fr; align-items: center; }
.who { font-weight: 700; font-size: .95rem; }
.open-who { color: var(--amber-text); }
.track {
	position: relative; height: 40px; border-radius: 10px;
	/* a line every 4 hours, under the hour labels (explicit stops: a repeating gradient drops some lines when rounded) */
	background: linear-gradient(90deg, transparent calc(100% / 6 - 1px), var(--line) 0 calc(100% / 6),
		transparent 0 calc(200% / 6 - 1px), var(--line) 0 calc(200% / 6), transparent 0 calc(300% / 6 - 1px), var(--line) 0 calc(300% / 6),
		transparent 0 calc(400% / 6 - 1px), var(--line) 0 calc(400% / 6), transparent 0 calc(500% / 6 - 1px), var(--line) 0 calc(500% / 6),
		transparent 0) var(--paper);
}
.bar {
	position: absolute; top: 4px; bottom: 4px;
	left: calc(var(--from) / 24 * 100%); width: calc(var(--len) / 24 * 100%);
	border-radius: 8px; display: flex; align-items: center; padding-inline: 10px; overflow: hidden;
	font-style: normal; transform-origin: left center;
}
/* Where a bar starts and how long it runs, in hours from 7am (classes, not style="", so the CSP stays strict) */
.f0 { --from: 0; } .f8 { --from: 8; } .f16 { --from: 16; }
.l6 { --len: 6; } .l8 { --len: 8; }
.bar b { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar.active { background: var(--teal); color: var(--on-fill); }
.bar.sleep { background: var(--night); color: var(--on-fill); }
.bar.open { background: repeating-linear-gradient(-45deg, var(--open-a) 0 8px, var(--open-b) 8px 16px); border: 2px dashed var(--marigold); color: var(--open-text); }
.day-key { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; padding: 0; margin: 22px 0 0; font-size: .9rem; color: var(--ink-soft); }
.day-key li { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 18px; height: 12px; border-radius: 4px; display: inline-block; }
.sw.active { background: var(--teal); }
.sw.sleep { background: var(--night); }
.sw.open { border: 2px dashed var(--marigold); background: var(--open-a); }
.key-21 { font-size: .8rem; background: var(--marigold); color: var(--on-marigold); padding: 1px 7px; border-radius: 999px; }

@media (prefers-reduced-motion: no-preference) {
	.bar { animation: draw .7s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(.25s + var(--from) * .06s); }
	.bar.open { animation-name: draw, wait; animation-duration: .7s, 1.6s; animation-delay: .3s, 1.6s; animation-iteration-count: 1, 2; animation-timing-function: cubic-bezier(.2, .7, .2, 1), ease-in-out; }
	@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
	@keyframes wait { 50% { border-color: #f2c35c; } }
}

/* Sections */
.block { padding: clamp(56px, 8vw, 104px) 0; }
.block-tint { background: var(--mint); }
.intro { margin-top: 16px; max-width: 64ch; color: var(--ink-soft); font-size: 1.12rem; }
.split { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 72px); margin-top: clamp(36px, 5vw, 56px); }
.side h3 { padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.facts { margin: 0; }
.facts dt { font-weight: 700; margin-top: 22px; }
.facts dd { margin: 4px 0 0; color: var(--ink-soft); max-width: 56ch; }

.worker-side { display: flex; flex-direction: column; }
/* The phone app's Shifts screen, drawn at its real size and colours (mobile/src/app/(tabs)/index.js) */
.phone { align-self: center; margin: 28px 0; width: min(380px, 100%); } /* 360px inside the frame: a typical Android phone */
.phone figcaption { margin-top: 10px; text-align: center; font-size: .85rem; color: var(--ink-soft); }
.app {
	--a-blue: #1d4ed8; --a-navy: #1e3a8a; --a-soft: #e8efff; --a-bg: #f4f6fa; --a-border: #e3e8ef;
	--a-text: #111827; --a-muted: #5f6876; --a-amber: #b45309; --a-amber-soft: #fdf3e1;
	--a-surface: #ffffff; --a-faint: #7d8696; --a-next: var(--a-blue); --a-on-accent: #ffffff;
	border: 10px solid #10302e; border-radius: 36px; overflow: hidden; background: var(--a-bg);
	box-shadow: 0 0 0 1px var(--line);  /* the phone's frame stays dark in both themes */
	font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--a-text); line-height: 1.35;
}
.app p { margin: 0; }
.app-bar { display: flex; align-items: center; gap: 6px; background: var(--a-navy); color: #ffffff; padding: 22px 16px 12px; }
.app-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; margin-right: auto; }
.app-brand img { border-radius: 8px; }
.app-bell { position: relative; width: 36px; height: 36px; display: grid; place-items: center; }
.app-bell b { position: absolute; top: 0; right: -2px; min-width: 18px; height: 18px; border-radius: 9px; background: #b91c1c; font-size: 11px; display: grid; place-items: center; }
.app-avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .16); display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.app-body { padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.app-small { font-size: 13px; }
.app-muted { color: var(--a-muted); }
.app-strong { font-weight: 700; font-size: 15px; }
.app-h1 { font-size: 22px; font-weight: 700; }
.app-h2 { font-size: 16px; font-weight: 600; }
.app-next { display: flex; align-items: center; gap: 12px; background: var(--a-next); color: #ffffff; border-radius: 14px; padding: 16px; }
.app-next > div { flex: 1; }
.app-next-label { font-size: 12px; font-weight: 600; letter-spacing: .6px; opacity: .8; }
.app-next-title { font-size: 16px; font-weight: 700; margin-top: 2px; }
.app-next-meta { font-size: 13px; opacity: .9; }
.app-next-go { background: rgba(255, 255, 255, .18); border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; }
.app-card { background: var(--a-surface); border: 1px solid var(--a-border); border-radius: 14px; padding: 16px; box-shadow: 0 1px 2px rgba(17, 24, 39, .05); }
.app-banner { display: flex; align-items: center; gap: 12px; padding-block: 12px; }
.app-banner > div { flex: 1; }
.app-banner-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--a-amber-soft); color: var(--a-amber); display: grid; place-items: center; font-size: 24px; font-weight: 500; }
.app-chev { color: var(--a-faint); font-size: 22px; }
.app-cal { padding-block: 12px; }
.app-cal-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.app-week { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.app-dow span { font-size: 12px; font-weight: 600; color: var(--a-muted); padding: 4px 0; }
.app-week:not(.app-dow) span { display: grid; justify-items: center; align-content: start; padding-top: 9px; height: 46px; font-size: 15px; font-weight: 500; position: relative; }
.app-week .sel::before { content: ""; position: absolute; top: 3px; left: 50%; width: 32px; height: 32px; margin-left: -16px; border-radius: 50%; background: var(--a-blue); }
.app-week .sel { color: var(--a-on-accent); font-weight: 700; }
.app-week .sel { isolation: isolate; }
.app-week .sel::before { z-index: -1; }
.app-week i { width: 5px; height: 5px; border-radius: 50%; background: var(--a-blue); opacity: .75; margin-top: 8px; }
.app-dayhead { display: flex; justify-content: space-between; align-items: center; padding: 4px 2px 0; }
.app-link { color: var(--a-blue); font-size: 13px; }
.app-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.app-stat { background: var(--a-surface); border: 1px solid var(--a-border); border-radius: 12px; padding: 12px; }
.app-stat-label { font-size: 12px; color: var(--a-muted); font-weight: 500; }
.app-stat-value { font-size: 21px; font-weight: 700; margin-top: 4px; }
.app-stat-value small { font-size: 13px; font-weight: 500; color: var(--a-muted); }
.app-stat-sub { font-size: 11px; color: var(--a-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-shift { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.app-time { width: 64px; flex: none; }
.app-start { font-weight: 600; font-size: 14px; }
.app-end { color: var(--a-muted); font-size: 13px; }
.app-line { width: 4px; align-self: stretch; border-radius: 4px; background: var(--a-blue); }
.app-shift-main { flex: 1; min-width: 0; }
.app-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-meta { color: var(--a-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-pill { background: var(--a-soft); color: var(--a-blue); font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.app-tabs { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--a-surface); border-top: 1px solid var(--a-border); padding: 8px 0 12px; text-align: center; font-size: 12px; font-weight: 500; color: var(--a-muted); }
.app-tabs span { display: grid; justify-items: center; gap: 2px; }
.app-tabs .on { color: var(--a-blue); }
.app-tabs .cut { stroke: var(--a-surface); }
/* In dark mode the phone shows the app's dark theme (mobile/src/lib/theme.js, Ocean accent) */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .app { --a-blue: #6f9bff; --a-navy: #121a2e; --a-soft: #1b2847; --a-bg: #0f141d; --a-border: #283142; --a-text: #e5e8ef; --a-muted: #9aa3b4; --a-amber: #f0b64a; --a-amber-soft: #382a12; --a-surface: #161c27; --a-faint: #6c7588; --a-next: var(--a-soft); --a-on-accent: #0f141d; }
}
:root[data-theme="dark"] .app { --a-blue: #6f9bff; --a-navy: #121a2e; --a-soft: #1b2847; --a-bg: #0f141d; --a-border: #283142; --a-text: #e5e8ef; --a-muted: #9aa3b4; --a-amber: #f0b64a; --a-amber-soft: #382a12; --a-surface: #161c27; --a-faint: #6c7588; --a-next: var(--a-soft); --a-on-accent: #0f141d; }
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { position: relative; padding: 10px 0 10px 30px; border-bottom: 1px solid var(--line); }
.ticks li::before { content: ""; position: absolute; left: 4px; top: 17px; width: 12px; height: 7px; border-left: 2.5px solid var(--teal); border-bottom: 2.5px solid var(--teal); transform: rotate(-45deg); }

/* Getting started: a real sequence, so it's numbered */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); }
.steps li { counter-increment: step; position: relative; padding-top: 58px; }
.steps li::before {
	content: counter(step); position: absolute; top: 0; left: 0;
	width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
	background: var(--ink); color: var(--paper); font: 600 1.2rem/1 var(--display);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; top: 21px; left: 54px; right: -12px; height: 2px; background: var(--ink); opacity: .25; }
.steps p { margin-top: 8px; color: var(--ink-soft); }
.terms-line { margin-top: 40px; font-size: 1.12rem; max-width: 60ch; }

/* Contact */
.contact { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.contact-copy > p { margin-top: 14px; color: var(--ink-soft); max-width: 44ch; }
.details { margin: 28px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; }
.details dt { font-weight: 700; }
.details dd { margin: 0; }
.form { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(20px, 3vw, 32px); display: grid; gap: 6px; }
.form label { font-weight: 700; margin-top: 12px; }
.form label:first-child { margin-top: 0; }
.form input, .form textarea {
	width: 100%; font: inherit; color: var(--ink); background: var(--paper);
	border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.form textarea { resize: vertical; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 25%, transparent); }
.form .btn { margin-top: 14px; justify-self: start; }
.form-privacy { margin-top: 14px; font-size: .92rem; color: var(--ink-soft); }
.form-note { margin-top: 10px; font-size: .92rem; color: var(--ink-soft); }
.form-note.sent { color: var(--link); }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 28px 0 36px; font-size: .92rem; color: var(--ink-soft); }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot a { color: var(--ink-soft); }

/* Phones and small tablets */
@media (max-width: 860px) {
	.top-nav a:not(.btn) { display: none; }
	.split, .contact { grid-template-columns: 1fr; }
	.steps { grid-template-columns: 1fr; gap: 26px; }
	.steps li { padding: 4px 0 0 60px; min-height: 42px; }
	.steps li:not(:last-child)::after { top: 52px; bottom: -22px; left: 20px; right: auto; width: 2px; height: auto; }
}
@media (max-width: 560px) {
	.day-grid { --who: 52px; }
	.who { font-size: .85rem; }
	.hours span:nth-child(even) { visibility: hidden; }
	.bar b { display: none; }
	.bar.sleep b, .bar.open b { display: block; font-size: .75rem; }
	.bar .long { display: none; }
	.hero-actions .btn { flex: 1 1 auto; }
}
.lost { margin-top: 48px; }
