/*
  keiserdesign.dk – style.css
  v1.0 (2026-10-19) – first draft. Technical-drawing look: blueprint grid, mono labels, orange accent.
  v2.2 (2026-12-05) – Images: front page split image (.home-figure), image in hero frame (.hero-image),
                      examples gallery on /portfolio/ (.gallery), two-column head on /software/ (.soft-head),
                      image at the top of a card (.card-img – Lean Notes).
  v2.5 (2026-12-05) – .hero-stack (two images in the hero frame), .project-feature + .more-title on /portfolio/;
                      .section-example removed.
  v2.4 (2026-12-05) – .soft-head back (two-column page head on /software/ with the split image).
  v2.3 (2026-12-05) – .card-img figcaption; .section-example + .pair (two images, columns weighted by aspect
                      ratio so both get the same height); .soft-head removed (page head back to one column).
  v2.1 (2026-12-05) – .more-link (small link below the cards on /software/ and /fun/); /fun/ is its own page;
                      .cards-4 in two columns below 1100 px.
  v2.0 (2026-12-05) – Two main choices on the front page (.choices-2) + small link (.choice-minor);
                      "Software for fun" section on the Software page (.section-fun, .card-fun); external link
                      arrow (.app-links a.ext). Mobile menu wraps to two lines instead of scrolling sideways.
  v1.7 (2026-11-03) – New structure: front page choices (.home, .choices, .choice), active nav item,
                      first section on sub pages (.page-first), contact in footer (.footer-contact),
                      nav shown as a second row on mobile; footer kept at the bottom on short pages.
  v1.5 (2026-11-03) – no change; version bump.
  v1.4 (2026-11-02) – no change; version bump.
  v1.3 (2026-11-02) – .app-links list inside software cards; .card-play accent.
  v1.2 (2026-10-20) – Fonts self-hosted (@font-face) – no Google Fonts requests (privacy/GDPR + strict CSP).
  v1.1 (2026-10-20) – Keiser Design brand: colours sampled from Etsy logo/banner (#2b2b2b, #b85c38, #faf7f2, #f1e1d8), Montserrat, K logo mark, banner-style diagonals in hero.
*/

/* Self-hosted fonts (SIL OFL 1.1 – see assets/fonts/LICENSE-*) */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/montserrat-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/montserrat-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/montserrat-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/montserrat-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --ink: #2b2b2b;          /* brand charcoal */
  --ink-soft: #5c5c5c;
  --paper: #faf7f2;        /* brand cream (banner background) */
  --paper-2: #f1e1d8;      /* brand blush (banner diagonal) */
  --blush-2: #e5cdbf;      /* brand blush, darker (banner diagonal) */
  --line: #ddd5cb;
  --grid: rgba(43, 43, 43, 0.04);
  --accent: #b85c38;       /* brand rust (K mark) */
  --accent-dark: #9a4a2b;
  --soft: #5f6b73;
  --white: #ffffff;
  --radius: 4px;
  --max: 1160px;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;   /* v1.7: footer at bottom */
}
main { flex: 1 0 auto; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.mono { font-family: var(--mono); }

.label {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 0.8em;
}
.label-light { color: #e3a183; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(250, 247, 242, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark { width: 26px; height: 32px; }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-text b { font-weight: 700; letter-spacing: 0.08em; font-size: 1.05rem; }
.logo-text small { font-size: 0.6rem; letter-spacing: 0.32em; color: #8a8a8a; margin-top: 4px; font-weight: 500; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { text-decoration: none; font-size: 0.95rem; color: var(--ink-soft); }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.nav-cta { color: var(--accent-dark) !important; font-weight: 600; }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lang-switch button {
  font-family: var(--mono); font-size: 0.8rem; padding: 5px 9px;
  border: 0; background: transparent; color: var(--ink-soft); cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: var(--white); }

/* Buttons */
.btn {
  display: inline-block; padding: 12px 22px; border-radius: var(--radius);
  text-decoration: none; font-weight: 600; border: 2px solid transparent;
  transition: background 0.15s, color 0.15s;
}
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--white); }
.btn-light { background: var(--white); color: var(--ink); font-family: var(--mono); font-weight: 500; }
.btn-light:hover { background: var(--accent); color: var(--white); }

