/* =========================================================
   christiangruntz.ch — shared design system
   Console motif · monochrome + one accent · calm & modern
   ========================================================= */

:root {
  --bg:        #0a0a0b;
  --bg-soft:   #101013;
  --panel:     rgba(255, 255, 255, 0.025);
  --panel-2:   rgba(255, 255, 255, 0.04);
  --border:    rgba(255, 255, 255, 0.08);
  --border-2:  rgba(255, 255, 255, 0.14);

  --text:      #e9e9ec;
  --muted:     #9a9aa2;
  --dim:       #6a6a72;
  --faint:     #3a3a42;

  --accent:      #0CAB50;   /* warm signature coral — change here to reskin */
  --accent-soft: rgba(79, 127, 77, 0.15);

  --radius:    18px;
  --radius-lg: 26px;
  --maxw:      1160px;

  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Fira Code", "Consolas", monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent-soft); color: #fff; }

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

/* Subtle top gradient so pure black doesn't feel flat */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(255, 122, 77, 0.06), transparent 60%),
    radial-gradient(700px 500px at 0% 0%, rgba(255, 255, 255, 0.03), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* =========================================================
   LAYOUT
   ========================================================= */

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

.section { position: relative; z-index: 1; padding: 120px 0; }
.section + .section { padding-top: 0; }

.section-head { margin-bottom: 48px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
.eyebrow .n {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.eyebrow .n::after {
  content: "";
  display: inline-block;
  width: 26px;
  height: 1px;
  background: var(--border-2);
  vertical-align: middle;
  margin-left: 12px;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }

.section h2 { font-size: clamp(2rem, 4.5vw, 3.1rem); }

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 300;
  max-width: 620px;
  margin-top: 18px;
}

/* =========================================================
   NAV
   ========================================================= */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  background: rgba(10, 10, 11, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s, background 0.4s;
}
.nav.scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 10, 11, 0.75);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.nav-logo .blink { color: var(--accent); }
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a {
  font-size: 14px;
  color: var(--dim);
  transition: color 0.25s;
  position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-back {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
  transition: color 0.25s;
}
.nav-back:hover { color: var(--text); }

/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 12px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s, color 0.25s;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary { background: var(--accent); color: #2a0d03; border-color: var(--accent); }
.btn-primary:hover { box-shadow: 0 10px 30px rgba(255, 122, 77, 0.28); }

.btn-ghost { background: var(--panel-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-2); background: rgba(255, 255, 255, 0.06); }

/* =========================================================
   WINDOW / CONSOLE COMPONENT (recurring motif)
   ========================================================= */

.window {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}
.window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.r { background: #ff5f57; }
.dot.y { background: #febc2e; }
.dot.g { background: #28c840; }
.window-title {
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--dim);
}
.window-body {
  padding: 26px 26px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 2;
  color: var(--muted);
}
.window-body .k { color: var(--dim); }
.window-body .s { color: var(--accent); }
.window-body .w { color: var(--text); }
.caret {
  display: inline-block;
  width: 8px;
  background: var(--accent);
  color: transparent;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* =========================================================
   REVEAL ON SCROLL
   ========================================================= */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* =========================================================
   HERO
   ========================================================= */

.hero { padding: 168px 0 96px; position: relative; z-index: 1; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  margin-bottom: 28px;
}
.hero-badge .live {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: livepulse 1.8s ease-in-out infinite;
}
@keyframes livepulse { 0%,100% { opacity: 0.45; } 50% { opacity: 1; } }

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.02;
}
.hero h1 .greet { color: var(--text); }
.hero h1 .name { display: block; color: var(--muted); font-weight: 300; margin-top: 8px; font-size: 0.42em; letter-spacing: 0; }
.hero-sub {
  color: var(--muted);
  font-weight: 300;
  font-size: 1.08rem;
  max-width: 480px;
  margin: 26px 0 34px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* =========================================================
   PROJECTS
   ========================================================= */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.project-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 28px;
  transition: transform 0.4s var(--ease), border-color 0.35s, background 0.35s;
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-2);
  background: var(--panel-2);
}
.project-card .pc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.pc-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 18px;
}
.pc-arrow {
  color: var(--dim);
  font-size: 18px;
  transition: transform 0.35s var(--ease), color 0.35s;
}
.project-card:hover .pc-arrow { transform: translate(3px, -3px); color: var(--accent); }
.project-card h3 { font-size: 1.25rem; margin-bottom: 10px; }
.project-card p { color: var(--muted); font-weight: 300; font-size: 0.95rem; line-height: 1.65; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.pc-tags span {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
}

/* Playground — terminal-style expandable list */
.playground { margin-top: 22px; }
.pg-toggle {
  width: 100%;
  text-align: left;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.3s, background 0.3s;
}
.pg-toggle:hover { border-color: var(--border-2); }
.pg-toggle .chev { margin-left: auto; color: var(--dim); transition: transform 0.35s var(--ease); }
.pg-toggle.open { border-radius: var(--radius) var(--radius) 0 0; border-bottom-color: transparent; }
.pg-toggle.open .chev { transform: rotate(90deg); color: var(--accent); }
.pg-toggle .prompt { color: var(--accent); }
.pg-toggle .muted { color: var(--dim); }

.pg-list {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease);
}
.pg-list.open { grid-template-rows: 1fr; }
.pg-list-inner { overflow: hidden; }
.pg-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  transition: background 0.25s;
}
.pg-item:first-child { border-top: none; }
.pg-item:hover { background: var(--panel); }
.pg-item .pg-ico { color: var(--accent); width: 20px; text-align: center; flex-shrink: 0; }
.pg-item .pg-name { font-family: var(--mono); font-size: 14px; color: var(--text); flex-shrink: 0; }
.pg-item .pg-desc { color: var(--muted); font-size: 0.9rem; font-weight: 300; }
.pg-item .pg-go { margin-left: auto; color: var(--dim); flex-shrink: 0; transition: transform 0.3s var(--ease), color 0.3s; }
.pg-item:hover .pg-go { color: var(--accent); transform: translateX(3px); }

/* =========================================================
   TEACHING
   ========================================================= */

.subject { margin-bottom: 18px; }
.subject-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.subject-head h3 { font-size: 1.4rem; }
.subject-head .code { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.subject-desc { color: var(--muted); font-weight: 300; margin-bottom: 20px; max-width: 640px; }

.week {
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--panel);
}
.week-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  text-align: left;
  transition: background 0.25s;
}
.week-head:hover { background: var(--panel-2); }
.week-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px 9px;
  flex-shrink: 0;
}
.week-count { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--dim); }
.week-chev { color: var(--dim); transition: transform 0.35s var(--ease); }
.week.open .week-chev { transform: rotate(90deg); color: var(--accent); }
.week-files {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease);
}
.week.open .week-files { grid-template-rows: 1fr; }
.week-files-inner { overflow: hidden; }
.file-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px 13px 22px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
  transition: background 0.2s, color 0.2s;
}
.file-link:hover { background: var(--panel-2); color: var(--text); }
.file-link .fico { color: var(--accent); width: 18px; text-align: center; }
.file-link .fdl { margin-left: auto; color: var(--dim); font-size: 0.85rem; }

