/* ─── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* ─── Variables ──────────────────────────────────── */
:root {
  --bg:        #ffffff;
  --text:      #000000;
  --accent:    #2563eb;
  --font:      "Taipei Sans TC", "Helvetica Neue", Arial, sans-serif;
  --pad-x:     2rem;
  --sidebar-w: 273px;
}

/* ─── Base ───────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}


body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
}

::selection { background: transparent; color: var(--accent); }

a { color: inherit; text-decoration: none; touch-action: manipulation; }
a:hover { color: var(--accent); }
button { touch-action: manipulation; }
img { display: block; max-width: 100%; }
strong { font-weight: inherit; }
h1, h2, h3, h4 { font-size: inherit; font-weight: inherit; }

/* ─── Layout ─────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  align-items: start;
}

/* ─── Sidebar ────────────────────────────────────── */
.site-sidebar {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.5rem;
}

.sidebar-logo {
  display: block;
  margin-bottom: 1rem;
}

.sidebar-project-nav {
  display: flex;
  flex-direction: column;
}

.sidebar-nav-item {
  line-height: 1.4;
  padding: 0.28rem 0;
  display: block;
  transition: color 0.15s;
}

.sidebar-nav-item.active { color: var(--accent); }

.sidebar-about-link {
  display: block;
  padding: 0.28rem 0;
  margin-bottom: 1.5rem;
  transition: color 0.15s;
}

.sidebar-about-link.active { color: var(--accent); }

.sidebar-bottom {
  padding-top: 1rem;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* ─── Mobile header ──────────────────────────────── */
.mobile-header { display: none; }

/* ─── Hero ───────────────────────────────────────── */
.hero { display: none; }
.hero.visible { display: block; }

.hero-text-wrap {
  padding: 1.5rem var(--pad-x) 2rem 0;
}

.hero h1 {
  line-height: 1.45;
  margin-bottom: 0.3rem;
  max-width: 68ch;
  font-weight: 700;
}

.hero-subtitle {
  font-weight: 700;
  margin-bottom: 2rem;
  max-width: 68ch;
}

.hero-text {
  line-height: 1.7;
  max-width: 68ch;
}

.hero-text p + p { margin-top: 0.75rem; }

.hero-quotes { margin-top: 2rem; }
.hero-quote + .hero-quote { margin-top: 1rem; }
.hero-quote p { font-style: italic; }
.hero-quote cite { display: block; margin-top: 0.2rem; font-style: normal; }
.link-accent { color: var(--accent); }

.hero-image {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 3rem;
}

.hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ─── Projects ───────────────────────────────────── */
.project { display: none; }
.project.visible { display: block; }

.project-info {
  padding: 1.5rem var(--pad-x) 3rem var(--pad-x);
}

.project-title { display: none; }

.project-desc {
  line-height: 1.7;
  max-width: 68ch;
}

.project-meta {
  margin-top: 1.5rem;
  max-width: 68ch;
}

.project-images {
  padding-bottom: 5rem;
  padding-left: var(--pad-x);
}

.project-images img {
  display: block;
  width: auto;
  height: auto;
  max-height: 108vh;
  max-width: 81vh;
}

.project-images img.portrait {
  height: 108vh;
  width: auto;
  max-height: none;
  max-width: none;
}

.project-images img + img { margin-top: 4rem; }

/* ─── About ──────────────────────────────────────── */
.about-section { display: none; padding: 1.5rem var(--pad-x) 5rem; }
.about-section.visible { display: block; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 2rem;
}

.about-portrait {
  width: 220px;
  height: 220px;
  object-fit: cover;
  margin-bottom: 1.5rem;
}

.about-prose {
  max-width: 68ch;
  line-height: 1.7;
}

.about-prose p + p { margin-top: 1.5rem; }

.about-list {
  list-style: none;
  margin-top: 0.5rem;
  line-height: 1.7;
}

.about-list li + li { margin-top: 0.25rem; }

.about-prose strong { font-weight: 700; }

.about-quote { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.about-quote p { font-style: italic; }
.about-quote cite { display: block; margin-top: 0.2rem; font-style: normal; }

/* ─── Kontakt ────────────────────────────────────── */
.kontakt-section { display: none; padding: 3rem var(--pad-x) 5rem; }
.kontakt-section.visible { display: block; }

.kontakt-text {
  max-width: 68ch;
  margin-top: 2rem;
  line-height: 1.7;
}

/* ─── Scroll to top ──────────────────────────────── */
.scroll-top {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 28px;
  color: var(--accent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 200;
  line-height: 1;
  padding: 0;
}

.scroll-top.visible { opacity: 1; pointer-events: auto; }

/* ─── Footer ─────────────────────────────────────── */
.footer {
  padding: 2rem var(--pad-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ─── Impressum (single.html) ────────────────────── */
.page-nav {
  padding: 1.1rem var(--pad-x);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-nav nav { display: flex; gap: 2rem; }

.impressum { padding: 1.5rem var(--pad-x) 6rem; max-width: 720px; }

.imp-block { padding: 1.5rem 0; }
.imp-label { margin-bottom: 0.75rem; }

.imp-block p { max-width: 52ch; line-height: 1.45; }
.imp-block p + p { margin-top: 0.75rem; }

.imp-table { border-collapse: collapse; }
.imp-table td { padding: 0.2rem 0; vertical-align: top; }
.imp-table td:first-child { width: 14rem; }
.imp-table a { text-decoration: underline; text-underline-offset: 3px; }

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
  .layout { display: block; }

  .site-sidebar { display: none; }

  .mobile-header {
    display: block;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
  }

  .mobile-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem var(--pad-x);
  }

  .mobile-page-title {
    font-weight: 700;
  }

  .mobile-nav-toggle {
    font-weight: 700;
    font-family: var(--font);
    font-size: inherit;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    padding: 0;
  }

  .mobile-nav {
    display: none;
    flex-direction: column;
    padding: 0.5rem var(--pad-x) 1rem;
    border-top: 1px solid currentColor;
  }

  .mobile-nav.open { display: flex; }

  .mobile-nav-link {
    display: block;
    padding: 0.28rem 0;
    line-height: 1.4;
  }

  .mobile-nav-link--sep { margin-top: 0.75rem; }
  .mobile-nav-link--sep-below { margin-bottom: 0.75rem; }

  .hero-image { grid-template-columns: 1fr; }


  .project-images { padding-left: var(--pad-x); padding-right: var(--pad-x); }
  .project-images img { width: 100%; height: auto; }
  .project-images img.portrait { width: 100%; height: auto; }
  .project-images img + img { margin-top: 2rem; }

  .project-info {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .project-title { padding-left: 0; }

  .hero-text-wrap { padding-left: var(--pad-x); padding-right: var(--pad-x); }
  .hero-image { padding-left: var(--pad-x); padding-right: var(--pad-x); }

  .scroll-top {
    top: auto;
    left: auto;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .footer { flex-direction: column; align-items: flex-start; gap: 0.4rem; }

  :root { --pad-x: 1.25rem; }
}
