/* ============================================================
   tristan-schroedel.de — Stylesheet
   ============================================================ */

:root {
  --bg: #fafaf7;
  --bg-soft: #f1f1ec;
  --ink: #16181d;
  --ink-soft: #5c6066;
  --accent: #1e4ed8;
  --accent-soft: rgba(30, 78, 216, 0.12);
  --line: rgba(22, 24, 29, 0.1);
  --card-bg: #ffffff;
  --header-bg: rgba(250, 250, 247, 0.8);
  --glow-a: rgba(30, 78, 216, 0.10);
  --glow-b: rgba(30, 78, 216, 0.04);
  --radius: 18px;
  --max: 1100px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
}

/* Dunkles Farbschema — aktiv per Footer-Button (data-theme="dark")
   oder automatisch nach Systemeinstellung, solange kein helles
   Schema erzwungen wurde (data-theme="light"). */
:root[data-theme="dark"] {
  --bg: #0e0f12;
  --bg-soft: #15171c;
  --ink: #e9e9e6;
  --ink-soft: #a0a4ac;
  --accent: #7c9aff;
  --accent-soft: rgba(124, 154, 255, 0.14);
  --line: rgba(233, 233, 230, 0.12);
  --card-bg: #1a1c22;
  --header-bg: rgba(14, 15, 18, 0.8);
  --glow-a: rgba(124, 154, 255, 0.09);
  --glow-b: rgba(124, 154, 255, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f12;
    --bg-soft: #15171c;
    --ink: #e9e9e6;
    --ink-soft: #a0a4ac;
    --accent: #7c9aff;
    --accent-soft: rgba(124, 154, 255, 0.14);
    --line: rgba(233, 233, 230, 0.12);
    --card-bg: #1a1c22;
    --header-bg: rgba(14, 15, 18, 0.8);
    --glow-a: rgba(124, 154, 255, 0.09);
    --glow-b: rgba(124, 154, 255, 0.04);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.35s ease;
}

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h1 { font-size: clamp(2.6rem, 7vw, 5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 1.5rem; }
h3 { font-size: 1.15rem; }

/* ------------------------------------------------------------
   Terminal-Intro
   ------------------------------------------------------------ */
#intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #0c0d10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#intro.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#intro.skip { display: none; }

.intro-line {
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 3.5vw, 1.8rem);
  color: #e8e8e3;
}

.intro-line .prompt { color: #4ade80; }

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.15em;
  margin-left: 2px;
  background: #e8e8e3;
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ------------------------------------------------------------
   Cursor-Glow (folgt der Maus)
   ------------------------------------------------------------ */
#glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  background: radial-gradient(circle,
    var(--glow-a) 0%,
    var(--glow-b) 40%,
    transparent 70%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  will-change: transform;
}

body.glow-on #glow { opacity: 1; }

@media (hover: none), (prefers-reduced-motion: reduce) {
  #glow { display: none; }
}

/* ------------------------------------------------------------
   Navigation
   ------------------------------------------------------------ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem clamp(1.25rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 500;
}

.nav-links {
  display: flex;
  gap: 2.2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  transition: color 0.25s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active { color: var(--ink); }

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 7rem clamp(1.25rem, 4vw, 2.5rem) 4rem;
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero-kicker {
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}

.hero-sub {
  margin-top: 1.6rem;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 34em;
}

.hero-actions {
  margin-top: 2.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 500;
  font-size: 0.95rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(22, 24, 29, 0.18);
  background: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
  border-color: transparent;
}

.hero-orb {
  position: absolute;
  right: -10%;
  top: 18%;
  width: clamp(280px, 40vw, 560px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
    rgba(47, 107, 255, 0.18),
    rgba(47, 107, 255, 0.05) 55%,
    transparent 75%);
  filter: blur(10px);
  animation: float 9s ease-in-out infinite;
  will-change: transform;
}

@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -28px; }
}

/* ------------------------------------------------------------
   Sektionen
   ------------------------------------------------------------ */
.section { padding: clamp(4rem, 10vw, 7.5rem) 0; }

.section-kicker {
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.about { background: var(--bg-soft); }

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  margin-top: 1.5rem;
}

.about-text {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--ink-soft);
}

