/* ==========================================================
   Design tokens: change these to restyle the whole site.
   ========================================================== */
:root {
  /* Colours */
  --bg:         #F8F2E9;   /* page background */
  --bg-light:   #fefbf7;   /* page background */
  --bg-alt:     #ebdfd0;   /* top of the page gradient, footer */
  --bg-alt2:    #ede6db;   /* testimonials stripe */
  --surface:    #fffefe;   /* cards */
  --text:       #2B231D;
  --text-light: #393939;
  --muted:      #5A4B40;   /* quotes */
  --accent:     #4a5a35;   /* links, role */
  --border:     #6B5B4E;   /* expander text */
  --border-alt: #5a4230;   /* current language, at-a-glance labels */
  --border-alt2: #6a3f2c;  /* image border */
  --focus:      #000000;

  /* Shadows */
  --dropshadow:      #c0b4a452;
  --dropshadow-dark: #5a4b40b5;

  /* Layout */
  --max-width: 60rem;
}


/* ==========================================================
   Base
   ========================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-image: linear-gradient(to bottom, var(--bg-alt) 0rem, var(--bg) 6rem);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
}

strong {
  font-weight: 600;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  font-weight: 600;
  text-underline-offset: 0.2em;
}

@media (hover: hover) {
  a:hover { text-decoration-thickness: 0.15em; }

  .lang-list a:hover {
    background: var(--surface);
    color: var(--text);
    text-decoration: underline solid var(--text) 2px;
  }

  .about-item summary:hover {
    background-color: var(--bg);
    filter: drop-shadow(0 0 0.25rem var(--dropshadow));
    color: var(--text);
    text-decoration: underline solid var(--text) 2px;
  }

  .more summary:hover { text-decoration: underline solid var(--border) 2px; }
}

a:focus {
  text-decoration-thickness: 0.15em;
}

/* Distinct keyboard focus indicator for everything focusable */
:focus-visible {
  box-shadow: 0 0 0 0.2rem #ffffff;
  outline: 0.2rem solid var(--focus);
  outline-offset: 0.2rem;
}

/* The skip link moves focus to <main>; no ring needed on a whole container */
#main:focus {
  outline: none;
  box-shadow: none;
}

/* Page column */
.wrap {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* Hidden on screen, still read by screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Expanders opening and closing animations */
@media (prefers-reduced-motion: no-preference) {

  /* smooth scroll */
  html { scroll-behavior: smooth; }

  /* the chevron turns smoothly */
  .more summary::after,
  .about-item summary::after {
    transition: transform 0.3s ease;
  }

  /* the content slides open and closed (browsers that support it) */
  @supports (interpolate-size: allow-keywords) {
    :root {
      interpolate-size: allow-keywords;
    }

    details::details-content {
      height: 0;
      overflow: clip;
      overflow-clip-margin: 0.5rem;   /* keeps keyboard focus rings at the edges from being cut off */
      transition: height 0.3s ease, content-visibility 0.3s ease allow-discrete;
    }

    details[open]::details-content {
      height: auto;
    }
  }
}

/* ==========================================================
   Headings
   ========================================================== */
h1, h2, h3, h4 {
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 1rem + 6vw, 3.5rem);
  margin: 0 0 0.25rem;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin: 0 0 2rem;
}

h3 {
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  margin: 0 0 2rem;
}

h4 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 1.75rem 0 0.75rem;
}

h5 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.5rem 0 0rem;
}


/* ==========================================================
   Skip link
   ========================================================== */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.75rem 1rem;
  background: var(--text);
  color: #fff;
  border-radius: 6px;
  z-index: 10;
}

.skip-link:focus {
  top: 1rem;
}


/* ==========================================================
   Top bar / language selection
   ========================================================== */
.top-bar {
  padding-block: 1rem;
}

.lang-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.lang-list a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 1rem;
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--bg);
  filter: drop-shadow(0 0 0.1rem var(--dropshadow-dark));
}

.lang-list a:focus {
  background: var(--surface);
  color: var(--text);
  text-decoration: underline solid var(--text) 2px;
}

/* Current language: filled AND underlined, so it is not shown by colour alone */
.lang-list a[aria-current="page"] {
  background: var(--border-alt);
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* Narrow screens: keep the three buttons on one row, sharing the width */
@media (max-width: 30rem) {
  .lang-list {
    flex-wrap: nowrap;
    gap: 0.375rem;
  }

  .lang-list li {
    flex: 1 1 auto;
    min-width: 0;
  }

  .lang-list a {
    justify-content: center;
    width: 100%;
    padding-inline: 0.5rem;
  }
}


/* ==========================================================
   Hero
   ========================================================== */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
  padding-block: 5rem;
}

