/* ──────────────────────────────────────────────
   Góður kóði — public site
   "Technical light": light ground, hairlines and a faint
   drafting grid, geometric sans headings, monospace for
   labels and numbers. Colours come from the logo:
   navy and amber.
   ────────────────────────────────────────────── */

:root {
	--bg:         #f8f9fb;
	--surface:    #ffffff;
	--navy:       #1e3a5f;   /* logo navy */
	--navy-deep:  #0f2138;
	--amber:      #d99a2b;   /* logo amber — decorative only, too light for small text */
	--amber-text: #94600b;   /* amber that holds up as small text (5:1 on --bg) */
	--ink:        #131a24;
	--ink-soft:   #545d6b;
	--ink-faint:  #858d99;
	--line:       rgba(19, 26, 36, 0.12);
	--line-soft:  rgba(19, 26, 36, 0.06);
	--display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
	--body:    'Inter', system-ui, -apple-system, sans-serif;
	--mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
	font-family: var(--body);
	color: var(--ink);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
	line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
.wrap { width: min(1160px, 92vw); margin-inline: auto; }

.mono-label {
	font-family: var(--mono);
	font-size: 0.75rem; font-weight: 500;
	letter-spacing: 0.08em; text-transform: uppercase;
	color: var(--ink-faint);
}
.mono-label .accent { color: var(--amber-text); }

/* ── Header ─────────────────────────────────── */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(248, 249, 251, 0.85);
	backdrop-filter: saturate(140%) blur(12px);
	border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 2.2rem; height: 64px; }
.brand {
	display: flex; align-items: center; gap: 0.65rem;
	margin-right: auto;
	font-family: var(--display); font-weight: 700;
	font-size: 1.15rem; letter-spacing: -0.01em;
}
.brand .brand-mark { height: 26px; width: auto; display: block; }
.nav-links { display: flex; gap: 1.8rem; font-size: 0.9rem; font-weight: 500; }
.nav-links a { color: var(--ink-soft); transition: color 0.15s ease; }
.nav-links a:hover { color: var(--ink); }
.btn-login {
	font-family: var(--mono); font-size: 0.8rem; font-weight: 500;
	padding: 0.45rem 0.9rem;
	border: 1px solid var(--line); border-radius: 6px;
	background: var(--surface);
	transition: border-color 0.15s ease, color 0.15s ease;
}
.btn-login:hover { border-color: var(--ink); }
.lang-switch {
	margin-right: -1.2rem;   /* sits close to the login button, not a nav gap away */
	font-family: var(--mono); font-size: 0.8rem; font-weight: 500;
	color: var(--ink-soft);
	transition: color 0.15s ease;
}
.lang-switch:hover { color: var(--ink); }