.about-img {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(22, 24, 29, 0.14);
}

.about-img img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
  transition: transform 0.6s ease;
}

.about-img:hover img { transform: scale(1.04); }

/* ------------------------------------------------------------
   Karten
   ------------------------------------------------------------ */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  margin-top: 2.5rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.7rem;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  will-change: transform;
}

.card:hover {
  box-shadow: 0 18px 44px rgba(22, 24, 29, 0.1);
  border-color: transparent;
}

.card-icon {
  display: inline-block;
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}

.card h3 { margin-bottom: 0.6rem; }

.card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ------------------------------------------------------------
   Bildstreifen (Startseite)
   ------------------------------------------------------------ */
.strip { background: var(--bg-soft); }

.strip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  margin-top: 2rem;
}

.strip-item {
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
  will-change: transform;
}

.strip-item img {
  aspect-ratio: 4 / 5;
  width: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.6s ease;
}

.strip-item:hover img {
  transform: scale(1.06);
  filter: saturate(1.15);
}

.strip-more { margin-top: 2rem; }

.link-arrow {
  font-weight: 500;
  color: var(--accent);
  transition: letter-spacing 0.3s ease;
}

.link-arrow:hover { letter-spacing: 0.03em; }

/* ------------------------------------------------------------
   Unterseiten-Kopf
   ------------------------------------------------------------ */
.page-head {
  padding: clamp(9rem, 18vw, 13rem) 0 0;
}

.page-sub {
  margin-top: 1.4rem;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 32em;
}

/* ------------------------------------------------------------
   Galerie
   ------------------------------------------------------------ */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  will-change: transform;
}

