/*
Theme Name: Lukas Gall Portfolio
Author: Lukas Gall
Description: Minimalistisches Portfolio-Theme mit Projekt-Galerie (Custom Post Type "Projekt").
Version: 1.8
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lukas-portfolio
*/

/* ============================================
   Fonts — self-hosted (Space Grotesk, Inter, IBM Plex Mono),
   no external request to Google's font CDN
   ============================================ */
@font-face {
  font-family: 'Space Grotesk';
  src: url('fonts/space-grotesk-latin-500-normal.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('fonts/space-grotesk-latin-600-normal.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('fonts/space-grotesk-latin-700-normal.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-500-normal.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ============================================
   Design tokens
   ============================================ */
:root {
  --color-paper:    #F5F4F0; /* background */
  --color-ink:      #181712; /* primary text */
  --color-graphite: #6E6B62; /* secondary text */
  --color-line:     #DEDBD2; /* hairlines */
  --color-steel:    #33454E; /* accent */
  --color-board:    #EAE7DF; /* placeholder tile fill */

  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;

  --maxw: 1200px;
}

[data-theme="dark"] {
  --color-paper:    #1E1E1C;
  --color-ink:      #EDEBE6;
  --color-graphite: #9C9890;
  --color-line:     #3A3936;
  --color-steel:    #7B98A6;
  --color-board:    #2A2A27;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================
   Header / Footer
   ============================================ */
.site-header {
  padding: 2.25rem 0 1.75rem;
  border-bottom: 1px solid var(--color-line);
}
.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
}
.site-header__right {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.site-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: color 0.2s ease;
}
.site-nav a:hover { color: var(--color-steel); }
.site-tagline {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-graphite);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.site-footer {
  border-top: 1px solid var(--color-line);
  padding: 1.75rem 0;
  margin-top: 2rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-graphite);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ============================================
   Hero (front page only) — organic node network
   ============================================ */
.hero {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__overlay {
  position: relative;
  z-index: 1;
  text-align: center;
  pointer-events: none;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero__overlay h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hero__overlay p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-graphite);
  margin-top: 0.75rem;
}

/* Impulse dot — hero's click target, previews the ripple with an
   idle pulse so it reads as interactive before it's ever touched */
.impulse-dot {
  margin-top: 2.5rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-ink);
  border: none;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  padding: 0;
  animation: impulse-pulse 2.4s ease-in-out infinite;
}
.impulse-dot::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid var(--color-graphite);
  opacity: 0;
  animation: impulse-ring 2.4s ease-out infinite;
}
@keyframes impulse-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
@keyframes impulse-ring {
  0% { transform: scale(0.6); opacity: 0.6; }
  100% { transform: scale(2); opacity: 0; }
}

/* Small persistent toggle, same trigger class logic, shown in the
   header on every page so the theme stays switchable anywhere */
.theme-toggle {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--color-ink);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s ease;
}
.theme-toggle:hover { background: var(--color-ink); }

.hero__scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.3rem;
  color: var(--color-graphite);
  animation: hero-bounce 2.2s ease-in-out infinite;
}
@keyframes hero-bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* Pixel-reveal canvas, drawn by theme-toggle.js */
.theme-pixels {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

/* CV / download button, e.g. on the About page */
.btn-download {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--color-ink);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: background 0.2s ease, color 0.2s ease;
}
.btn-download:hover { background: var(--color-ink); color: var(--color-paper); }

/* ============================================
   Gallery grid (front page)
   ============================================ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem 2rem;
  padding: 3.5rem 0 5rem;
}
@media (max-width: 700px) {
  .project-grid { grid-template-columns: 1fr; padding: 2.5rem 0 3.5rem; gap: 2.5rem; }
}

.project-tile { position: relative; display: block; }

.project-tile__frame {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-board);
}
.project-tile__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(.2,.8,.2,1);
}
.project-tile:hover .project-tile__frame img { transform: scale(1.035); }

/* signature hover element: registration-mark corners, nodding to
   technical drawing marks and the Formschluss theme running through
   the work — parts clicking into place */
