/* ============================================================
   Daniel Pesch — personal website
   Split-screen: white/professional (left), black/academic (right)
   ============================================================ */

:root {
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --pane-pad: clamp(2rem, 5vw, 4.5rem);
  --header-h: 9.5rem;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, Georgia, "Times New Roman", serif;
}

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

html {
  height: 100%;
}

body {
  height: 100%;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  background: #000;
}

/* ---------- identity overlay (inverts over each pane) ---------- */

.identity {
  position: fixed;
  top: 0;
  left: 0;
  width: 50%;
  z-index: 10;
  height: var(--header-h);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.6rem;
  padding: 0 var(--pane-pad);
  pointer-events: none;
  color: #fff;
  mix-blend-mode: difference;
}

/* keep the name aligned with the pane content column */
.identity__name,
.identity__tag {
  width: 100%;
  max-width: calc(34rem - 2 * var(--pane-pad));
  margin: 0 auto;
}

.identity__name {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  letter-spacing: 0.02em;
  line-height: 1;
}

.identity__tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.42em;
  opacity: 0.75;
}

/* ---------- panes ---------- */

.panes {
  display: flex;
  height: 100dvh;
}

.pane {
  flex: 1 1 50%;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
}

.pane--pro {
  background: #fff;
  color: #0a0a0a;
  --line: rgba(0, 0, 0, 0.14);
  --muted: rgba(0, 0, 0, 0.52);
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

.pane--acad {
  background: #000;
  color: #f5f5f5;
  --line: rgba(255, 255, 255, 0.18);
  --muted: rgba(255, 255, 255, 0.55);
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.pane__inner {
  max-width: 34rem;
  margin: 0 auto;
  padding: calc(var(--header-h) + 1.5rem) var(--pane-pad) 3rem;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.pane__kicker {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.pane__intro {
  font-size: 1.05rem;
  line-height: 1.65;
  margin-bottom: 2.8rem;
}

.pane__heading {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.pane__heading:not(:first-of-type) {
  margin-top: 2.6rem;
}

.pane__note {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
  padding-top: 0.8rem;
  padding-bottom: 0.4rem;
}

/* ---------- accordion items ---------- */

.items {
  display: flex;
  flex-direction: column;
}

.item {
  border-bottom: 1px solid var(--line);
}

.item summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title icon"
    "meta  icon";
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.2rem;
  padding: 1.05rem 0;
  -webkit-tap-highlight-color: transparent;
}

.item summary::-webkit-details-marker {
  display: none;
}

.item__title {
  grid-area: title;
  font-size: 0.98rem;
  font-weight: 550;
  line-height: 1.35;
}

.item__meta {
  grid-area: meta;
  font-size: 0.78rem;
  color: var(--muted);
}

/* plus icon that rotates into a minus-ish x */
.item__icon {
  grid-area: icon;
  position: relative;
  width: 0.85rem;
  height: 0.85rem;
  flex: none;
  transition: transform 0.35s var(--ease);
}

.item__icon::before,
.item__icon::after {
  content: "";
  position: absolute;
  background: currentColor;
  opacity: 0.6;
}

.item__icon::before {
  left: 0;
  right: 0;
  top: calc(50% - 0.5px);
  height: 1px;
}

.item__icon::after {
  top: 0;
  bottom: 0;
  left: calc(50% - 0.5px);
  width: 1px;
}

.item.is-open .item__icon {
  transform: rotate(135deg);
}

/* animated reveal via grid-rows trick */
.item__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease), opacity 0.4s var(--ease);
  opacity: 0;
}

.item.is-open .item__body {
  grid-template-rows: 1fr;
  opacity: 1;
}

.item__content {
  overflow: hidden;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--muted);
}

.item__content > p,
.item__content > ul {
  padding-bottom: 1.2rem;
}

.item__content ul {
  list-style: none;
}

.item__content li {
  padding-left: 1.1rem;
  position: relative;
}

.item__content li + li {
  margin-top: 0.35rem;
}

.item__content li::before {
  content: "—";
  position: absolute;
  left: 0;
  opacity: 0.5;
}

/* ---------- pane footer ---------- */

.pane__footer {
  margin-top: auto;
  padding-top: 4rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.pane__footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color 0.2s, border-color 0.2s;
}

.pane__footer a:hover {
  color: currentColor;
  border-color: currentColor;
}

.pane__footer-links {
  display: flex;
  gap: 1.1rem;
}

/* ---------- mobile switcher (hidden on desktop) ---------- */

.switcher {
  display: none;
}

/* ============================================================
   Mobile: one pane at a time + bottom toggle
   ============================================================ */

@media (max-width: 800px) {
  :root {
    --header-h: 7rem;
  }

  .identity {
    width: 100%;
  }

  .panes {
    display: block;
  }

  .pane {
    position: fixed;
    inset: 0;
    transition: opacity 0.35s var(--ease), visibility 0.35s;
  }

  .pane__inner {
    padding-bottom: 7.5rem; /* room for the switcher */
  }

  body[data-active="pro"] .pane--acad,
  body[data-active="acad"] .pane--pro {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .switcher {
    position: fixed;
    bottom: max(1.2rem, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: min(20rem, calc(100vw - 3rem));
    padding: 0.3rem;
    border-radius: 999px;
    background: rgba(128, 128, 128, 0.22);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(128, 128, 128, 0.35);
  }

  .switcher__btn {
    position: relative;
    z-index: 2;
    appearance: none;
    background: none;
    border: 0;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 550;
    letter-spacing: 0.04em;
    padding: 0.65rem 0;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.3s var(--ease);
    -webkit-tap-highlight-color: transparent;
  }

  .switcher__thumb {
    position: absolute;
    z-index: 1;
    top: 0.3rem;
    bottom: 0.3rem;
    left: 0.3rem;
    width: calc(50% - 0.3rem);
    border-radius: 999px;
    transition: transform 0.35s var(--ease), background 0.35s var(--ease);
  }

  /* thumb + text colors adapt to whichever pane is active */
  body[data-active="pro"] .switcher__thumb {
    background: #0a0a0a;
    transform: translateX(0);
  }

  body[data-active="acad"] .switcher__thumb {
    background: #fff;
    transform: translateX(100%);
  }

  body[data-active="pro"] .switcher__btn { color: #0a0a0a; }
  body[data-active="pro"] .switcher__btn[data-pane="pro"] { color: #fff; }

  body[data-active="acad"] .switcher__btn { color: #fff; }
  body[data-active="acad"] .switcher__btn[data-pane="acad"] { color: #0a0a0a; }
}

/* ============================================================
   Legal / privacy pages
   ============================================================ */

body.page {
  overflow: auto;
  background: #fff;
  color: #0a0a0a;
  --line: rgba(0, 0, 0, 0.14);
  --muted: rgba(0, 0, 0, 0.52);
}

.page__inner {
  max-width: 40rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) var(--pane-pad) 3rem;
  line-height: 1.7;
}

.page__back {
  display: inline-block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 3rem;
  transition: color 0.2s;
}

.page__back:hover {
  color: #0a0a0a;
}

.page__inner h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 2.6rem);
  margin-bottom: 0.4rem;
}

.page__updated {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.page__inner h2 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: var(--muted);
  margin: 2.2rem 0 0.7rem;
}

.page__inner p {
  font-size: 0.92rem;
  margin-bottom: 0.9rem;
}

.page__inner a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
}

.page__inner a:hover {
  text-decoration-color: currentColor;
}

.page__footer {
  margin-top: 4.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
  }
}
