/* ============================================
   Swiss Theme — Design E + E-1 Navigation
   ============================================ */

/* --- Variables --- */
:root {
  --white: #fdfdfd;
  --black: #111111;
  --grid-line: #e0e0e0;
  --red: #d62828;
  --grey: #777;
  --light-grey: #f2f2f2;
  --display: 'Bebas Neue', Impact, sans-serif;
  --body: 'Karla', Helvetica, sans-serif;
}

/* --- Reset --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  background: var(--white);
  color: var(--black);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

strong {
  font-weight: bold;
}


/* ============================================
   LANDING PAGE
   ============================================ */
.landing {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 0 clamp(1.5rem, 4vw, 4rem);
  max-width: 1300px;
  margin: 0 auto;
}

/* Top rule with grid markers */
.top-rule {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.2rem 0;
  border-bottom: 3px solid var(--black);
}

.top-rule .name {
  font-family: var(--display);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-rule .grid-ref {
  font-family: var(--body);
  font-weight: 300;
  font-size: 0.65rem;
  color: var(--grey);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Hero: massive type + structured image */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  padding: 2rem 0;
}

.hero-left {
  padding-right: 1rem;
}

.hero-left h1 {
  font-family: var(--display);
  font-size: clamp(4rem, 10vw, 8rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hero-left h1 .red {
  color: var(--red);
}

.hero-left .tagline {
  font-family: var(--body);
  font-weight: 300;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--grey);
  margin-top: 1.5rem;
  max-width: 320px;
  padding-left: 3px;
}

/* Nav — vertical list with numbering */
.hero-nav {
  margin-top: 2rem;
  padding-left: 3px;
}

.hero-nav a {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.55rem 0;
  font-family: var(--body);
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--black);
  text-decoration: none;
  border-bottom: 1px solid var(--grid-line);
  transition: all 0.2s;
}

.hero-nav a:first-child {
  border-top: 1px solid var(--grid-line);
}

.hero-nav a .num {
  font-family: var(--display);
  font-size: 1.1rem;
  color: var(--red);
  min-width: 1.5em;
}

.hero-nav a:hover {
  padding-left: 0.5rem;
  color: var(--red);
}

/* Right: image with red rule accent */
.hero-right {
  position: relative;
}

.hero-right img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  filter: contrast(1.1);
  display: block;
}

.hero-right::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  width: 40%;
  height: 3px;
  background: var(--red);
}

.hero-right::after {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  width: 3px;
  height: 30%;
  background: var(--red);
}

.hero-right .img-label {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--display);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  padding: 0.4rem 0.7rem;
}

/* Landing footer */
.landing-footer {
  display: flex;
  justify-content: space-between;
  padding: 1rem 0;
  border-top: 1px solid var(--grid-line);
  font-family: var(--body);
  font-weight: 300;
  font-size: 0.6rem;
  color: var(--grey);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


/* ============================================
   STICKY TOP BAR (content pages)
   ============================================ */
.site-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 3px solid var(--black);
  padding: 0 clamp(1.5rem, 4vw, 4rem);
  max-width: 1300px;
  margin: 0 auto;
}

.site-bar-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
}

.site-bar .bar-home {
  display: flex;
  align-items: center;
  font-family: var(--display);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--black);
  padding: 0.7rem 0;
  transition: color 0.2s;
}

.site-bar .bar-home:hover {
  color: var(--red);
}

.site-bar nav {
  display: flex;
  gap: 0;
}

.site-bar nav a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem 1rem;
  font-family: var(--body);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--grey);
  text-decoration: none;
  border-left: 1px solid var(--grid-line);
  transition: color 0.2s, background 0.2s;
}

.site-bar nav a:last-child {
  padding-right: 0;
}

.site-bar nav a .num {
  font-family: var(--display);
  font-size: 0.85rem;
  color: var(--red);
  opacity: 0.5;
  transition: opacity 0.2s;
}

.site-bar nav a:hover {
  color: var(--black);
}

.site-bar nav a:hover .num {
  opacity: 1;
}

.site-bar nav a.active {
  color: var(--black);
  font-weight: 500;
}

.site-bar nav a.active .num {
  opacity: 1;
}


/* ============================================
   CONTENT PAGE LAYOUT
   ============================================ */
.page-wrapper {
  max-width: 1300px;
  margin: 0 auto;
  padding: 2.5rem clamp(1.5rem, 4vw, 4rem) 5rem;
}

/* Reading pages (blog posts): centre the whole wrapper so the section
   header, title and body share one column. box-sizing is border-box, so
   the padding is added back to keep the content box at the measure. */
