/* type */

@font-face {
  font-family: 'Söhne Mono';
  src: url('../type/soehne-mono-buch.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Söhne Mono';
  src: url('../type/soehne-mono-kraftig.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Söhne Mono';
  src: url('../type/soehne-mono-halbfett.woff2') format('woff2');
  font-weight: 600;
  font-style: bold;
}

* { cursor: none; }

#cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 130, 0, 0.80);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9999;
  transition: transform 0.08s ease;
}

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

:root {
  --font: 'Söhne Mono', 'Courier New', monospace;
  --gutter: 24px;
  --margin: 48px;

  --fg: #000000;
  --fg-light: #000000;
  --border: #000000;
  --bg: #ffffff;
  --highlight: rgba(255, 130, 0, 1);

  --font-size-biggest: 2rem;
  --font-size-bigger: 1.5rem;
  --font-size-big: 1rem;
  --font-size-normal: 0.75rem;
  --font-size-small: 0.5rem;
  --bg-row: rgba(0,0,0,0.05);

  --theme-toggle: "Lights Off ";
}

body.inverted {
  --fg: #ffffff;
  --fg-light: #ffffff;
  --border: #ffffff;
  --bg: #000000;

  --bg-row: rgba(255,255,255,0.1);

  --theme-toggle: "Lights On ";
}

body {
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--font-size-normal);
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  -webkit-font-smoothing: antialiased;
}

p a {
  font-weight: 400;
}

a {
  color: var(--fg);
  transition: all 0.2s ease-in-out;
  text-decoration: none;
}

a:hover {
  color: var(--highlight);
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  padding-left: var(--margin);
  padding-right: var(--margin);
  margin-left: auto;
  margin-right: auto;
}

nav {
  padding-top: 33px;
  padding-bottom: 0;
}

nav .grid {
  align-items: center;
}

.nav-name {
  grid-column: 1 / 3;
  letter-spacing: 0;
  color: var(--fg);
  white-space: nowrap;
}

.nav-name a {
  text-decoration: none;
}

.nav-role {
  grid-column: 3 / 5;
  color: var(--fg);
}

.nav-links {
  grid-column: 7 / 12;
  display: flex;
  gap: 36px;
  align-items: center;
}

.nav-links a {
  font-family: var(--font);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--highlight);
}

.nav-dot {
  grid-column: 12 / 13;
  justify-self: end;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--highlight);
  cursor: pointer;
  transition: all 0.5s ease-in-out;
}

.nav-dot:hover {
  width: 24px;
  height: 24px;
  transition: all 0.5s ease-in-out;
  margin-top: -4px;
  margin-right: -4px;
  margin-bottom: -4px;
}

.nav-dot::before {
  content: var(--theme-toggle);
  float: right;
  margin-right: 1.5rem;
  width: 5rem;
  position: relative;
  left: -0.5rem;
  opacity: 0;
  transition: all 0.25s ease-in-out;
  padding-top: 4px;
}

.nav-dot:hover::before {
  content: var(--theme-toggle);
  float: right;
  margin-right: 2rem;
  width: 5rem;
  left: 0rem;
  opacity: 1;
  transition: all 0.25s ease-in-out;
  cursor: pointer;
}

