/* ============================================================
   marcoschierhorn.de — site styles
   (depends on colors_and_type.css for tokens)
   ============================================================ */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

::selection { background: var(--yellow-soft); color: var(--text); }

/* ---- Layout helpers ---- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: clamp(1.4rem, 5vw, 4rem);
}

.section {
  padding-block: var(--space-section);
}

.section--alt { background: var(--bg-alt); }

.measure { max-width: var(--maxw-read); }

/* ---- Eyebrow with accent tick ---- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: var(--w-semibold);
  font-size: var(--t-eyebrow);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.6rem;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--yellow);
}

/* ---- Type utilities ---- */
.display {
  font-weight: var(--w-extra);
  font-size: var(--t-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--track-tight);
  margin: 0;
  text-wrap: balance;
}
.h1 {
  font-weight: var(--w-bold);
  font-size: var(--t-h1);
  line-height: var(--lh-snug);
  letter-spacing: var(--track-tight);
  margin: 0;
  text-wrap: balance;
}
.h3 {
  font-weight: var(--w-bold);
  font-size: var(--t-h3);
  line-height: 1.3;
  margin: 0;
}
.lead {
  font-weight: var(--w-medium);
  font-size: var(--t-lead);
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
  text-wrap: pretty;
}
.body {
  font-weight: var(--w-regular);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  color: var(--text);
  text-wrap: pretty;
}
.body strong { font-weight: var(--w-semibold); color: var(--text); }
.ink-yellow { color: #B97E16; } /* accessible amber for inline emphasis on light */

/* ---- Buttons ---- */
.btn {
  --bg-btn: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font);
  font-weight: var(--w-semibold);
  font-size: 1rem;
  letter-spacing: 0.01em;
  padding: 0.95rem 1.6rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--bg-btn);
  background: var(--bg-btn);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur) var(--ease), transform 0.18s var(--ease), border-color var(--dur) var(--ease);
}
.btn:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn:active { transform: translateY(1px); }
.btn .arrow { transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.btn--ghost {
  background: transparent;
  color: var(--blue);
}
.btn--ghost:hover { background: var(--blue); color: #fff; }

/* ---- Text link with animated underline ---- */
.tlink {
  color: var(--blue);
  text-decoration: none;
  font-weight: var(--w-semibold);
  background-image: linear-gradient(var(--yellow), var(--yellow));
  background-size: 100% 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 2px;
  transition: background-size 0.3s var(--ease), color 0.3s var(--ease);
}
.tlink:hover { color: var(--blue-deep); background-size: 100% 100%; background-image: linear-gradient(var(--yellow-soft), var(--yellow-soft)); }

/* ---- Scroll reveal ----
   Opacity-only fade, NO transform / will-change (the DOM-to-image capture used
   by previews renders composited layers as blank). Visible by default; the
   hidden start-state only applies in a painting context (html.js-anim), and a
   JS "settle" pass locks each element to a static opacity:1 so nothing can be
   caught mid-transition. */
.reveal { transition: opacity 0.7s var(--ease); }

@media (prefers-reduced-motion: no-preference) {
  html.js-anim .reveal:not(.is-in):not(.is-settled) { opacity: 0; }
}

.reveal.is-settled { opacity: 1; transition: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

code {
  font-family: ui-monospace, "SFMono-Regular", "Menlo", monospace;
  font-size: 0.92em;
  color: var(--blue);
  background: var(--blue-tint);
  padding: 0.05em 0.34em;
  border-radius: 3px;
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0);
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav--scrolled {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom-color: var(--hairline);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}
.nav__mark { text-decoration: none; }
.nav__name {
  font-weight: var(--w-bold);
  font-size: 1.06rem;
  letter-spacing: -0.01em;
  color: var(--text);
  position: relative;
  padding-bottom: 2px;
}
.nav__name::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 22px; height: 2px;
  background: var(--yellow);
}
.nav__links { display: flex; gap: clamp(1rem, 2.4vw, 2.2rem); }
.nav__link {
  font-size: 0.92rem;
  font-weight: var(--w-medium);
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}
.nav__link:hover { color: var(--blue); }
@media (max-width: 720px) { .nav__links { display: none; } }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-block: clamp(3.5rem, 9vw, 7rem) var(--space-section); }
.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: center;
}
.hero__headline { margin-top: 0.2rem; }
.hero__accentword { color: var(--blue); }
.hero__sub { margin-top: 1.6rem; max-width: 38ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2.4rem; }