.page-wrapper--reading {
  max-width: calc(45rem + 2 * clamp(1.5rem, 4vw, 4rem));
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2.5rem;
}

.section-header .section-label {
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: 0.12em;
}

a.section-label {
  color: var(--black);
  text-decoration: none;
  transition: color 0.15s;
}

a.section-label:hover,
a.section-label:focus-visible {
  color: var(--red);
}

/* Page title */
.page-title {
  font-family: var(--display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  text-transform: uppercase;
  line-height: 0.95;
  margin-bottom: 1.5rem;
}

.page-title .red { color: var(--red); }

/* Two-column content layout */
.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
}

.content-grid--flipped {
  grid-template-columns: 1fr 2fr;
}

.content-grid--flipped > main {
  order: 2;
}

.content-grid--flipped > .content-aside {
  order: 1;
}

.content-text {
  font-family: var(--body);
  font-weight: 300;
  font-size: 0.92rem;
  line-height: 1.8;
  color: #333;
}

.content-text p + p {
  margin-top: 1em;
}

/* Aside column */
.content-aside {
  padding-top: 0.5rem;
}

.content-aside img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  filter: contrast(1.1);
  margin-bottom: 1.5rem;
}

.about-stats {
  border-top: 1px solid var(--grid-line);
}

.about-stats .stat {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--grid-line);
  font-size: 0.72rem;
  color: var(--grey);
}

.about-stats .stat .val {
  font-weight: 500;
  color: var(--black);
}


/* ============================================
   CV / EXPERIENCE SECTION
   ============================================ */
.cv-section {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 3px solid var(--black);
}

.cv-section-header {
  margin-bottom: 1.5rem;
}

.cv-section-label {
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cv-entry {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--grid-line);
}

.cv-period {
  font-family: var(--display);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--red);
  padding-top: 0.15rem;
}

.cv-role {
  font-family: var(--display);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.cv-org {
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--grey);
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.cv-bullets {
  font-family: var(--body);
  font-weight: 300;
  font-size: 0.85rem;
  line-height: 1.75;
  color: #333;
  padding-left: 1rem;
}

.cv-bullets li + li {
  margin-top: 0.25rem;
}


/* ============================================
   FOOTER (content pages)
   ============================================ */
.page-footer {
  max-width: 1300px;
  margin: 0 auto;
  padding: 1rem clamp(1.5rem, 4vw, 4rem);
  border-top: 1px solid var(--grid-line);
  display: flex;
  justify-content: space-between;
  font-family: var(--body);
  font-weight: 300;
  font-size: 0.6rem;
  color: var(--grey);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


/* ============================================
   BLOG HERO
   ============================================ */
.blog-hero {
  position: relative;
  margin-bottom: 2rem;
}

.blog-hero img {
  width: 100%;
  aspect-ratio: 21/9;
  object-fit: cover;
  filter: contrast(1.1);
  display: block;
}

.blog-hero .img-label {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--display);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  padding: 0.4rem 0.7rem;
}


/* ============================================
   BLOG LISTING
   ============================================ */
.blog-list {
  border-top: 1px solid var(--grid-line);
}

.blog-entry {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--grid-line);
  text-decoration: none;
  color: var(--black);
  transition: padding-left 0.2s;
}

.blog-entry:hover {
  padding-left: 0.5rem;
}

.blog-entry-stamp {
  font-family: var(--display);
  font-size: 0.85rem;
  color: var(--red);
  letter-spacing: 0.06em;
  min-width: 3.5em;
  white-space: nowrap;
}

.blog-entry-body {
  flex: 1;
}

.blog-entry-title {
  font-family: var(--display);
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
}

.blog-entry-desc {
  font-family: var(--body);
  font-weight: 300;
  font-size: 0.8rem;
  color: var(--grey);
  margin-top: 0.3rem;
  line-height: 1.5;
}

.blog-entry:hover .blog-entry-title {
  color: var(--red);
}


/* ============================================
   BLOG POST
   ============================================ */
/* Long-form reading setting. 1.1rem across a 45rem measure lands at ~85
   characters — the top of the comfortable range, which the generous leading
   below supports. The measure itself lives on .page-wrapper--reading. */
.blog-post .content-text {
  font-size: 1.1rem;
  line-height: 1.7;
}

.blog-post .post-subtitle {
  font-family: var(--body);
  font-weight: 300;
  font-size: 1.3rem;
  font-style: italic;
  color: var(--grey);
  line-height: 1.5;
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--red);
}