/* ── Hero ───────────────────────────────────── */
.hero {
	padding: 0;   /* the grid inside carries the hero's spacing, not the generic section padding */
	position: relative; overflow: hidden;
	color: #fff;
	background-color: var(--navy-deep);
	background-image:
		linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
	background-size: 32px 32px;
	background-position: -1px -1px;
}
/* fade the grid out toward the text so it reads as texture, not noise */
.hero::before {
	content: ''; position: absolute; inset: 0; pointer-events: none;
	background: linear-gradient(90deg, var(--navy-deep) 0%, rgba(15,33,56,0.9) 38%, rgba(15,33,56,0) 75%);
}
.hero-grid {
	position: relative;
	display: grid; grid-template-columns: 1.15fr 0.85fr;
	gap: 3rem; align-items: center;
	padding: clamp(2.75rem, 6vw, 4.5rem) 0;
}
.hero .mono-label { display: block; margin-bottom: 1.2rem; color: #8fa0b8; }
.hero .mono-label .accent { color: var(--amber); }
.hero h1 {
	font-family: var(--display); font-weight: 700;
	font-size: clamp(2.8rem, 6.5vw, 4.6rem);
	line-height: 1.02; letter-spacing: -0.035em;
	margin-bottom: 1.4rem;
}
.hero-lead {
	font-size: clamp(1.05rem, 1.8vw, 1.22rem);
	color: #b7c3d4;
	max-width: 44ch; margin-bottom: 1.8rem;
}
.hero-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: center; }
.btn {
	display: inline-flex; align-items: center; gap: 0.55rem;
	padding: 0.8rem 1.35rem; border-radius: 8px;
	font-weight: 600; font-size: 0.95rem;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn .arrow { font-family: var(--mono); transition: transform 0.15s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-primary { background: var(--amber); color: var(--navy-deep); }
.btn-primary:hover { background: #e6ab45; }
/* solid, so the hero's grid (and its cursor glow) doesn't show through */
.btn-secondary {
	border: 1px solid rgba(255,255,255,0.25); background: var(--navy-deep); color: #fff;
}
.btn-secondary:hover { border-color: #fff; background: #17304f; }
.btn .key-icon { width: 22px; height: 11px; }

.hero-mark {
	justify-self: center;
	position: relative;
	padding: 1.5rem;
}
.hero-mark svg { width: min(290px, 100%); height: auto; display: block; overflow: visible; }
/* drafting corner marks */
.hero-mark::before, .hero-mark::after {
	content: ''; position: absolute; width: 18px; height: 18px;
	border-color: rgba(255,255,255,0.35); border-style: solid;
}
.hero-mark::before { top: 0; left: 0; border-width: 1px 0 0 1px; }
.hero-mark::after { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

/* ── Sections ───────────────────────────────── */
section { padding: clamp(2.5rem, 5vw, 3.75rem) 0; }
.section-head {
	display: flex; align-items: baseline; justify-content: space-between;
	gap: 1rem; margin-bottom: 1.5rem;
}
.section-title {
	font-family: var(--display); font-weight: 600;
	font-size: clamp(1.7rem, 3.2vw, 2.3rem);
	letter-spacing: -0.025em; line-height: 1.1;
}

/* ── Services ───────────────────────────────── */
.cards {
	display: grid; grid-template-columns: repeat(3, 1fr);
	border: 1px solid var(--line); border-radius: 10px;
	background: var(--surface);
	overflow: hidden;
}
.card { padding: 1.6rem 1.8rem 1.8rem; position: relative; }
.card + .card { border-left: 1px solid var(--line); }
.card h3 {
	font-family: var(--display); font-weight: 600;
	font-size: 1.25rem; letter-spacing: -0.015em;
	margin-bottom: 0.6rem;
}
.card p { color: var(--ink-soft); font-size: 0.95rem; }
.card::before {
	content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
	background: var(--navy);
}
.card::after {
	content: ''; position: absolute; left: 0; top: 0; height: 3px; width: 0;
	background: var(--amber); transition: width 0.3s ease;
}
.card:hover::after { width: 100%; }

/* ── About + Contact ────────────────────────── */
.about { background: #eef2f8; }
.about-grid {
	display: grid; grid-template-columns: 1.2fr 0.8fr;
	gap: clamp(2.5rem, 6vw, 5rem); align-items: start;
}
.about-body .mono-label { display: block; margin-bottom: 1rem; }
.about-body p {
	color: var(--ink-soft); font-size: 1.05rem;
	margin-bottom: 1.1rem; max-width: 56ch;
}
.about-body .lead {
	font-family: var(--display); font-weight: 500;
	font-size: clamp(1.35rem, 2.4vw, 1.75rem);
	line-height: 1.3; letter-spacing: -0.015em;
	color: var(--ink); margin-bottom: 1.4rem;
}
.contact-card {
	border: 1px solid var(--line); border-radius: 10px;
	background: var(--surface); overflow: hidden;
}
.contact-card h3 {
	font-family: var(--display); font-weight: 600; font-size: 1.15rem;
	padding: 1.1rem 1.5rem;
	background: var(--navy); color: #fff;
}
.contact-row {
	display: flex; justify-content: space-between; align-items: baseline;
	gap: 1rem; padding: 1rem 1.5rem;
}
.contact-row + .contact-row { border-top: 1px solid var(--line-soft); }
.contact-row a, .contact-row strong {
	font-family: var(--mono); font-size: 0.92rem; font-weight: 500;
}
.contact-row a:hover { color: var(--amber-text); }

/* ── Footer ─────────────────────────────────── */
.site-footer {
	background: var(--navy-deep); color: rgba(255,255,255,0.6);
	padding: 2rem 0;
}
.footer-inner {
	display: flex; align-items: center; justify-content: space-between;
	gap: 1rem; flex-wrap: wrap;
	font-family: var(--mono); font-size: 0.8rem;
}
.footer-brand {
	display: flex; align-items: center; gap: 0.6rem;
	color: #fff; font-family: var(--display); font-weight: 600; font-size: 1rem;
}
.footer-brand .brand-mark { height: 20px; width: auto; }
.footer-contact { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-contact a:hover { color: #fff; }

/* ── Motion ─────────────────────────────────────
   Played once (the headline's caret aside), transform and opacity only. Everything here
   sits behind prefers-reduced-motion, and what's hidden before
   revealing is only hidden under html.motion, set by script —
   without it the page is simply static.
   ────────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* the caret is invisible unless animated */
.caret {
	display: inline-block; width: 0.075em; height: 0.82em;
	margin-left: 0.08em; vertical-align: -0.06em;
	background: var(--amber); border-radius: 1px; opacity: 0;
}

/* the grid glow is off unless a mouse is over the hero */
.hero-glow {
	position: absolute; inset: 0; pointer-events: none; opacity: 0;
	background-image:
		linear-gradient(rgba(217,154,43,0.75) 1px, transparent 1px),
		linear-gradient(90deg, rgba(217,154,43,0.75) 1px, transparent 1px);
	background-size: 32px 32px;
	background-position: -1px -1px;
	-webkit-mask-image: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), #000, transparent 70%);
	mask-image: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), #000, transparent 70%);
	transition: opacity 0.5s ease;
}

@media (prefers-reduced-motion: no-preference) {
	/* hero text, in turn */
	.hero-copy > * { opacity: 0; animation: rise 0.6s ease forwards; }
	.hero-copy > *:nth-child(2) { animation-delay: 0.08s; }
	.hero-copy > *:nth-child(3) { animation-delay: 0.16s; }
	.hero-copy > *:nth-child(4) { animation-delay: 0.24s; }

	/* the white loop appears whole, then the amber ring fades in, in place, completing the knot */
	.gk-weave  { animation: gk-arrive 0.7s cubic-bezier(.2,.8,.2,1) 0.15s both; }
	.gk-amber  { animation: gk-fade   0.7s ease                     0.2s  both; }
	@keyframes gk-arrive { from { opacity: 0; transform: scale(0.96); } }
	@keyframes gk-fade   { from { opacity: 0; } }

	/* the drafting corners draw in once the logo has settled */
	.hero-mark::before { transform-origin: top left; animation: corner 0.45s ease 0.85s both; }
	.hero-mark::after  { transform-origin: bottom right; animation: corner 0.45s ease 0.85s both; }
	@keyframes corner { from { opacity: 0; transform: scale(0); } }

	/* a terminal caret blinks after the headline */
	.caret { animation: caret-blink 1.05s steps(1) 0.7s infinite both; }
	@keyframes caret-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

	/* sections rise in as they scroll into view */
	.motion [data-reveal] {
		opacity: 0; transform: translateY(18px);
		transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.8,.2,1);
		transition-delay: var(--reveal-delay, 0s);
	}
	.motion [data-reveal].is-in { opacity: 1; transform: none; }

	/* buttons lift a touch */
	.btn:hover { transform: translateY(-1px); }
	.btn-primary:hover { box-shadow: 0 8px 20px -10px rgba(217,154,43,0.8); }

	.hero.is-lit .hero-glow { opacity: 1; }
}

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

/* ── Responsive ─────────────────────────────── */
@media (max-width: 860px) {
	.hero-grid { grid-template-columns: 1fr; }
	.hero-mark { display: none; }
	.hero::before { background: rgba(15,33,56,0.9); }
	.cards { grid-template-columns: 1fr; }
	.card + .card { border-left: none; border-top: 1px solid var(--line); }
	.about-grid { grid-template-columns: 1fr; }
	.nav-links { display: none; }
}

/* ── Tools (the QR page) ────────────────────── */
.hero-compact .hero-grid { grid-template-columns: 1fr; padding: clamp(2rem, 4vw, 2.75rem) 0; }
.hero-compact h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: 0.6rem; }
.hero-compact .hero-lead { margin-bottom: 0; }
.tool-card {
	border: 1px solid var(--line); border-radius: 10px;
	background: var(--surface); padding: 1.5rem 1.6rem;
}
.tool-card label { display: block; font-weight: 600; margin-bottom: 0.5rem; }
.tool-card textarea {
	display: block; width: 100%; resize: vertical;
	font-family: var(--mono); font-size: 0.9rem; line-height: 1.5;
	padding: 0.75rem 0.9rem; margin-bottom: 1rem;
	border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink);
}
.tool-card textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(30,58,95,0.12); }
.tool-card input[type=submit] { border: none; cursor: pointer; font-family: var(--body); }
.qr-grid {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 1rem; margin-top: 1.5rem;
}
.qr-card {
	display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
	border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
	padding: 1.25rem; position: relative;
}
.qr-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--navy); border-radius: 10px 10px 0 0; }
.qr-card img { width: 100%; max-width: 200px; height: auto; image-rendering: pixelated; }
.qr-text { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); text-align: center; overflow-wrap: anywhere; }
.qr-downloads { display: flex; gap: 0.5rem; margin-top: auto; }
.qr-downloads a {
	font-family: var(--mono); font-size: 0.75rem; font-weight: 500;
	padding: 0.3rem 0.75rem; border: 1px solid var(--line); border-radius: 6px;
	transition: border-color 0.15s ease, color 0.15s ease;
}
.qr-downloads a:hover { border-color: var(--navy); color: var(--navy); }
