@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Playfair+Display:ital,wght@0,500;0,600;1,500;1,600&display=swap');

:root {
  --ink: #eceef7;
  --muted: #9ba1b5;
  --line: rgba(239, 242, 255, .13);
  --paper: #0c1020;
  --surface: #141a2d;
  --accent: #c2b4ff;
  --glow: #29204b;
}
html[data-theme="light"] {
  --ink: #172037;
  --muted: #59657d;
  --line: rgba(27, 39, 68, .17);
  --paper: #eef1f7;
  --surface: #ffffff;
  --accent: #6250bd;
  --glow: #d9d0ff;
}
html[data-theme="graphite-lime"] {
  --ink: #eff7dd;
  --muted: #afbc9a;
  --line: rgba(207, 255, 92, .22);
  --paper: #171a18;
  --surface: #242a25;
  --accent: #c7ff55;
  --glow: #41522b;
}
html[data-theme="retro"] {
  --ink: #fff0c2;
  --muted: #d2ae79;
  --line: rgba(255, 190, 92, .33);
  --paper: #24150f;
  --surface: #4a2d1d;
  --accent: #ffb64c;
  --glow: #7a3d20;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 78% -6%, var(--glow) 0, transparent 28rem), var(--paper); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
main, footer { width: min(1160px, calc(100% - 48px)); margin: auto; }
.nav { height: 88px; display: flex; align-items: center; justify-content: space-between; }
.brand { color: var(--ink); font: 700 23px/1 ui-monospace, SFMono-Regular, Menlo, monospace; text-decoration: none; letter-spacing: -2px; }
.brand span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 18px; font-size: 14px; white-space: nowrap; }
.nav a, footer a { color: var(--muted); text-decoration: none; }
.nav a:hover, footer a:hover, .text-link:hover { color: var(--ink); }
.theme-picker { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: .04em; }
.theme-select { appearance: auto; box-sizing: border-box; width: 132px; height: 30px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--surface); font: 12px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color-scheme: dark; cursor: pointer; }
html[data-theme="light"] .theme-select { color-scheme: light; }
.language-switch { display: inline-flex; gap: 2px; margin-left: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.language-switch a { padding: 4px 6px; border-radius: 999px; color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.language-switch a.active { color: #171827; background: var(--accent); }
.hero { min-height: 560px; padding: 112px 0 96px; display: flex; flex-direction: column; align-items: flex-start; }
.eyebrow { margin: 0 0 16px; color: var(--accent); font: 500 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 900px; margin-bottom: 28px; font-size: clamp(2.4rem, 5vw, 4.8rem); line-height: 1.08; letter-spacing: -.06em; }
h1 em, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.045em; }
h1 em { display: inline-block; margin-top: .24em; }
.intro { max-width: 590px; color: var(--muted); font-size: 18px; line-height: 1.6; }
.button { margin-top: 20px; padding: 14px 19px; border-radius: 999px; color: #111326; background: var(--accent); font-size: 14px; font-weight: 700; text-decoration: none; transition: transform .2s; }
.button:hover { transform: translateY(-2px); }
.button span { margin-left: 9px; font-size: 16px; }
section { padding: 96px 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 32px; }
h2 { margin-bottom: 0; font-size: clamp(2.6rem, 5vw, 4.6rem); line-height: .98; }
.count { margin: 0; color: var(--muted); font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
.projects { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.project { --project-accent: var(--accent); overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); transition: border .2s, transform .2s, box-shadow .2s; }
.project:hover { border-color: var(--project-accent); box-shadow: 0 14px 34px color-mix(in srgb, var(--project-accent) 14%, transparent); transform: translateY(-3px); }
.project.featured { grid-column: span 6; order: 0; display: grid; grid-template-columns: .78fr 1.22fr; }
.project.priority { grid-column: span 3; order: 1; }
.project.compact { grid-column: span 2; order: 2; }
.project-visual { position: relative; min-height: 255px; display: grid; place-items: center; overflow: hidden; background: #212943; }
.project.featured .project-visual { order: 2; min-height: 280px; }
.project.featured .project-content { order: 1; padding: 34px 38px; }
.project.priority { display: flex; flex-direction: column; }
.project.priority .project-visual { order: 1; min-height: 0; aspect-ratio: 16 / 9; }
.project.priority .project-content { order: 2; padding: 28px 30px; }
.project.priority .project-visual::after { content: ""; position: absolute; inset: auto 0 0; z-index: 1; height: 34%; background: linear-gradient(to bottom, transparent, var(--surface)); pointer-events: none; }
.project-visual img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.project:hover .project-visual img { transform: translate(var(--pointer-x, 0), var(--pointer-y, 0)) scale(1.035); }
.accent-appatlas { --project-accent: #8b8dff; }
.accent-fileatlas { --project-accent: #66c9ed; }
.accent-codexvault { --project-accent: #79c8a6; }
.accent-budget { --project-accent: #4f9d83; }
.accent-calcboy { --project-accent: #e2b65d; }
.accent-skybreak { --project-accent: #00ddeb; }
.accent-urobilanz { --project-accent: #9a7cff; }
.accent-health { --project-accent: #d87296; }
.accent-thermalatlas { --project-accent: #43c2e8; }
.accent-pets { --project-accent: #76c9ed; }
.accent-shortcuts { --project-accent: #f39a50; }
.project .meta, .project .text-link span { color: var(--project-accent); }
.fileatlas img, .calcboy img, .skybreak img, .thermalatlas img, .pets img { width: min(180px, 50%); height: auto; object-fit: contain; filter: drop-shadow(0 18px 20px rgba(0,0,0,.24)); }
.fileatlas { background: linear-gradient(140deg, #bee3f5, #7593ba); }
.codexvault { background: linear-gradient(145deg, #122a2f, #315a52); }
.budget { background: #f2f1ea; }
.budget img { width: 56%; height: auto; max-height: 205px; object-fit: contain; border-radius: 12px; box-shadow: 0 10px 22px rgba(24, 28, 43, .14); }
.calcboy { background: linear-gradient(145deg, #dbcea4, #928453); }
.skybreak { background: radial-gradient(circle at 50% 42%, #163c63, #070918 68%); }
.urobilanz { background: #201c4e; }
.health { background: #e9e6dd; }
.thermalatlas { background: linear-gradient(140deg, #254c5c, #111d2f 56%, #46345d); }
.pets { background: radial-gradient(circle, #b7e7ff, #6781b6); }
.project-content { padding: 26px 28px 29px; }
.meta { display: flex; align-items: center; gap: 7px; margin-bottom: 11px; color: var(--accent); font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; }
.meta::before { display: inline-grid; place-items: center; width: 16px; height: 16px; border: 1px solid currentColor; border-radius: 50%; font: 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.platform-mac .meta::before { content: "⌘"; }
.platform-web .meta::before { content: "◌"; }
.platform-hybrid .meta::before { content: "⌘"; }
.platform-codex .meta::before { content: "✦"; }
.platform-shortcut .meta::before { content: "↗"; }
h3 { margin-bottom: 12px; font-size: 27px; letter-spacing: -.04em; }
.project-tier { display: inline-block; vertical-align: middle; margin: 0 0 3px 7px; padding: 4px 7px; border: 1px solid color-mix(in srgb, var(--project-accent) 60%, transparent); border-radius: 999px; color: var(--project-accent); font: 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .05em; text-transform: uppercase; }
.project.compact .project-visual { min-height: 135px; }
.project.compact .project-content { padding: 20px 21px 22px; }
.project.compact h3 { margin-bottom: 9px; font-size: 23px; }
.project.compact .project-content > p:not(.meta) { min-height: 0; margin-bottom: 16px; font-size: 14px; }
.project.compact .actions { margin-top: 18px; gap: 12px; }
.project-content > p:not(.meta) { min-height: 76px; margin-bottom: 21px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.status { vertical-align: middle; margin-left: 5px; padding: 4px 7px; border: 1px solid rgba(194,180,255,.5); border-radius: 999px; color: var(--accent); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 99px; color: #c5cada; font-size: 11px; }
.actions { display: flex; flex-wrap: wrap; gap: 17px; margin-top: 24px; }
.text-link { color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.text-link span { color: var(--accent); margin-left: 3px; }
.text-link.muted { color: var(--muted); font-weight: 500; }
.principles { margin-top: 50px; padding: 96px 48px; border-radius: 20px; background: linear-gradient(115deg, #27234a, #151c32 70%); }
.principle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; margin-top: 56px; }
.principle-grid p { position: relative; margin: 0; padding: 22px 20px 20px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; color: var(--muted); background: rgba(255,255,255,.035); font-size: 15px; line-height: 1.6; }
.principle-grid p::before { content: ""; position: absolute; top: 0; left: 20px; width: 34px; height: 2px; background: var(--accent); }
.principle-grid strong { display: block; margin: 10px 0 9px; color: var(--ink); font-size: 16px; }
.principle-mark { display: block; color: var(--accent); font: 600 21px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
footer { display: flex; justify-content: space-between; padding: 30px 0 45px; color: var(--muted); font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
footer p { margin: 0; }
@media (max-width: 700px) {
  main, footer { width: min(100% - 32px, 1160px); }
  .nav { height: 72px; }
  .hero { min-height: auto; padding: 88px 0 76px; }
  .intro { font-size: 16px; }
  section { padding: 66px 0; }
  .projects { grid-template-columns: 1fr; }
  .project.featured, .project.priority, .project.compact { grid-column: auto; }
  .project.featured { display: block; }
  .project.featured .project-visual, .project.featured .project-content,
  .project.priority .project-visual, .project.priority .project-content { order: initial; }
  .project.priority { display: block; }
  .project.featured .project-visual, .project-visual { min-height: 245px; }
  .project-content > p:not(.meta) { min-height: 0; }
  .principles { margin-top: 20px; padding: 56px 26px; }
  .principle-grid { grid-template-columns: 1fr; gap: 25px; margin-top: 40px; }
}

@media (min-width: 701px) and (max-width: 980px) {
  .projects { grid-template-columns: repeat(4, 1fr); }
  .project.featured { grid-column: span 4; }
  .project.priority, .project.compact { grid-column: span 2; }
  .project.priority { display: block; }
  .project.priority .project-visual, .project.priority .project-content { order: initial; }
}

html[data-theme="retro"] body { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background-image: linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px); background-size: 6px 6px; }
html[data-theme="retro"] h1, html[data-theme="retro"] h2 { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.07em; }
html[data-theme="retro"] .project, html[data-theme="retro"] .principles, html[data-theme="retro"] .project-visual { border-radius: 0; }
html[data-theme="retro"] .project { box-shadow: 4px 4px 0 rgba(0,0,0,.34); }
html[data-theme="retro"] .button, html[data-theme="retro"] .language-switch, html[data-theme="retro"] .theme-select { border-radius: 2px; }
@media (max-width: 700px) {
  .nav-links { gap: 10px; }
  .nav-links > a[href="#projects"], .nav-links > a[href="#projekte"] { display: none; }
  .theme-picker { gap: 0; font-size: 0; }
  .theme-select { width: 72px; min-width: 72px; padding-left: 7px; padding-right: 4px; }
}

/* Mobile-first layout refinement */
@media (max-width: 700px) {
  main, footer { width: min(100% - 40px, 540px); }
  .nav { height: 76px; }
  .brand { font-size: 20px; letter-spacing: -1.5px; }
  .nav-links { gap: 12px; }
  .nav-links > a[href="#projects"], .nav-links > a[href="#projekte"] { display: none; }
  .nav-links > a[href*="github.com"] { font-size: 0; }
  .nav-links > a[href*="github.com"]::after { content: "GitHub ↗"; font-size: 14px; }
  .theme-picker { gap: 0; font-size: 0; }
  .theme-select { width: 104px; min-width: 104px; height: 32px; padding-left: 8px; font-size: 12px; }
  .language-switch { margin-left: -3px; }
  .language-switch a { padding: 5px 7px; }

  .hero { min-height: auto; padding: 66px 0 34px; }
  .hero .eyebrow { margin-bottom: 18px; font-size: 10px; }
  h1 { max-width: 100%; margin-bottom: 30px; font-size: clamp(2.05rem, 9.3vw, 2.45rem); line-height: 1.02; letter-spacing: -.065em; }
  h1 em { margin-top: .22em; font-size: clamp(1.5rem, 7.6vw, 1.95rem); letter-spacing: -.06em; white-space: nowrap; }
  .intro { max-width: 100%; font-size: 17px; line-height: 1.62; }
  .button { margin-top: 12px; padding: 15px 22px; }

  section { padding: 48px 0; }
  .section-heading { align-items: flex-start; margin-bottom: 24px; }
  .section-heading h2 { font-size: 2.65rem; }
  .count { margin-top: 10px; }
  .projects { gap: 16px; }
  .project { border-radius: 16px; }
  .project.featured { display: block; }
  .project.featured .project-visual, .project-visual { min-height: 210px; }
  .project-content { padding: 22px 22px 24px; }
  h3 { font-size: 25px; }
  .project-content > p:not(.meta) { margin-bottom: 18px; font-size: 14px; }

  .budget img { width: 52%; max-height: 180px; }

  .principles { margin-top: 8px; padding: 50px 24px; border-radius: 16px; }
  .principle-grid { margin-top: 34px; }
  footer { padding-top: 25px; }
}

/* Browser-independent theme menu */
.theme-menu { position: relative; flex: 0 0 auto; }
.theme-trigger {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 142px; height: 32px; padding: 0 11px 0 13px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--ink);
  background: var(--surface); font: 12px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
}
.theme-trigger:hover, .theme-trigger:focus-visible { border-color: var(--accent); outline: none; }
.theme-chevron { color: var(--accent); font: 19px/1 Arial, sans-serif; transform: translateY(-2px); }
.theme-options {
  display: none; position: absolute; z-index: 10; top: calc(100% + 8px); right: 0;
  width: 164px; padding: 5px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); box-shadow: 0 15px 35px rgba(0,0,0,.28);
}
.theme-menu.open .theme-options { display: grid; gap: 2px; }
.theme-options button {
  width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; color: var(--ink);
  background: transparent; text-align: left; font: 12px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; cursor: pointer;
}
.theme-options button:hover, .theme-options button[aria-selected="true"] { color: #171827; background: var(--accent); }
@media (max-width: 700px) {
  .theme-menu { display: inline-flex; }
  .theme-trigger { width: 104px; padding-left: 10px; padding-right: 8px; }
  .theme-options { width: 152px; }
}

/* Respectful motion: only enabled when the device does not request reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  body.motion-enabled .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 560ms cubic-bezier(.22, .7, .25, 1) var(--reveal-delay, 0ms),
                transform 560ms cubic-bezier(.22, .7, .25, 1) var(--reveal-delay, 0ms);
  }
  body.motion-enabled .reveal.is-visible { opacity: 1; transform: translateY(0); }
  body.motion-enabled .project.reveal.is-visible:hover { transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}



/* Compact, recognisable social links */
.social-links { display: inline-flex; align-items: center; gap: 8px; }
.social-link {
  display: grid; place-items: center; width: 32px; height: 32px;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); transition: border-color .2s, transform .2s;
}
.social-link:hover, .social-link:focus-visible {
  border-color: var(--accent); transform: translateY(-1px); outline: none;
}
.social-link img { display: block; width: 16px; height: 16px; }
html[data-theme="light"] .social-link img { filter: brightness(.28); }
@media (max-width: 700px) {
  .social-links { gap: 6px; }
  .social-link { width: 30px; height: 30px; }
  .social-link img { width: 15px; height: 15px; }
}