.hero img {
  width: 100%;
  max-width: 18rem;
  border-radius: 15px;
  filter: drop-shadow(0 0 1rem var(--dropshadow));
}

.role {
  margin: 0.5rem 0 1.8rem;
  color: var(--accent);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Intro: one or more paragraphs */
.intro-lead {
  font-weight: 600;
  font-style: italic;
}

.intro {
  max-width: 36rem;
  margin: 0;
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1.5;
}

.intro p {
  margin: 0;
}

.intro p + p {
  margin-top: 1rem;
}

.intro-link {
  margin: 1.5rem 0 0;
}

@media (min-width: 48rem) {
  .hero {
    grid-template-columns: 18rem 1fr;
    gap: 4rem;
  }
}

@media (max-width: 30rem) {
  .hero img {
    max-width: 23rem;
  }
}


/* ==========================================================
   Sections
   ========================================================== */
.section {
  max-width: 40rem;       /* the narrow column */
  margin-inline: auto;
  padding-top: 5rem;
}


/* ==========================================================
   Quotes and testimonials
   ========================================================== */

/* Overall quotes: a full-width stripe between the intro and "My work" */
.testimonials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 3rem;
  padding-block: 3rem;                     /* the stripe's height */
  background: var(--bg-alt2);
  box-shadow: 0 0 0 100vmax var(--bg-alt2);  /* extends the colour past the column */
  clip-path: inset(0 -100vmax);              /* cuts it off above and below, so the page doesn't scroll sideways */
}

.quote {
  margin: 0;
  color: var(--muted);
}

.quote blockquote {
  margin: 0;
}

.quote blockquote p {
  margin: 0 0 1rem;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-style: italic;
  line-height: 1.4;
}

.quote figcaption {
  font-size: 1rem;
  font-style: normal;
}

.quote-source {
  font-weight: 600;
}

.quote-note {
  display: block;
}

/* ==========================================================
   About
   ========================================================== */

.about-item {
  margin-bottom: 0.25rem;
  border: 2px var(--accent);
}

.about-item:last-of-type {
  margin-bottom: 0rem;
}

.about-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.75rem;
  padding: 1.5rem;
  font-size: clamp(1rem, 0.4rem + 3vw, 1.3rem);
  color: var(--muted);
  font-weight: 400;
  line-height: 1.2;
  cursor: pointer;
  list-style: none;
  background-color: var(--bg-alt2);
  border-radius: 10px;
}

.about-item summary::-webkit-details-marker { display: none; }

.about-item summary:focus-visible,
.about-item summary:active {
  background-color: var(--bg);
  filter: drop-shadow(0 0 0.25rem var(--dropshadow));
  color: var(--text);
  text-decoration: underline solid var(--text) 2px;
}

.about-item[open] summary {
  margin-bottom: 2rem;   /* extra space between the heading row and the text; raise it to taste */
  background-color: var(--bg-light);
  filter: drop-shadow(0 0 0.25rem var(--dropshadow));
  color: var(--text);
}

.about-item p:last-child { margin-bottom: 2rem; }

.about p {
  margin-block: 1.5rem;
  margin-inline: 0.5rem;
  max-width: 40rem;      /* comfortable line length */
}

@media (min-width: 48rem) {
  .about p {
    margin-inline: 1rem;
  }
}

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


/* ==========================================================
   Projects (case study cards)
   ========================================================== */
.project {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 46rem;          /* wide screens: 40rem text + 3rem padding on each side */
  margin-inline: -1rem;
  margin-bottom: 3rem;
  padding: 1.5rem;
  background: var(--surface);
  border-radius: 20px;
  filter: drop-shadow(0 0 1rem var(--dropshadow));
  line-height: 1.5;
}
.project + .project {
  margin-top: 2rem;
}

.project p {
  margin: 0;
  max-width: 40rem;
}

/* Space between paragraphs inside a project */
.project p + p {
  margin-top: 1.4rem;
}

/* Every image in a card gets the same rounded corners */
.project img {
  border-radius: 20px;
}

@media (min-width: 48rem) {
  .project {
    padding: 3rem;
    margin-inline: -3rem;
  }
}

@media (max-width: 30rem) {
  .project {
    margin-inline: -0.5rem;   /* cards stick out a little past the text margin */
  }
}

/* ---------- Styling the lists ---------- */
.project ul,
.about ul {
  list-style-type: "–  ";
  margin: 1rem 0 1.5rem;
  max-width: 40rem;
}

@media (max-width: 30rem) {
  .project ul,
  .about ul {
    padding-left: 1.5rem;
  }
}