.hero {
  padding-top: 96px;
  margin-bottom: 96px;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.hero-text {
  grid-column: 1 / 12;
  font-size: clamp(1rem, 2.6vw, var(--font-size-biggest));
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: -0.01em;
  animation: fade-up 1.5s ease 0s both;
}

.section-label {
  color: var(--fg);
  margin-bottom: 0;
}

.experience {
  margin-bottom: 96px;
  border-bottom: 1px solid var(--fg);
}

.experience-header {
  padding-top: 16px;
  padding-bottom: 16px;
}

.experience-header .section-label {
  grid-column: 1 / 13;
}

.exp-row {
  border-top: 1px solid var(--border);
  transition: background 0.12s ease;
}

.exp-row .grid {
  padding-top: 16px;
  padding-bottom: 16px;
  align-items: baseline;
}

.exp-company {
  grid-column: 1 / 3;
  color: var(--fg);
}

.exp-title {
  grid-column: 3 / 5;
  color: var(--fg);
}

.exp-year {
  grid-column: 5 / 7;
  color: var(--fg);
}

.exp-desc {
  grid-column: 7 / 13;
  color: var(--fg);
  line-height: 1.4;
  overflow: hidden;
}

.exp-row--interactive:hover {
  background: var(--bg-row);
  cursor: pointer;
}

.info-section {
  margin-bottom: 96px;
}

.info-grid {
  border-top: none;
}

.info-label {
  grid-column: 1 / 3;
}

.info-quote {
  grid-column: 3 / 7;
  font-size: clamp(16px, 1.9vw, var(--font-size-bigger));
  line-height: 1.4;
  font-weight: 400;
  padding-right: 24px;
  position: relative;
}

.info-quote::before {
  content: "\201C";
  left: -1rem;
  position: absolute;
}

.info-quote::after {
  content: "\201D";
}

.info-body {
  grid-column: 7 / 12;
  line-height: 1.6;
  color: var(--fg);
}

.info-body p + p {
  margin-top: 1rem;
}

.projects-section {
  margin-bottom: 96px;
}

.projects-label {
  grid-column: 1 / 3;
}

.projects-list {
  grid-column: 3 / 7;
  border-bottom: 1px solid var(--border);
}

.projects-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.projects-title {
  color: var(--fg);
}

.projects-link {
  color: var(--fg);
  flex-shrink: 0;
  margin-left: 16px;
}

.projects-item-link {
  text-decoration: none;
  display: block;
  transition: background 0.12s ease;
}

.projects-item-link:hover {
  background: var(--bg-row);
  cursor: pointer;
}

.contact-section {
  margin-bottom: 96px;
}

.contact-label {
  grid-column: 1 / 3;
}

.contact-links {
  grid-column: 3 / 7;
  line-height: 2;
}

.contact-links a {
  color: var(--fg);
  font-size: var(--font-size-big);
  text-decoration: none;
  display: block;
  margin-bottom: 16px;
}

.contact-links a:hover {
  color: var(--highlight);
}

.writing-section {
  margin-bottom: 96px;
}

.writing-label {
  grid-column: 1 / 3;
}

.writing-list {
  grid-column: 3 / 7;
  border-bottom: 1px solid var(--border);
}

.writing-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.writing-item:last-child {
  border-bottom: 0;
}

.writing-title {
  color: var(--fg);
}

.writing-date {
  color: var(--fg);
  flex-shrink: 0;
  margin-left: 16px;
}

.writing-item-link {
  text-decoration: none;
  display: block;
  transition: background 0.12s ease;
}

.writing-item-link:hover {
  background: var(--bg-row);
  cursor: pointer;
}

.writing-index-section {
  padding-top: 96px;
  margin-bottom: 96px;
}

.writing-index-label {
  grid-column: 1 / 3;
  padding-top: 16px;
}

.writing-index-list {
  grid-column: 3 / 7;
}

.writing-index-item {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-decoration: none;
  display: block;
  color: var(--fg);
  transition: background 0.12s ease;
}

.writing-index-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.writing-index-item-title {
  font-size: var(--font-size-big);
  transition: color 0.2s ease-in-out;
}

.writing-index-item:hover .writing-index-item-title {
  color: var(--highlight);
}

.writing-index-item-date {
  flex-shrink: 0;
  margin-left: 16px;
}

.writing-index-item-summary {
  line-height: 1.6;
  margin-bottom: 10px;
}

.article-section {
  padding-top: 96px;
  margin-bottom: 96px;
}

.article-col-label {
  grid-column: 1 / 3;
}

.article-col-label a {
  text-decoration: none;
  color: var(--fg);
}

.article-col-label a:hover {
  color: var(--highlight);
}

.article-header {
  grid-column: 3 / 10;
  margin-bottom: 0;
}

.article-date {
  margin-bottom: 2rem;
}

.article-title {
  font-size: clamp(22px, 2.6vw, var(--font-size-biggest));
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 24px;
}

.article-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 0;
}

.article-summary {
  grid-column: 3 / 10;
  font-size: clamp(16px, 1.9vw, var(--font-size-bigger));
  line-height: 1.4;
  font-weight: 400;
  margin-bottom: 48px;
}