.hero__aside { display: flex; flex-direction: column; gap: 1rem; }
.hero__portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.hero__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  display: block;
}
.hero__portrait::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--yellow);
}
.hero__portrait-note {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero__caption { font-size: 0.92rem; color: var(--muted); line-height: 1.5; margin: 0; }
@media (max-width: 880px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__aside { max-width: 320px; }
}

/* ============================================================
   POINT OF VIEW
   ============================================================ */
.pov__title { margin: 0 0 clamp(2.6rem, 6vw, 4.4rem); color: var(--blue); }
.pov__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(2rem, 4vw, 3.4rem);
}
.pov__item { position: relative; padding-top: 1.6rem; border-top: 1px solid var(--hairline); }
.pov__num {
  position: absolute;
  top: 1.4rem; right: 0;
  font-size: 0.82rem;
  font-weight: var(--w-bold);
  letter-spacing: 0.1em;
  color: var(--yellow);
}
.pov__lead { color: var(--text); margin-bottom: 0.9rem; max-width: 18ch; }
@media (max-width: 880px) { .pov__grid { grid-template-columns: 1fr; gap: 2.4rem; } }

/* ============================================================
   SELECTED WORK
   ============================================================ */
.work__title { margin: 0 0 clamp(2.6rem, 6vw, 4rem); }
.work__grid { display: grid; gap: 1.6rem; }
.work__card {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: clamp(1.6rem, 3vw, 2.6rem);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr) minmax(0, 0.7fr);
  gap: clamp(1.2rem, 3vw, 2.6rem);
  align-items: start;
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease), border-color 0.4s var(--ease);
}
.work__card:hover {
  box-shadow: 0 18px 50px -28px rgba(23, 79, 120, 0.32);
  transform: translateY(-3px);
  border-color: #d4dae1;
}
.work__tag { color: var(--blue); margin-bottom: 0.5rem; }
.work__meta { font-size: 0.86rem; color: var(--muted); line-height: 1.45; margin: 0; }
.work__body { margin: 0; }
.work__result {
  font-weight: var(--w-semibold);
  font-size: 0.96rem;
  color: var(--text);
  line-height: 1.5;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.work__resulttick { width: 34px; height: 3px; background: var(--yellow); }
@media (max-width: 860px) {
  .work__card { grid-template-columns: 1fr; gap: 1.1rem; }
  .work__result { flex-direction: row; align-items: center; }
}

/* ============================================================
   HOW I WORK
   ============================================================ */
.how__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.4rem, 6vw, 5rem);
  align-items: start;
}
.how__blurb { margin-top: 1.6rem; }
.how__notes { display: grid; gap: 1.8rem; }
.how__note { padding-left: 1.4rem; border-left: 2px solid var(--yellow); }
.how__k { color: var(--blue); margin-bottom: 0.5rem; }
.how__v { margin: 0; }
@media (max-width: 880px) { .how__inner { grid-template-columns: 1fr; } }

/* ============================================================
   ASK MY AI
   ============================================================ */
.ai__panel {
  background: var(--blue);
  border-radius: var(--radius-md);
  padding: clamp(2.2rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  position: relative;
  overflow: hidden;
}
.ai__panel::before {
  content: "";
  position: absolute;
  left: clamp(2.2rem, 5vw, 4rem); top: 0;
  width: 48px; height: 4px;
  background: var(--yellow);
}
.ai__eyebrow { color: #BFD3E4; }
.ai__eyebrow::before { background: var(--yellow); }
.ai__title { color: #fff; }
.ai__body { color: var(--fg-on-blue); margin: 1.4rem 0 2rem; max-width: 46ch; }
.ai__btn { background: var(--yellow); border-color: var(--yellow); color: #3A2A07; }
.ai__btn:hover { background: #F6AC3D; border-color: #F6AC3D; }

.ai__chat {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.ai__bubble {
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 0.7rem 0.95rem;
  border-radius: 12px;
  max-width: 90%;
}
.ai__bubble--in { background: rgba(255,255,255,0.12); color: #EAF1F7; align-self: flex-start; border-bottom-left-radius: 3px; }
.ai__bubble--out { background: var(--yellow); color: #3A2A07; align-self: flex-end; border-bottom-right-radius: 3px; font-weight: var(--w-medium); }
.ai__dots { display: flex; gap: 5px; padding: 0.3rem 0.4rem; align-self: flex-start; }
.ai__dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.5);
  animation: aiblink 1.3s var(--ease) infinite;
}
.ai__dots span:nth-child(2) { animation-delay: 0.18s; }
.ai__dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes aiblink { 0%, 60%, 100% { opacity: 0.35; } 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ai__dots span { animation: none; } }
@media (max-width: 820px) { .ai__panel { grid-template-columns: 1fr; } }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--hairline); padding-block: clamp(2.6rem, 6vw, 4.2rem) 2rem; }
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer__name { font-weight: var(--w-bold); font-size: 1.1rem; margin: 0 0 0.4rem; }
.footer__note { color: var(--muted); font-size: 0.95rem; max-width: 34ch; margin: 0; line-height: 1.5; }
.footer__links { display: flex; gap: 1.6rem; }
.footer__base {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.84rem;
  color: var(--muted);
}
