/* piastettler.ch — single stylesheet, no build step */


/* ─── DESIGN TOKENS ─────────────────────────────────────────────────────────
   Everything that controls the look lives in this block.
   Swap the five color slots with any palette from realtimecolors.com.
   The two derived slots (--text-muted, --border) follow automatically. */

:root {
  /* Colors — five slots, realtimecolors-compatible */
  --text:       #1A1916;
  --background: #F7F5F2;
  --primary:    #2D5F4F;
  --secondary:  #C8B89A;
  --accent:     #2D5F4F;

  /* Derived. Override these directly if your palette needs custom tones. */
  --text-muted: color-mix(in srgb, var(--text) 56%, var(--background));
  --border:     color-mix(in srgb, var(--text) 13%, var(--background));

  /* Typography. System stacks — no external font requests. */
  --font-serif: 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua',
                Palatino, 'Hoefler Text', Constantia, Georgia, serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI',
                system-ui, 'Helvetica Neue', Arial, sans-serif;

  /* Layout */
  --content-max: 880px;
  --legal-max:   640px;
}


/* ─── RESET ─────────────────────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--background);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ─── SKIP LINK — keyboard users land here first ─────────────────────────── */

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  padding: 0.7rem 1.2rem;
  background: var(--text);
  color: var(--background);
  text-decoration: none;
  font-size: 0.85rem;
  border-radius: 2px;
  z-index: 1000;
  transition: top 0.15s;
}
.skip-link:focus { top: 1rem; }


/* ─── HEADER ─────────────────────────────────────────────────────────────── */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--text);
}

.lang-switch {
  display: flex;
  gap: 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lang-switch a {
  /* Generous padding so finger-tapping isn't a sniper game */
  padding: 0.5rem 0.7rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.lang-switch a[aria-current="page"] { color: var(--text); }
.lang-switch a:hover                { color: var(--primary); }


/* ─── LAYOUT ─────────────────────────────────────────────────────────────── */

main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--border);
}

section:last-of-type { border-bottom: none; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 2rem;
}


/* ─── HERO ───────────────────────────────────────────────────────────────── */

.hero {
  padding: 4rem 0 6rem;
  border-bottom: 1px solid var(--border);
}

.hero-meta {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 2rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 5.5rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
}

/* Three words, staggered in. Middle one gets the italic + color accent. */
.hero h1 span {
  display: block;
  opacity: 0;
  animation: rise 0.9s cubic-bezier(.22,1,.36,1) forwards;
}
.hero h1 span:nth-child(1) { animation-delay: 0.10s; }
.hero h1 span:nth-child(2) {
  animation-delay: 0.30s;
  font-style: italic;
  color: var(--primary);
}
.hero h1 span:nth-child(3) { animation-delay: 0.50s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-lead {
  font-size: 1.12rem;
  color: var(--text-muted);
  max-width: 42ch;
  margin-bottom: 2.5rem;
  line-height: 1.55;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.9rem;
  background: var(--primary);
  color: var(--background);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: background 0.2s, transform 0.2s;
}

.btn:hover {
  background: color-mix(in srgb, var(--primary) 85%, var(--text));
  transform: translateY(-1px);
}


/* ─── SERVICES ───────────────────────────────────────────────────────────── */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
}

.services-grid article h3 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 400;
  margin-bottom: 0.8rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.services-grid article p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}


/* ─── ABOUT ──────────────────────────────────────────────────────────────── */

.about-lead {
  font-size: 1.1rem;
  max-width: 62ch;
}


/* ─── PUBLICATIONS ───────────────────────────────────────────────────────── */

.pubs { list-style: none; }

.pubs li            { border-top: 1px solid var(--border); }
.pubs li:last-child { border-bottom: 1px solid var(--border); }

.pubs a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.3rem 0;
  text-decoration: none;
  color: var(--text);
  gap: 2rem;
  transition: color 0.15s, padding-left 0.2s;
}

.pubs a:hover {
  color: var(--primary);
  padding-left: 0.4rem;
}

.pub-authors {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-style: italic;
}

.pub-journal {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-align: right;
  white-space: nowrap;
}


/* ─── CONTACT ────────────────────────────────────────────────────────────── */

.contact-lead {
  font-size: 1.1rem;
  max-width: 52ch;
  margin-bottom: 2rem;
  color: var(--text-muted);
}

.contact-email {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
}

.contact-email a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid var(--primary);
  transition: opacity 0.15s;
}

.contact-email a:hover { opacity: 0.65; }


/* ─── FOOTER ─────────────────────────────────────────────────────────────── */

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links { display: flex; gap: 1.5rem; }

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--primary); }


/* ─── LEGAL PAGES (impressum / datenschutz) ──────────────────────────────── */

.legal {
  max-width: var(--legal-max);
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

.legal h1 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 400;
  margin-bottom: 2rem;
  letter-spacing: -0.01em;
}

.legal h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
}

.legal p,
.legal address {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-style: normal;
}

.legal a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.legal a:hover { border-bottom-color: var(--primary); }

.legal .back {
  display: inline-block;
  margin-top: 3rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.legal .back:hover { color: var(--primary); border-bottom-color: var(--primary); }


/* ─── A11Y: focus, selection, motion, high-contrast ──────────────────────── */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--primary);
  color: var(--background);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero h1 span { opacity: 1; transform: none; }
}

/* Windows High Contrast / forced-colors. Let the OS pick colors,
   we just keep structure intact. */
@media (forced-colors: active) {
  .btn                                 { border: 1px solid CanvasText; }
  .lang-switch a[aria-current="page"]  { text-decoration: underline; }
}


/* ─── RESPONSIVE ─────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .services-grid { grid-template-columns: 1fr; gap: 2.2rem; }

  .pubs a {
    flex-direction: column;
    gap: 0.3rem;
    align-items: flex-start;
  }
  .pub-journal { text-align: left; }

  header  { padding: 1.2rem 1.2rem; }
  main    { padding: 0 1.5rem; }
  section { padding: 3.5rem 0; }

  footer {
    padding: 2rem 1.5rem 3rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .hero { padding: 3rem 0 4rem; }
}