.project-tile__frame::before,
.project-tile__frame::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
  z-index: 2;
}
.project-tile__frame::before {
  top: 10px; left: 10px;
  border-top: 2px solid var(--color-steel);
  border-left: 2px solid var(--color-steel);
  transform: translate(6px, 6px);
}
.project-tile__frame::after {
  bottom: 10px; right: 10px;
  border-bottom: 2px solid var(--color-steel);
  border-right: 2px solid var(--color-steel);
  transform: translate(-6px, -6px);
}
.project-tile:hover .project-tile__frame::before,
.project-tile:hover .project-tile__frame::after {
  opacity: 1;
  transform: translate(0, 0);
}

.project-tile__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}
.project-tile__placeholder span {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--color-graphite);
  opacity: 0.55;
}

.project-tile__meta {
  padding-top: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.project-tile__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}
.project-tile__tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--color-graphite);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* ============================================
   Single project page
   ============================================ */
.project-single { padding: 3rem 0 6rem; }

.project-single__back {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-graphite);
  display: inline-block;
  margin-bottom: 2.25rem;
  transition: color 0.2s ease;
}
.project-single__back:hover { color: var(--color-steel); }

.project-single__tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--color-steel);
  letter-spacing: 0.03em;
  margin-bottom: 0.6rem;
  display: block;
}
.project-single h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 2rem;
  max-width: 18ch;
}

.project-single__hero {
  aspect-ratio: 16 / 9;
  background: var(--color-board);
  overflow: hidden;
  margin-bottom: 2.5rem;
}
.project-single__hero img { width: 100%; height: 100%; object-fit: cover; }
.project-single__hero .project-tile__placeholder span { font-size: 2rem; }

.project-single__body {
  max-width: 640px;
  font-size: 1.08rem;
  line-height: 1.75;
}
.project-single__body p { margin: 0 0 1.4rem; }

/* ============================================
   Custom logo (optional — falls back to text title)
   ============================================ */
.site-title img { display: block; max-height: 44px; width: auto; }

/* ============================================
   Generic WordPress Page (Impressum, Datenschutz, etc.)
   ============================================ */
.page-content { padding: 3rem 0 6rem; }
.page-content h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 2rem;
}
.page-content__body {
  max-width: 640px;
  font-size: 1.05rem;
  line-height: 1.75;
}
.page-content__body p { margin: 0 0 1.4rem; }
.page-content__body h2,
.page-content__body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 2.2rem 0 1rem;
}

/* Inline images/figures within post content */
.project-single__body img,
.project-single__body figure,
.page-content__body img,
.page-content__body figure {
  margin: 0 0 1.5rem;
}

/* Footer legal links */
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}
.footer-legal a { margin-left: 1.25rem; transition: color 0.2s ease; }
.footer-legal a:first-child { margin-left: 0; }
.footer-legal a:hover { color: var(--color-steel); }

/* ============================================
   Easter egg: "Impuls-Sequenz" memory game,
   opens after 5 rapid clicks on either dot trigger
   ============================================ */
.game-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: color-mix(in srgb, var(--color-ink) 55%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.game-panel {
  position: relative;
  background: var(--color-paper);
  border: 1px solid var(--color-line);
  padding: 2.5rem 2rem 2rem;
  max-width: 300px;
  width: 100%;
  text-align: center;
}
.game-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--color-graphite);
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}
.game-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.game-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-graphite);
  margin-bottom: 1.5rem;
}
.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  width: fit-content;
  margin: 0 auto;
}
.game-dot {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--color-line);
  background: var(--color-board);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.game-dot--lit {
  background: var(--color-steel);
  transform: scale(1.08);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--color-steel) 20%, transparent);
}
.game-hint {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--color-graphite);
  margin-top: 1.5rem;
}

/* ============================================
   Accessibility / quality floor
   ============================================ */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-steel);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
