/* ─────────────────────────────────────────
   VARIABLES
───────────────────────────────────────── */
:root {
  --layout-max-width: max(1400px, 92vw);
  --layout-margin: clamp(48px, 4vw, 120px);
  --layout-gutter: 24px;

  /* Colors */
  --color-bg:      #fcfcfc;
  --color-text:    #242424;
  --color-small:   #5f5f5f;
  --color-muted:   #4B4B4B;
  --color-grey:    #868686;
  --color-accent:  #181818;
  --color-placeholder: #e4e4e4;

  /* Typography — body */
  --font-body:          "Roboto", sans-serif;
  --font-size-body:     16px;
  --line-height-body:   24px;
  --font-size-small:    12px;
  --line-height-small:  18px;

  /* Spacing — 4px base unit (Material Design system) */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-7:  28px;
  --space-8:  32px;
  --space-9:  36px;
  --space-10: 40px;
  --space-11: 44px;
  --space-12: 48px;
  --space-13: 52px;
  --space-14: 56px;
  --space-15: 60px;
  --space-16: 64px;

  /* ─── Case study spacing — adjust these globally ─── */
  --cs-section-gap:     var(--space-10);  /* 40px — space above each .cs-label */
  --cs-item-gap:        var(--space-4);   /* 16px — space between body text / images */
  --cs-panel-padding-y: 120px;            /* top & bottom padding of each tab panel */
  --cs-display-mb:      94px;             /* margin below the big display heading */
  --cs-grid-gap:        var(--space-3);   /* 12px — gap inside 2-column image grids */
}


/* ─────────────────────────────────────────
   FONT FACE
───────────────────────────────────────── */
@font-face {
  font-family: "Roboto";
  src: url("./Fonts/Roboto/Roboto-VariableFont_wdth,wght.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Oswald";
  src: url("./Fonts/Oswald/Oswald-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Raleway";
  src: url("./Fonts/Raleway/Raleway-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Open Sans";
  src: url("./Fonts/Open_Sans/Open_Sans/OpenSans-VariableFont_wdth,wght.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Ubuntu";
  src: url("./Fonts/Ubuntu/Ubuntu-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Ubuntu";
  src: url("./Fonts/Ubuntu/Ubuntu-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Ubuntu";
  src: url("./Fonts/Ubuntu/Ubuntu-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ─────────────────────────────────────────
   BASE
───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; overflow-x: hidden; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  overflow: hidden;
  max-width: 100%;
}

h1, h2, h3, h4, h5, h6, p { margin: 0; }


/* ─────────────────────────────────────────
   TYPE SYSTEM — Body text
───────────────────────────────────────── */

/* Extra Small — 12px / regular / 18px */
.bodytext-extrasmall {
  font-size: var(--font-size-small);
  line-height: var(--line-height-small);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--color-small);
}

/* Body text — 16px / regular / 24px */
.bodytext-small {
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--color-text);
}

/* Regular — 16px / regular / 24px */
.bodytext-regular {
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--color-text);
}

/* Medium — 16px / medium / 24px */
.bodytext-medium {
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--color-text);
}

/* Large — 18px / regular / 24px */
.bodytext-large {
  font-size: 18px;
  line-height: 24px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--color-text);
}

/* Small2 — nav labels — 14px */
.bodytext-small2 {
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--color-text);
}


/* ─────────────────────────────────────────
   TYPE SYSTEM — Headers
───────────────────────────────────────── */

/* H2 — 24px / regular / 28px / 0px */
h2, .h2 {
  font-size: 24px;
  line-height: 28px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--color-text);
}

/* H1 — 134px / medium / auto / 0.2px */
h1, .h1 {
  font-size: 134px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: var(--color-grey);
}


/* ─────────────────────────────────────────
   LAYOUT
───────────────────────────────────────── */
.page {
  height: 100vh;
  display: flex;
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: 0 var(--layout-margin);
  gap: 62px;
}