.state-msg {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
  padding: 20px 0;
}

/* =========================================================
   GALLERY (masonry via CSS columns)
   ========================================================= */

.gallery-wrap { position: relative; }
.gallery-clip { overflow: hidden; }
.gallery-clip.collapsed { max-height: 320px; }
.gallery-fade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 260px;
  background: linear-gradient(to bottom, rgba(10, 10, 11, 0) 0%, var(--bg) 78%);
  pointer-events: none;
  transition: opacity 0.45s;
}
.gallery-fade.hidden { opacity: 0; }
.gallery-more-wrap { text-align: center; margin-top: 22px; }
.gallery-more i { transition: transform 0.3s var(--ease); font-size: 12px; }

.gallery {
  column-count: 3;
  column-gap: 14px;
}
.gallery .g-item {
  break-inside: avoid;
  margin-bottom: 14px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-soft);
  cursor: pointer;
  position: relative;
  border: 1px solid var(--border);
}
.gallery .g-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s var(--ease), opacity 0.6s;
  opacity: 0;
}
.gallery .g-item img.loaded { opacity: 1; }
.gallery .g-item:hover img { transform: scale(1.05); }
.gallery .g-item::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.35), transparent 45%);
  opacity: 0;
  transition: opacity 0.35s;
}
.gallery .g-item:hover::after { opacity: 1; }

/* =========================================================
   LIGHTBOX
   ========================================================= */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(6, 6, 8, 0.94);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8);
  animation: lbin 0.3s var(--ease);
}
@keyframes lbin { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
.lb-btn {
  position: absolute;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.25s;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.14); }
.lb-close { top: 22px; right: 24px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lb-counter {
  position: absolute;
  bottom: 22px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
}

/* =========================================================
   FOOTER / CONTACT
   ========================================================= */

.footer { position: relative; z-index: 1; padding: 40px 0 60px; border-top: 1px solid var(--border); margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: start; }
.footer h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 16px; }
.footer p { color: var(--muted); font-weight: 300; max-width: 420px; }
.contact-list { display: flex; flex-direction: column; gap: 4px; }
.contact-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 14px;
  transition: border-color 0.25s, color 0.25s, background 0.25s, transform 0.25s var(--ease);
}
.contact-link:hover { color: var(--text); border-color: var(--border); background: var(--panel); transform: translateX(4px); }
.contact-link .ci { color: var(--accent); width: 22px; text-align: center; font-size: 18px; }
.footer-base {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12.5px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .projects-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .nav-links { display: none; }
  .gallery { column-count: 2; }
  .section { padding: 90px 0; }
  .hero { padding: 130px 0 70px; }
}

@media (max-width: 560px) {
  .gallery { column-count: 1; }
  .wrap { padding: 0 20px; }
  .pg-item { flex-wrap: wrap; gap: 8px 12px; }
  .pg-item .pg-desc { flex-basis: 100%; }
}