/* Hero */
.hero { padding: 72px 0 64px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
/* Banner-style diagonals (from Etsy banner) */
.hero::before, .hero::after { content: ""; position: absolute; bottom: 0; right: 0; pointer-events: none; z-index: 0; }
.hero::before { width: 420px; height: 100%; background: var(--paper-2); opacity: 0.55; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.hero::after { width: 300px; height: 75%; background: var(--blush-2); opacity: 0.5; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.hero .container { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 36em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-drawing {
  margin: 0; background: var(--white); border: 1px solid var(--line);
  padding: 16px; border-radius: var(--radius);
}
.dw-part { fill: rgba(184, 92, 56, 0.07); stroke: var(--ink); stroke-width: 2; }
.dw-center line { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 8 3 2 3; }
.dw-dim line { stroke: var(--ink-soft); stroke-width: 0.8; }
.dw-dim text, .dw-title text { font-family: var(--mono); font-size: 11px; fill: var(--ink-soft); text-anchor: middle; }
.dw-title text { text-anchor: start; font-size: 10px; }
.dw-note { fill: var(--accent-dark) !important; text-anchor: start !important; }
.dw-title rect, .dw-title line { fill: none; stroke: var(--ink); stroke-width: 1; }

/* Front page: intro + three choices (v1.7) */
.home { padding: 80px 0 96px; position: relative; overflow: hidden; }
.home::before, .home::after { content: ""; position: absolute; bottom: 0; right: 0; pointer-events: none; z-index: 0; }
.home::before { width: 420px; height: 100%; background: var(--paper-2); opacity: 0.55; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.home::after { width: 300px; height: 75%; background: var(--blush-2); opacity: 0.5; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.home .container { position: relative; z-index: 1; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 48px; }
.choice {
  display: flex; flex-direction: column; gap: 10px; min-height: 220px;
  background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--accent);
  border-radius: var(--radius); padding: 26px 24px 22px; text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.choice:hover, .choice:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(43, 43, 43, 0.08); }
.choice-soft { border-top-color: var(--soft); }
.choice-port { border-top-color: var(--ink); }
.choice-no { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-soft); }
.choice-title { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.choice-text { color: var(--ink-soft); flex: 1; }
.choice::after { content: "→"; color: var(--accent); font-size: 1.3rem; font-weight: 600; }

/* v2.0 - two main choices + small "Software for fun" link */
.choices-2 { grid-template-columns: repeat(2, 1fr); }
.choice-minor { margin: 22px 0 0; font-size: 0.98rem; }
.choice-minor a { text-decoration: none; font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.choice-minor a::after { content: " →"; color: var(--accent); }
.choice-minor a:hover, .choice-minor a:focus-visible { color: var(--accent); border-bottom-color: var(--accent); }
.choice-minor .minor-text { font-weight: 400; color: var(--ink-soft); }

/* Sections */
.section { padding: 88px 0; border-bottom: 1px solid var(--line); }
.section-intro { font-size: 1.1rem; color: var(--ink-soft); max-width: 44em; margin-bottom: 40px; }
.section-mech { background: rgba(255, 255, 255, 0.55); }
.page-first { padding-top: 64px; }

.cards { display: grid; gap: 20px; }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 22px; position: relative;
}
.card p { color: var(--ink-soft); margin: 0; font-size: 0.97rem; }
.card-no { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-soft); display: block; margin-bottom: 14px; }
.card-mech { border-top: 4px solid var(--accent); }
.card-soft { border-top: 4px solid var(--soft); }

/* App links inside software cards (v1.3) */
.app-links { list-style: none; padding: 0; margin: 18px 0 0; border-top: 1px solid var(--line); }
.app-links li { border-bottom: 1px solid var(--line); }
.app-links a { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 0; text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.app-links a:hover span { color: var(--accent); }
.app-links a::after { content: "→"; color: var(--accent); }
.card-play { border-top-color: var(--accent); }

/* v2.0 - Software for fun: smaller section and cards */
.section-fun { padding: 56px 0 64px; }
.section-fun .section-intro { margin-bottom: 24px; font-size: 1rem; }
.card-fun { padding: 18px 18px 14px; border-top: 3px solid var(--line); }
.card-fun h3 { font-size: 1rem; margin: 0; }
.card-fun .app-links { margin-top: 10px; }
.card-fun .app-links a { font-size: 0.9rem; padding: 7px 0; }
.app-links a.ext::after { content: "↗"; }
.more-link { margin-top: 36px; }

/* Process */
.process {
  list-style: none; padding: 0; margin: 48px 0 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--line); background: var(--white); border-radius: var(--radius);
}
.process li { padding: 18px 16px; border-right: 1px dashed var(--line); display: flex; flex-direction: column; }
.process li:last-child { border-right: 0; }
.process span { font-family: var(--mono); color: var(--accent); font-size: 0.8rem; }
.process small { color: var(--ink-soft); }

/* Projects */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 32px; }
.project { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 0 20px; overflow: hidden; }
.project h3, .project p, .project .tag { margin-left: 20px; margin-right: 20px; }
.project p { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 0; }
.project-img { aspect-ratio: 4 / 3; margin-bottom: 16px; }
.ph {
  display: grid; place-items: center; font-family: var(--mono); font-size: 0.8rem; color: var(--ink-soft);
  background: repeating-linear-gradient(45deg, var(--paper-2), var(--paper-2) 10px, var(--paper) 10px, var(--paper) 20px);
}
.tag { display: inline-block; font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 8px; margin-bottom: 10px; border-radius: 2px; }
.tag-mech { background: rgba(184, 92, 56, 0.12); color: var(--accent-dark); }
.tag-soft { background: rgba(95, 107, 115, 0.12); color: var(--soft); }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 48px; }
.facts { list-style: none; padding: 0; margin: 24px 0 0; border-top: 1px solid var(--line); }
.facts li { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts b { font-family: var(--mono); font-weight: 500; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.facts span { color: var(--ink-soft); }

/* Contact (v1.0–v1.6 section; not used on v1.7 pages) */
.section-contact { background: var(--ink); color: var(--white); border-bottom: 0; }
.contact-box { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.contact-box p { color: #bdb6ae; margin: 0; }

/* Footer */
.site-footer { background: var(--ink); color: #9a948d; font-size: 0.85rem; border-top: 1px solid #3a3a3a; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 20px; }
.footer-contact { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.footer-contact span { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; }
.footer-contact a { color: #e3a183; font-family: var(--mono); text-decoration: none; }
.footer-contact a:hover { color: var(--white); }

/* v2.2 - images */
.home-figure {
  margin: 40px 0 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; justify-content: center; padding: 12px;
}
.home-figure img { display: block; width: auto; max-width: 100%; height: auto; max-height: 380px; }
.home-figure + .choices { margin-top: 20px; }
.hero-image img { display: block; width: 100%; height: auto; }
.hero-image figcaption { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); margin-top: 8px; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.gallery-item {
  margin: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; padding: 14px;
}
.card-img { margin: 0 0 16px; }
.soft-head { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; margin-bottom: 40px; }
.soft-head .section-intro { margin-bottom: 0; }
.card-img img { display: block; width: 100%; height: auto; }
.card-img figcaption { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-soft); margin-top: 6px; }
.hero-stack { display: grid; gap: 12px; }
.project-feature { margin-bottom: 64px; }
.project-feature h2 { margin: 4px 0 10px; }
.project-feature .project-text { max-width: 640px; color: var(--ink-soft); margin: 0 0 24px; }
.more-title { margin: 0 0 24px; }
.hero-text .choice-minor { margin-top: 24px; }
.pair { display: grid; grid-template-columns: 2.05fr 1.67fr; gap: 20px; align-items: start; }
.pair figure { margin: 0; }
.pair img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.pair figcaption { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); margin-top: 8px; }
.gallery-item img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }

/* Responsive */
@media (max-width: 1100px) {   /* v2.1: four cards get too narrow below this width */
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .hero-grid, .about-grid, .pair, .soft-head { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .projects { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; height: auto; gap: 10px 16px; padding-top: 12px; padding-bottom: 10px; }
  .nav { order: 3; width: 100%; margin-left: 0; gap: 6px 18px; flex-wrap: wrap; white-space: nowrap; padding-bottom: 2px; } /* v2.0: wraps (longer names) */
  .nav a { font-size: 0.9rem; }
}
@media (max-width: 440px) {
  .nav { gap: 4px 14px; }
  .nav-cta { display: none; }   /* contact is in the footer */
}
@media (max-width: 720px) {
  .lang-switch { margin-left: auto; }
  html { scroll-padding-top: 110px; }
  .choices { grid-template-columns: 1fr; margin-top: 32px; }
  .choice { min-height: 0; }
  .home { padding: 48px 0 64px; }
  .cards-4, .cards-3, .projects, .gallery { grid-template-columns: 1fr; }
  .home-figure { margin-top: 28px; padding: 8px; }
  .process { grid-template-columns: 1fr; }
  .process li { border-right: 0; border-bottom: 1px dashed var(--line); }
  .process li:last-child { border-bottom: 0; }
  .section { padding: 64px 0; }
  .page-first { padding-top: 40px; }
  .facts li { grid-template-columns: 1fr; gap: 2px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