.project li + li,
.about li + li {
  margin-top: 0.5rem;
}

.project li::marker,
.about li::marker {
  color: var(--text);         /* optional: colour the dash */
  font-size: 1.25rem;            /* optional: make the dash a little bigger */
  font-weight: 400;              /* optional: make the dash bold */
}

/* ---------- Cover image: banner above the title ---------- */
.cover {
  width: 100%;
  aspect-ratio: 2.07 / 1;
  object-fit: cover;
  margin: 0 0 1.5rem;
}

/* ---------- At a glance ---------- */
.glance {
  margin: 0 0 2rem;
  max-width: 40rem;
  font-size: 1.1rem;
  line-height: 1.4rem;
}

.glance > div {
  display: flex;
  gap: 2rem;
}

.glance > div + div {
  margin-top: 1.5rem;
}

.glance dt {
  flex: 0 0 5.5rem;
  color: var(--muted);
  font-weight: 600;
  text-align: right;
}

.glance dd {
  margin: 0;
}

/* Narrow screens: cover has narrower margins, labels go above the text, left-aligned */
@media (max-width: 30rem) {
  .cover {
    margin: 0 0 1rem;
  }

  .glance > div {
    flex-direction: column;
    gap: 0;
  }

  .glance dt {
    flex: none;
    text-align: left;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
}

/* ---------- Case study sections (heading, text, image) ---------- */
.case-section {
  display: flow-root;        /* keeps the floated image inside its section */
}

.case-section .quote {
  padding-top: 1rem;
  padding-bottom: 2rem;
  padding-left: 1rem;
}

.case-image {
  width: 100%;
  margin: 1.5rem 0 1rem;
}

/* Wide screens: image floats right and the text wraps around it */
@media (min-width: 48rem) {
  .case-image {
    float: right;
    width: 50%;
    margin: 1.5rem 0 1rem 2rem;   /* top margin lines it up with the heading */
  }
}

/* ---------- "Read more" expander ---------- */
.more summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 2.75rem;
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  list-style: none;                 /* hides the default arrow */
  border-radius: 10px;
}

.more summary::-webkit-details-marker {
  display: none;
}

/* Chevron, drawn with borders: points down when closed */
.more summary::after,
.about-item summary::after {
  content: "";
  flex: none;
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-25%) rotate(45deg);
}

/* Points up when open */
.more[open] summary::after,
.about-item[open] summary::after {
  transform: translateY(25%) rotate(-135deg);
}

.more summary:focus-visible,
.more summary:active {
  text-decoration: underline solid var(--border) 2px;
}

/* Quiet when open: no border */
.more[open] summary {
  border-color: transparent;
  margin-bottom: 1rem;
}

.more[open] {
  padding-bottom: 6rem;
  
  /* Creates a solid line using a gradient slice */
  background-image: linear-gradient(to right, var(--bg-alt), var(--bg-alt));
  background-repeat: no-repeat;
  
  /* Size of the segment: 50px wide, 3px high */
  background-size: 6rem 4px; 
  
  /* Position of the segment: centered horizontally, at the very bottom */
  background-position: center bottom; 
}

/* ---------- Subcases (inside a larger case) ---------- */
.subcases {
  margin-block: 1rem;
}

.subcase {
  padding-block: 3rem;
}

.subcase h4 {
  margin: 0 0 0.5rem;
}

.subcase .glance {
  margin: 1rem 0;
  font-size: 1rem;
}

.subcase .teaser {
  color: var(--text-light);
  line-height: 1.3;
}

.subcase .cover { 
  aspect-ratio: 7 / 1;
  border-radius: 8px;
}

/* ==========================================================
   Contact
   ========================================================== */
.contact-list {
  list-style: none;
  margin: 0 0 10rem;
  padding: 0;
}

.contact-list li + li {
  margin-top: 0.5rem;
}

.contact-list a {
  display: inline-block;
  padding-block: 0.25rem;
}

.contact-list a::after {
  content: "";
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-left: 0.4em;
  vertical-align: -0.05em;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.contact-list a[href^="mailto:"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3.5 7.5l8.5 6 8.5-6'/%3E%3C/svg%3E");
}

.contact-list a[href^="http"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6'/%3E%3Cpath d='M20 4l-9 9'/%3E%3Cpath d='M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E");
}


/* ==========================================================
   Footer
   ========================================================== */
.site-footer {
  padding-block: 6rem 6rem;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
  background: var(--bg-alt);
}

.site-footer p {
  margin: 0;
}

.site-footer p + p {
  margin-top: 3rem;
}

.site-footer .wrap {
  max-width: 43rem;       /* 46rem of content + 1.5rem padding on each side */
}