.article-body {
  grid-column: 3 / 10;
  line-height: 1.7;
  font-size: var(--font-size-big);
  margin-bottom: 96px;
}

.article-body h1 {
  font-size: clamp(20px, 2vw, var(--font-size-biggest));
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-top: 2.5em;
  margin-bottom: 0.75em;
}

.article-body h2 {
  font-size: clamp(16px, 1.5vw, var(--font-size-bigger));
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-top: 2em;
  margin-bottom: 0.75em;
}

.article-body h3 {
  font-size: var(--font-size-big);
  font-weight: 600;
  margin-top: 1.75em;
  margin-bottom: 0.5em;
}

.article-body p {
  font-size: var(--font-size-normal);
  margin-bottom: 1.25em;
}

.article-body p:last-child {
  margin-bottom: 0;
}

.article-body ul {
  margin: 0.75em 0 1.25em 1.5em;
  list-style: disc;
}

.article-body ol {
  margin: 0.75em 0 1.25em 1.5em;
  list-style: decimal;
}

.article-body li {
  margin-bottom: 0.4em;
}

.article-body blockquote {
  border-left: 1px solid var(--fg);
  padding-left: 1rem;
  margin: 1.5rem 0;
}

.article-body blockquote p {
  font-size: var(--font-size-big);
}

.article-body code {
  font-family: var(--font);
  background: var(--bg-row);
  padding: 0.1em 0.4em;
  font-size: 0.9em;
}

.article-body pre {
  background: var(--bg-row);
  padding: 1.5em;
  margin: 1.5em 0;
  overflow-x: auto;
}

.article-body pre code {
  background: none;
  padding: 0;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

.article-body strong {
  font-weight: 600;
}

footer {
  margin-top: 80px;
  padding-bottom: 24px;
  padding-top: 24px;
  background: var(--fg);
}

footer .grid {
  align-items: center;
}

.footer-dot {
  grid-column: 1 / 2;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--bg);
}

.footer-copy {
  grid-column: 9 / 13;
  color: var(--bg);
  text-align: right;
}

#exp-popover {
  position: fixed;
  z-index: 1000;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  column-gap: 0;
  background: var(--bg);
  color: var(--fg);
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  border: 1px solid var(--fg);
  transition: all 0.5s ease-out;
  right: -2rem;
}

#exp-popover.visible {
  opacity: 1;
  transition: all 0.5s ease-in;
  right: 0;
}

#exp-popover .pop-image {
  grid-column: 1 / 4;
  overflow: hidden;
  background: var(--bg);
  min-height: 0;
  border-right: 1px solid var(--fg);
  position: relative;
}

.pop-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

#exp-popover .pop-image.empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

#exp-popover .pop-text {
  grid-column: 4 / 7;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

#exp-popover .pop-text p {
  font-family: var(--font);
  line-height: 1.6;
  color: var(--fg);
}

/* ── Mobile menu ─────────────────────── */

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 16px;
  height: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-hamburger span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--fg);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

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

#mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(-100%);
  transition: transform 0.35s ease, background 0.25s ease;
  pointer-events: none;
}

#mobile-menu.open {
  transform: translateY(0);
  pointer-events: all;
}

.mobile-menu-links {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.mobile-menu-links a {
  font-size: var(--font-size-bigger);
  text-decoration: none;
  color: var(--fg);
}

.mobile-menu-links a:hover {
  color: var(--highlight);
}

.mobile-menu-footer {
  padding-bottom: 48px;
  display: flex;
  justify-content: center;
}

#mobile-menu .nav-dot {
  grid-column: unset;
  justify-self: unset;
}

#mobile-menu .nav-dot::before,
#mobile-menu .nav-dot:hover::before {
  display: none;
}