/* ─────────────────────────────────────────
   SIDEBAR
───────────────────────────────────────── */
.sidebar {
  /* FIX: removed conflicting width: 250px — flex-basis controls the width */
  background: var(--color-bg);
  border-right: 1px solid var(--color-accent);
  flex: 0 0 300px;
}

.sidebar__inner {
  padding: var(--space-12) 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  scrollbar-width: none;
}
.sidebar__inner::-webkit-scrollbar { display: none; }

.sidebar__name {
  margin: 0;
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--color-text);
}
.sidebar__role {
  margin-top: var(--space-1);
  font-size: 16px;
  line-height: 20px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--color-text);
}

/* FIX: removed redundant font-size — the .bodytext-small class on the
   element already sets 16px. Only sidebar-specific overrides remain. */
.sidebar__intro {
  margin-top: var(--space-6);
  margin-bottom: var(--space-12);
  max-width: 248px;
  font-size: 14px;
  line-height: 160%;
  color: #242424;
}

.sidebar__nav {
  margin-top: var(--space-12);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.sidebar__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.sidebar__title {
  font-size: 14px;
  color: var(--color-text);
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.sidebar__link {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-2);
  text-decoration: none;
  color: var(--color-text);
  font-size: 14px;
}
.sidebar__link:hover { text-decoration: underline; }

.sidebar__bottom { margin-top: 64px; }


/* ─────────────────────────────────────────
   MAIN
───────────────────────────────────────── */
.main {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 0;
  scrollbar-width: none;
  min-width: 0;
}
.main::-webkit-scrollbar { display: none; }


/* ─────────────────────────────────────────
   PROJECTS (index page)
───────────────────────────────────────── */
.projects {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.projects__header {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 40px;
  margin-top: 78px;
}

.projects__title {
  margin: 0;
  color: var(--color-text);
}

.project {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 40px;
  align-items: start;
  padding: var(--space-12) 0;
}

.project__text  { margin-top: 0; }

.project__name {
  margin: 0 0 var(--space-2);
  font-size: 22px;
  line-height: 28px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--color-text);
}

.project__sub {
  margin: 0;
  max-width: 260px;
}

.project__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.project__btn:hover {
  opacity: 1;
  text-decoration: underline;
}

.project__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}


/* ─────────────────────────────────────────
   TOPBAR (mobile only)
───────────────────────────────────────── */
.topbar { display: none; }

.topbar__inner {
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: var(--space-4) 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar__brand {
  font-weight: 500;
  color: var(--color-accent);
}

.burger {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font-size: 22px;
  line-height: 1;
  padding: var(--space-2);
  cursor: pointer;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1001;
}

.drawer-close {
  display: none;
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  border: 0;
  background: transparent;
  color: var(--color-text);
  font-size: 22px;
  padding: var(--space-2);
  cursor: pointer;
}


/* ─────────────────────────────────────────
   RESPONSIVE — Mobile (max 1100px)
───────────────────────────────────────── */
@media (max-width: 1100px) {

  body { overflow: auto; }

  .topbar {
    display: block;
    position: sticky;
    top: 0;
    background: var(--color-bg);
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.08);
  }

  .page {
    height: auto;
    display: block;
    padding: 0 24px;
    gap: 0;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    transform: translateX(-110%);
    transition: transform 220ms ease;
    z-index: 1002;
    border-right: none;
    background: var(--color-bg);
  }

  .sidebar.is-open { transform: translateX(0); }

  .drawer-close { display: inline-flex; }

  .sidebar__inner {
    position: relative;
    height: 100vh;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    top: auto;
    padding: 72px var(--space-6) var(--space-6);
  }

  .main {
    height: auto;
    overflow: visible;
    padding: var(--space-6) 0;
    scrollbar-width: auto;
  }

  .projects__header {
    display: block;
    margin-top: var(--space-4);
    margin-bottom: var(--space-4);
  }

  .project {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
  }

  .project__media { order: 1; }
  .project__text  { order: 2; }
  .project__btn   { margin-top: var(--space-3); }

  body.menu-open { overflow: hidden; }

  /* ── Typography scale down ── */
  .tab-panel            { padding-top: 100px; padding-bottom: 100px; }
  .cs-display           { font-size: 48px; margin-bottom: 40px; }
  .project-intro__title { font-size: 20px; line-height: 26px; }
  .project-intro__body  { font-size: 15px; line-height: 22px; }
  .cs-body              { font-size: 15px; line-height: 22px; }
  .segment-btn          { font-size: 14px; }
  .cs-label             { font-size: 11px; }

  /* ── Project intro — stack vertically on mobile ── */
  .project-intro {
    display: flex;
    flex-direction: column;
  }
  .project-intro__left  { width: 100%; }
  .project-intro__right { margin-left: 0; margin-top: var(--space-8); }
  .project-intro__body  { max-width: 100%; }
}