.blog-post .post-date {
  display: block;
  font-family: var(--body);
  font-weight: 300;
  font-size: 0.75rem;
  color: var(--grey);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--grid-line);
}

/* Heading scale is pegged to the 1.1rem body above it — at the old sizes
   h4 would have set smaller than the text it introduces. */
.blog-post .content-text h2 {
  font-family: var(--display);
  font-size: 2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2.8rem;
  margin-bottom: 0.8rem;
}

.blog-post .content-text h3 {
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 2.4rem;
  margin-bottom: 0.6rem;
}

/* h4 stays in Karla: Bebas Neue has no italic, and these subheads are
   often set in emphasis (e.g. "#### _Prologue_"). Same size as the body,
   distinguished by weight, caps and tracking rather than scale. */
.blog-post .content-text h4 {
  font-family: var(--body);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2.6rem;
  margin-bottom: 0.7rem;
}

.blog-post .content-text h2:first-child,
.blog-post .content-text h3:first-child,
.blog-post .content-text h4:first-child {
  margin-top: 0;
}

/* Prose links: body text keeps its reading colour, the accent carries the
   signal. Excludes footnote markers, which are already accent-coloured
   superscripts and would double up. */
.blog-post .content-text a:not(.footnote-backref) {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: text-decoration-thickness 0.15s, color 0.15s;
}

.blog-post .content-text a:not(.footnote-backref):hover {
  color: var(--red);
  text-decoration-thickness: 2px;
}

.blog-post .content-text .footnote-ref a {
  text-decoration: none;
}

.blog-post .content-text a:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  text-decoration: none;
}

.blog-post .content-text blockquote {
  border-left: 3px solid var(--red);
  margin: 2rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  font-style: italic;
  color: var(--grey);
}

.blog-post .content-text ul,
.blog-post .content-text ol {
  padding-left: 1.5rem;
  margin: 1em 0;
}

.blog-post .content-text li + li {
  margin-top: 0.4em;
}

/* PhotoSwipe: use site black, not pure black */
.pswp {
  --pswp-bg: #111111;
}

/* Blog: single photo */
.post-image {
  margin: 2.5rem 0;
}

.post-image__link {
  display: block;
  position: relative;
  overflow: hidden;
  margin-inline: auto;
  cursor: zoom-in;
}

/* maxHeight crops from the bottom; fade the cut edge so it reads as
   truncated rather than badly framed. */
.post-image__link--cropped::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 3.5rem;
  background: linear-gradient(to bottom, transparent, var(--white));
  pointer-events: none;
}

.post-image__link img {
  width: 100%;
  display: block;
  transition: transform 0.4s ease;
}

.post-image__link:hover img {
  transform: scale(1.02);
}

.post-image figcaption {
  font-size: 0.8rem;
  color: var(--grey);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding-top: 0.6rem;
  margin-top: 0.5rem;
  /* A captionWidth-constrained box centres in the text column while its
     own lines stay flush left. No-op at full width. */
  margin-inline: auto;
  border-top: 1px solid var(--grid-line);
}

/* Blog: photo gallery */
.post-gallery {
  margin: 2.5rem 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.post-gallery__item {
  overflow: hidden;
  margin: 0;
}

.post-gallery__link {
  display: block;
  overflow: hidden;
  cursor: zoom-in;
}

.post-gallery__link img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.post-gallery__link:hover img {
  transform: scale(1.04);
}

/* Footnotes */
.footnote-ref a,
.footnote-backref {
  color: var(--red);
  text-decoration: none;
}

.footnotes {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--grid-line);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--grey);
}


/* ============================================
   COLOR SWITCHER (easter egg — landing page period)
   ============================================ */
.dot-trigger {
  position: relative;
  cursor: pointer;
  transition: opacity 0.15s;
}

.dot-trigger:hover {
  opacity: 0.75;
}

.dot-palette {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0;
  padding-left: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.dot-palette.is-open {
  opacity: 1;
  pointer-events: auto;
}

.swatch {
  font: inherit;
  color: var(--swatch);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.15s;
  line-height: inherit;
}

.swatch:hover {
  opacity: 1;
}

.swatch--active {
  display: none;
}

.swatch:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}


/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes wipeIn {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-left h1 { animation: wipeIn 0.6s ease 0.1s both; }
.hero-left .tagline { animation: fadeSlide 0.5s ease 0.3s both; }
.hero-nav { animation: fadeSlide 0.5s ease 0.4s both; }
.hero-right img { animation: fadeSlide 0.6s ease 0.2s both; }