@media (max-width: 960px) {
  :root {
    --margin: 32px;
    --gutter: 16px;
  }

  .nav-links {
    grid-column: 6 / 12;
    gap: 20px;
  }

  .nav-role {
    display: none;
  }

  .hero-text {
    grid-column: 1 / 13;
  }

  .exp-title {
    grid-column: 3 / 6;
  }

  .exp-year {
    display: none;
  }

  .exp-desc {
    grid-column: 6 / 13;
  }

  .info-quote {
    grid-column: 3 / 13;
    margin-bottom: 32px;
  }

  .info-body {
    grid-column: 3 / 13;
  }

  .contact-links {
    grid-column: 3 / 13;
  }

  .writing-list {
    grid-column: 3 / 13;
  }

  .writing-index-list {
    grid-column: 3 / 13;
  }

  .projects-list {
    grid-column: 3 / 13;
  }

  .article-header,
  .article-summary,
  .article-body {
    grid-column: 3 / 13;
  }

  .footer-copy {
    grid-column: 3 / 13;
    text-align: right;
  }
}

@media (max-width: 640px) {
  :root {
    --margin: 2rem;
    --gutter: 0.25rem;
  }

  html { font-size: 1rem; }

  * { cursor: default; }

  #cursor {
    display: none;
  }

  .grid {
    grid-template-columns: repeat(4, 1fr);
  }

  nav {
    position: relative;
    z-index: 10;
    background: var(--bg);
  }

  .nav-name { grid-column: 1 / 3; }
  .nav-role { display: none; }
  .nav-links { display: none; }
  .nav-dot { display: none; }
  #mobile-menu .nav-dot { display: block; }

  .nav-hamburger {
    display: flex;
    grid-column: 4 / 5;
    justify-self: end;
    align-self: center;
  }

  .hero-text {
    grid-column: 1 / 5;
    line-height: 1.4;
  }

  .hero {
    padding-top: 4rem;
    margin-bottom: 4rem;
  }

  .experience {
    margin-bottom: 4rem;
  }

  .exp-company { grid-column: 1 / 3; }
  .exp-title { display: none; grid-column: 1 / 5; grid-row: 2; margin-bottom: 1rem; }
  .exp-year { display: block; grid-column: 3 / 5; grid-row: 1; text-align: right; }
  .exp-desc { display: none; grid-column: 1 / 5; grid-row: 3; padding-top: 4px; padding-bottom: 4px; color: var(--fg-light); }

  .exp-row--expanded .exp-title,
  .exp-row--expanded .exp-desc {
    display: block;
  }

  .exp-row--expanded .exp-company {
    margin-bottom: 0.25rem;
  }

  .exp-row--expanded .grid {
    margin-top: 1rem;
  }

  .exp-row--expanded .exp-row-inline-summary {
    margin-bottom: 1rem;
  }

  .exp-row:hover {
    background: none;
  }

  .exp-row .grid {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .info-section {
    margin-bottom: 4rem;
  }

  .info-label { grid-column: 1 / 5; margin-bottom: 16px; }
  .info-quote { grid-column: 1 / 5; margin-bottom: 0; }
  .info-body { grid-column: 1 / 5; margin-top: 24px; }

  .contact-section {
    margin-bottom: 4rem;
  }

  .contact-label { grid-column: 1 / 5; margin-bottom: 8px; }
  .contact-links { grid-column: 1 / 5; }
  .contact-links a { margin-bottom: 0; }

  .writing-section {
    margin-bottom: 4rem;
  }

  .writing-item-link:hover {
    background: none;
  }

  .writing-label { grid-column: 1 / 5; margin-bottom: 8px; }
  .writing-list { grid-column: 1 / 5; }

  .writing-index-section { padding-top: 48px; }
  .writing-index-label { grid-column: 1 / 5; margin-bottom: 8px; }
  .writing-index-list { grid-column: 1 / 5; }

  .projects-section { margin-bottom: 4rem; }
  .projects-item-link:hover { background: none; }
  .projects-label { grid-column: 1 / 5; margin-bottom: 8px; }
  .projects-list { grid-column: 1 / 5; }

  .article-section { padding-top: 48px; }
  .article-col-label { grid-column: 1 / 5; margin-bottom: 8px; }
  .article-header,
  .article-summary,
  .article-body { grid-column: 1 / 5; margin-bottom: 0; }

  .footer-copy { grid-column: 3 / 5; }

  #exp-popover { display: none !important; }

  .exp-row--interactive { cursor: pointer; }

  .exp-row-inline-img {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  .exp-row-inline-summary {
    padding: 12px var(--margin) 16px;
    line-height: 1.5;
  }

  .exp-row-inline-summary p + p {
    margin-top: 0.75rem;
  }
}