.gallery-item img {
  aspect-ratio: 4 / 5;
  width: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.gallery-item:hover img { transform: scale(1.05); }

.gallery-item figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.2rem 1.2rem 1rem;
  font-size: 0.8rem;
  color: #fff;
  background: linear-gradient(transparent, rgba(12, 13, 16, 0.65));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.gallery-item:hover figcaption {
  opacity: 1;
  transform: translateY(0);
}

.gallery-note {
  margin-top: 2.5rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------
   Lightbox (Vollbild für normale Bilder)
   ------------------------------------------------------------ */
body.no-scroll { overflow: hidden; }

.gallery-item, .strip-item, .about-img { cursor: zoom-in; }

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(12, 13, 16, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: clamp(1rem, 4vw, 3rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  cursor: zoom-out;
}

#lightbox.open {
  opacity: 1;
  visibility: visible;
}

#lightbox img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.lb-caption {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.lb-close {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}

.lb-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

.lb-hint {
  position: absolute;
  bottom: max(1rem, env(safe-area-inset-bottom));
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ------------------------------------------------------------
   360°-Viewer
   ------------------------------------------------------------ */
.viewer-block + .viewer-block { margin-top: 3.5rem; }

.viewer-label {
  color: var(--ink-soft);
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
}

.viewer-box {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #0c0d10;
  box-shadow: 0 24px 60px rgba(22, 24, 29, 0.18);
}

/* Pseudo-Vollbild: füllt den Viewport per CSS — funktioniert damit
   auch auf dem iPhone, wo die echte Fullscreen-API für solche
   Elemente nicht verfügbar ist. */
.viewer-box.fs {
  position: fixed;
  inset: 0;
  z-index: 850;
  aspect-ratio: auto;
  border-radius: 0;
  box-shadow: none;
}

.box-expand {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 30;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(12, 13, 16, 0.55);
  color: #fff;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.25s ease, transform 0.25s ease;
}

.box-expand:hover {
  background: rgba(12, 13, 16, 0.85);
  transform: scale(1.08);
}

.viewer-box.fs .box-expand {
  top: max(0.8rem, env(safe-area-inset-top));
}

.viewer-box > div,
.viewer-box .video-js {
  width: 100%;
  height: 100%;
}

/* Pannellums Grab-Cursor beibehalten, Schrift ans Design angleichen */
.viewer-box .pnlm-container {
  font-family: var(--font-sans);
  background: #0c0d10;
}

.viewer-hint {
  margin-top: 0.8rem;
  padding: 1.4rem 1.5rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.viewer-hint strong { color: var(--accent); font-weight: 500; }

@media (max-width: 640px) {
  .viewer-box { aspect-ratio: 4 / 3; }
}

/* ------------------------------------------------------------
   Kontakt
   ------------------------------------------------------------ */
.contact-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.4rem;
}

.contact-card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.7rem;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  will-change: transform;
}

.contact-card:hover {
  box-shadow: 0 18px 44px rgba(22, 24, 29, 0.1);
  border-color: transparent;
}

.contact-card h3 { margin-bottom: 0.3rem; }

.contact-card p {
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
}

.terminal-box {
  margin-top: 3rem;
  background: #0c0d10;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(22, 24, 29, 0.18);
  max-width: 560px;
  will-change: transform;
}

.terminal-box.closed {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px;
  background: #1a1c21;
}

.terminal-bar .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: none;
  padding: 0;
  display: inline-block;
}

.dot-red { background: #ff5f57; cursor: pointer; transition: transform 0.2s ease, filter 0.2s ease; }
.dot-red:hover { transform: scale(1.25); filter: brightness(1.15); }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }

.terminal-body {
  padding: 1.3rem 1.4rem 1.5rem;
  color: #b8e8c5;
  font-size: 0.85rem;
  line-height: 1.9;
  cursor: text;
}

.terminal-body pre {
  font: inherit;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.term-line {
  display: flex;
  align-items: center;
  gap: 0.6ch;
}

#term-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font: inherit;
  color: inherit;
  caret-color: #b8e8c5;
  padding: 0;
}

.terminal-body .cursor {
  width: 0.55em;
  height: 1.05em;
  background: #b8e8c5;
  flex: none;
}

/* Block-Cursor nur zeigen, solange das Eingabefeld leer und
   nicht fokussiert ist — danach übernimmt der echte Text-Caret. */
.term-line:focus-within .cursor { display: none; }

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Social-Icons: grau, erst beim Hover in Originalfarben */
.footer-socials {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.footer-socials a {
  display: inline-flex;
  line-height: 0;
  filter: grayscale(1);
  opacity: 0.55;
  transition: filter 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.footer-socials a:hover,
.footer-socials a:focus-visible {
  filter: none;
  opacity: 1;
  transform: translateY(-2px);
}

.footer-socials svg {
  width: 18px;
  height: 18px;
}

/* ------------------------------------------------------------
   Scroll-Reveal
   ------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-orb { animation: none; }
  html { scroll-behavior: auto; }
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  .cards, .strip-grid, .gallery { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .about-img { max-width: 480px; }
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 32px rgba(12, 13, 16, 0.14);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }

  body.nav-open .nav-links { max-height: 320px; }

  body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
  body.nav-open .nav-toggle span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

  .nav-links li {
    padding: 0.9rem clamp(1.25rem, 4vw, 2.5rem);
    border-top: 1px solid var(--line);
  }

  .nav-links a::after { display: none; }

  .cards, .strip-grid, .gallery, .contact-cards { grid-template-columns: 1fr; }

  .strip-item img, .gallery-item img { aspect-ratio: 4 / 3; }

  .gallery-item figcaption {
    opacity: 1;
    transform: none;
  }

  .footer-inner { justify-content: center; text-align: center; }
}
