/* =====================================================================
   Leonie Friedrich — Architecture Portfolio
   Modus Fōrma–inspired split layout · white ground · orange accent
  Styling guide: change shared colors/spacing in TOKENS first. The section
  headings below match the main page areas. Responsive rules are near the
  footer; project and legal windows have their own styles near the end.
   ===================================================================== */

/* ---------- TOKENS ---------- */
/* Shared design settings. Change these values to update the whole site at once:
  --paper is the background, --ink the main text, --accent the orange highlight,
  --edge the page-edge spacing, and --ease the common animation curve. */
:root {
  --paper: #ffffff;
  --paper-2: #f4f3f1;
  --ink: #111111;
  --ink-soft: #2c2c2c;
  --muted: #8a8a85;
  --rule: rgba(17, 17, 17, 0.14);
  --accent: #ff5a1e;            /* orange signal */
  --accent-ink: #ffffff;

  --sans: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;

  --max: 1680px;
  --gutter: clamp(20px, 3vw, 48px);
  --edge: clamp(12px, 1.4vw, 22px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --topbar-h: 46px;
}

/* ---------- RESET ---------- */
/* These defaults apply everywhere. In particular, the reset removes default
  margins and list bullets, so spacing or bullets must be added in the sections
  below where they are needed. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- SCROLL PROGRESS ---------- */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px; width: 0;
  background: var(--accent);
  z-index: 1000;
}

/* ---------- CUSTOM CURSOR ---------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.35s var(--ease), height 0.35s var(--ease),
              background 0.35s var(--ease), opacity 0.35s var(--ease);
  opacity: 0;
  display: grid;
  place-items: center;
}
.cursor.is-active { opacity: 1; }
.cursor.is-hover {
  width: 64px; height: 64px;
  background: rgba(255, 90, 30, 0.08);
  border: 1.5px solid var(--accent);
  backdrop-filter: saturate(1.2);
}
.cursor__label {
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.cursor.is-hover .cursor__label { opacity: 1; }
@media (hover: none) { .cursor { display: none; } }

/* ---------- FLOATING PREVIEW ---------- */
.preview {
  position: fixed;
  top: 0; left: 0;
  width: clamp(240px, 26vw, 420px);
  aspect-ratio: 4 / 3;
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.96);
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
  overflow: hidden;
}
.preview.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.preview__img {
  width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
}
@media (hover: none) { .preview { display: none; } }