/* ─────────────────────────────────────────
   CASE STUDY UTILITIES
───────────────────────────────────────── */

/* 64px vertical spacer between case study blocks */
.cs-spacer { height: 64px; }

/* Light grey media container (video / image on neutral background) */
.cs-media-block {
  background: #F5F5F5;
  padding: 40px;
  margin-top: 64px;
}
.cs-media-block + .cs-media-block { margin-top: 12px; }


/* ─────────────────────────────────────────
   SVG IMAGE RENDERING
───────────────────────────────────────── */
img[src$=".svg"] {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  image-rendering: -webkit-optimize-contrast;
}


/* ─────────────────────────────────────────
   RESPONSIVE — Small mobile (max 680px)
───────────────────────────────────────── */
@media (max-width: 680px) {
  .bodytext-small { font-size: 15px; line-height: 22px; }
}


/* ─────────────────────────────────────────
   RESPONSIVE — Desktop mid (1101px–1400px)
───────────────────────────────────────── */
@media (min-width: 1101px) and (max-width: 1400px) {
  :root {
    --layout-max-width: 1400px;
    --layout-margin: 32px;
    --layout-gutter: 24px;
  }
}

/* ─────────────────────────────────────────
   RESPONSIVE — Large desktop (1920px+)
───────────────────────────────────────── */
@media (min-width: 1920px) {
  :root {
    --font-size-body:    20px;
    --line-height-body:  30px;
    --font-size-small:   15px;
    --line-height-small: 22px;
  }

  .bodytext-large  { font-size: 22px; line-height: 30px; }
  .bodytext-small2 { font-size: 17px; line-height: 25px; }

  .sidebar__name  { font-size: 20px; line-height: 26px; }
  .sidebar__role  { font-size: 20px; line-height: 26px; }
  .sidebar__intro { font-size: 17px; }
  .sidebar__title { font-size: 17px; }
  .sidebar__link  { font-size: 17px; }

  .project__name { font-size: 27px; line-height: 34px; }
  .project__btn  { font-size: 17px; }

  .sidebar__sublink            { font-size: 17px; }
  .sidebar__sublink--active::before { font-size: 14px; }

  .sidebar { flex: 0 0 380px; }
  .projects__header,
  .project { grid-template-columns: 400px 1fr; }
}

/* ─────────────────────────────────────────
   RESPONSIVE — 4K (3200px+)
───────────────────────────────────────── */
@media (min-width: 3200px) {
  :root {
    --font-size-body:    32px;
    --line-height-body:  48px;
    --font-size-small:   24px;
    --line-height-small: 36px;
  }

  .bodytext-large  { font-size: 36px; line-height: 48px; }
  .bodytext-small2 { font-size: 28px; line-height: 40px; }

  .sidebar__name  { font-size: 32px; line-height: 42px; }
  .sidebar__role  { font-size: 32px; line-height: 42px; }
  .sidebar__intro { font-size: 28px; }
  .sidebar__title { font-size: 28px; }
  .sidebar__link  { font-size: 28px; }

  .project__name { font-size: 44px; line-height: 56px; }
  .project__btn  { font-size: 28px; }

  .sidebar__sublink            { font-size: 28px; }
  .sidebar__sublink--active::before { font-size: 22px; }

  .sidebar { flex: 0 0 560px; }
  .projects__header,
  .project { grid-template-columns: 560px 1fr; }
}