/* ---------- TOP BAR ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--edge);
  background: var(--paper);
}
.topbar__brand {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-right: 12px;
}
.topbar__nav { display: flex; align-items: baseline; gap: 24px; }
.topbar__nav a {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
  transition: color 0.3s var(--ease);
}
.topbar__nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width 0.35s var(--ease);
}
.topbar__nav a:hover { color: var(--ink); }
.topbar__nav a:hover::after { width: 100%; }
.topbar__brand::after { display: none; }
.topbar__clock {
  margin-left: auto;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.topbar__menu { display: none; flex-direction: column; gap: 5px; width: 26px; }
.topbar__menu span { height: 1.5px; background: var(--ink); transition: transform 0.3s var(--ease); }

/* ---------- MOBILE MENU ---------- */
.menu-panel {
  position: fixed;
  inset: 0;
  z-index: 790;
  background: var(--paper);
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
}
.menu-panel.is-open { opacity: 1; visibility: visible; }
.menu-panel__nav { display: grid; gap: 8px; text-align: center; }
.menu-panel__nav a {
  font-size: clamp(2rem, 9vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  position: relative;
}
.menu-panel__nav a span {
  font-size: 0.8rem;
  vertical-align: super;
  color: var(--accent);
  margin-left: 6px;
}

/* ---------- HERO NAME BANNER ---------- */
.banner {
  width: 100%;
  margin: 0;
  padding: calc(var(--topbar-h) + 4px) var(--edge) clamp(20px, 3vw, 40px);
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 10;
  will-change: opacity;
}
.banner__name {
  font-weight: 800;
  font-size: 16rem;
  line-height: 0.9;
  letter-spacing: -0.04em;
  white-space: nowrap;
  display: inline-block;
}
.banner__sub {
  margin-top: 0.4em;
  font-size: clamp(0.8rem, 1.1vw, 1rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- SPLIT LAYOUT ---------- */
/* The work and info columns sit side-by-side on large screens. The responsive
  rule near the footer changes this to one column on narrower screens. */
.split {
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: 3fr 1fr;
}
.col { padding: 8px var(--edge) clamp(40px, 5vw, 90px); }

/* Both columns scroll together as one page */
.col--work {
  display: flex;
  flex-direction: column;
}
.col--info { min-width: 0; }

/* ---------- COLUMN HEAD ---------- */
.col__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 22px;
  margin-bottom: 8px;
}
.col__label {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.col__count { font-size: 0.72rem; letter-spacing: 0.1em; color: var(--accent); }

/* ---------- WORK GALLERY ---------- */
/* JavaScript creates each .work-item/.work-photo from PROJECTS in main.js.
  Edit the project data there to change the images and captions. These rules
  control their appearance only. */
.worklist { flex: 1; }

.work-item { margin-bottom: clamp(28px, 4vw, 64px); }

.work-photo {
  width: 100%;
  max-width: 50vw;
  display: block;
  margin: 0 auto 0 0;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
}
.work-photo__frame {
  display: block;
  width: 100%;
  aspect-ratio: auto !important;
  overflow: hidden;
  background: var(--paper-2);
}
.work-photo__img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  transition: transform 0.6s var(--ease), filter 0.4s var(--ease);
}
.work-photo:hover .work-photo__img { transform: scale(1.03); }
.work-photo__caption {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  margin-top: 6px;
}
.work-photo__title {
  font-size: clamp(0.75rem, 0.9vw, 0.9rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  transition: color 0.3s var(--ease);
}
.work-photo:hover .work-photo__title { color: var(--accent); }
.work-photo__meta {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- INFO SECTIONS (right) ---------- */
.info { padding: clamp(30px, 4vw, 56px) 0; }
.info:first-child { padding-top: 0; }
.info__head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 22px;
  margin-bottom: 28px;
}
.info__num { font-size: 0.72rem; color: var(--accent); letter-spacing: 0.1em; }
.info__label {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.info__body { max-width: 58ch; }
.info__lead {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin-bottom: 24px;
}
.info__body p + p { margin-top: 1em; color: var(--ink-soft); }

/* About: no header, justified, bold, smaller */
.info__body--about { font-weight: 700; text-align: justify; hyphens: auto; }
.info__body--about .info__lead {
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.4;
  letter-spacing: -0.005em;
  margin-bottom: 16px;
}
.info__body--about p { font-size: 1rem; line-height: 1.3; }
.info__body--about p + p { color: var(--ink); }

/* Portrait */
#portrait { padding: 0; }
.info__body--portrait { max-width: none; }
.portrait__img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}
.portrait__caption {
  margin-top: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

/* ---------- CV ---------- */

.cv__group {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  margin: 32px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--ink);
}
.cv__group:first-child { margin-top: 0; }
.cv__item {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 18px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.cv__list .cv__item:last-child { border-bottom: 0; }
.cv__role { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em; }
.cv__org { grid-column: 1; font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.cv__time { grid-column: 2; grid-row: 1; font-size: 0.75rem; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; }
.cv__tags { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.cv__tags li {
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.cv__tags li:not(:last-child)::after { content: ","; }

.cv__skills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 28px;
}
.cv__skills li {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.cv__list--tight .cv__item { padding: 8px 0; }

/* ---------- CONTACT ---------- */
/* Contact text and links are edited in index.html. Footer legal buttons open
  native dialogs; their content is also in index.html. */
.pagefoot {
  width: 100%;
  padding: clamp(40px, 6vw, 90px) var(--edge) clamp(24px, 3vw, 48px);
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
}
.pagefoot .info__body { max-width: none; }
.pagefoot .info__lead { color: var(--ink); }
.contact__list {
  margin-top: clamp(24px, 4vw, 48px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
}
.contact__row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  padding: 24px 0 0;
}
.contact__key {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(17, 17, 17, 0.7);
}
.contact__val {
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  letter-spacing: -0.01em;
  position: relative;
  width: fit-content;
  color: var(--ink);
}
a.contact__val::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1.5px;
  background: var(--ink);
  transition: width 0.35s var(--ease);
}
a.contact__val:hover { color: var(--ink); }
a.contact__val:hover::after { width: 100%; }

.info__foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  padding-top: 22px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(17, 17, 17, 0.7);
}
.info__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.info__legal button {
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  transition: color 0.3s var(--ease);
}
.info__legal button:hover,
.info__legal button:focus-visible,
.info__top:hover,
.info__top:focus-visible { color: var(--ink); }
.info__top { margin-left: auto; transition: color 0.3s var(--ease); }

/* ---------- RESPONSIVE ---------- */
/* These width checks tune the layout for tablets/smaller screens. At 900px the
  two columns become one; at 520px the footer can wrap to avoid crowding. If you
  change these thresholds, test both a phone-sized and desktop-sized browser. */
@media (max-width: 900px) {
  .topbar__nav a:not(.topbar__brand) { display: none; }
  .topbar__clock { display: none; }
  .topbar__menu { display: flex; }
  .split { grid-template-columns: 1fr; }
  .col--work {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }
  .worklist { overflow: visible; }
}
@media (max-width: 520px) {
  .work-item__btn { grid-template-columns: 30px 1fr; }
  .work-item__year { display: none; }
  .contact__row { grid-template-columns: 90px 1fr; }
  .info__foot { align-items: flex-start; flex-wrap: wrap; }
  .info__top { margin-left: 0; }
}

/* ---------- LEGAL DIALOGS ---------- */
/* Appearance of the Privacy Policy and Imprint windows. The dialog text itself
  lives in index.html. The inner content scrolls when it is taller than the
  available screen, while the title/close bar stays visible. */
.legal-dialog {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(760px, calc(100% - 32px));
  max-width: none;
  margin: auto;
  max-height: min(86dvh, 900px);
  padding: 0;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.22);
}
.legal-dialog:not([open]) { display: none; }
.legal-dialog::backdrop { background: rgba(17, 17, 17, 0.64); }
.legal-dialog__bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px clamp(20px, 4vw, 36px);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.legal-dialog__bar h2 {
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  letter-spacing: -0.04em;
}
.legal-dialog__close {
  flex: none;
  border: 0;
  padding: 8px 0 8px 8px;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.legal-dialog__close:hover,
.legal-dialog__close:focus-visible { color: var(--ink); }
.legal-dialog__content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px clamp(20px, 4vw, 36px) 36px;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0;
  text-transform: none;
}
.legal-dialog__content h3 {
  margin: 24px 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.legal-dialog__content p { margin: 0 0 14px; }
.legal-dialog__content ul { padding-left: 1.25em; }
.legal-dialog__content a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.legal-dialog__content a:focus-visible,
.legal-dialog__close:focus-visible,
.info__legal button:focus-visible,
.info__top:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

/* ---------- PROJECT MODAL ---------- */
/* The project viewer is populated by JavaScript. Its panels scroll horizontally
  so each image is a “page”; changing overflow, widths or panel flex settings can
  change that interaction. */
.modal {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: var(--paper);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
  display: flex;
  flex-direction: column;
}
.modal.is-open { visibility: visible; opacity: 1; }

/* ---- top bar: title + progress track + close ---- */
.modal__bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 56px);
  padding: 20px var(--edge);
}
.modal__trackTitle {
  flex: none;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}
.modal__track {
  position: relative;
  flex: 1;
  height: 2px;
  background: var(--rule);
}
.modal__trackFill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: var(--accent);
  transition: width 0.1s linear;
}
.modal__close {
  flex: none;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  transition: color 0.3s var(--ease);
}
.modal__close:hover { color: var(--accent); }

/* ---- horizontal scroll stage ---- */
.modal__scroll {
  flex: 1;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
}
.modal__scroll::-webkit-scrollbar { height: 0; }

/* generic panel */
.vpanel {
  flex: none;
  height: 100%;
  box-sizing: border-box;
  padding: clamp(28px, 5vh, 72px) clamp(28px, 4vw, 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* info panel (first) */
.vpanel--info {
  width: min(560px, 90vw);
  border-right: 1px solid var(--rule);
}
.vpanel__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.vpanel__title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 10px 0 28px;
}
.vpanel__facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 28px;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 28px;
}
.vpanel__facts dt {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}
.vpanel__facts dd { font-size: 0.95rem; }
.vpanel__text p { color: var(--ink-soft); margin-bottom: 1em; line-height: 1.6; }

/* image panel */
.vpanel--img {
  --vpad: clamp(28px, 5vh, 72px);
  position: relative;
  width: auto;
  max-width: 92vw;
  padding: var(--vpad) clamp(28px, 4vw, 80px);
  align-items: center;
  justify-content: flex-start;
}
/* continuous separating rule — spans the full panel width so adjacent
   captioned panels join into one line, broken only by uncaptioned pictures */
.vpanel--captioned::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--vpad) + 150px);
  height: 1px;
  background: var(--ink);
}
/* inner wrapper: height fills the panel, width tracks the image (min 320px) */
.vpanel--img .vfig {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  min-width: 320px;
  max-width: 100%;
}
.vpanel--img .vimg {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vpanel--img img {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}
/* captioned images sit a little smaller above the rule */
.vpanel--captioned .vimg { padding-bottom: 22px; }
.vpanel__caption {
  flex: none;
  box-sizing: border-box;
  width: 100%;
  height: 150px;
  padding: 20px 0 0;
  overflow: hidden;
}
.vpanel__caption h3 {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.vpanel__caption p {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

@media (max-width: 900px) {
  .modal__scroll { scroll-snap-type: x mandatory; }
  .vpanel { scroll-snap-align: start; }
  .vpanel--info { width: 90vw; }
}

/* ---------- REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  /* Respect visitors who ask their device for less animation. Keep new motion
     effects covered by this preference when adding them. */
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
