/*
Description: CSS file for portfolio
*/


/* ===== Volume TC (Header Font) ===== */
@font-face {
	font-family: "VolumeTCSansRegular";
	src: url('webFonts/Volume/VolumeTCSansRegular/font.woff') format('woff'),
	     url('webFonts/Volume/VolumeTCSansRegular/font.woff2') format('woff2');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "VolumeTCRegular";
	src: url('webFonts/Volume/VolumeTCRegular/font.woff2') format('woff2'),
	     url('webFonts/Volume/VolumeTCRegular/font.woff') format('woff');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "VolumeTCItalic";
	src: url('webFonts/Volume/VolumeTCItalic/font.woff2') format('woff2'),
	     url('webFonts/Volume/VolumeTCItalic/font.woff') format('woff');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

/* ===== AFACAD (Variable Font) ===== */
@font-face {
	font-family: "Afacad";
	src: url('webFonts/Afacad/Afacad-VariableFont_wght.woff2') format('woff2-variations');
	font-weight: 400 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Afacad";
	src: url('webFonts/Afacad/Afacad-Italic-VariableFont_wght.woff2') format('woff2-variations');
	font-weight: 400 700;
	font-style: italic;
	font-display: swap;
}


/* ===== MEYER RESET STARTS ===== */

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}
/* ===== MEYER RESET ENDS ===== */

/* ===== STYLING STARTS HERE ===== */
/* ---------- Design tokens ---------- */
:root {
  --paper: #F3EEE6;
  --dark-grey: #494949;
  --muted: #6B645D;
  --muted-navy: #3a4b56;
  --line: #9A938B;
  --film: #D6D1CA;
  --red: #B23A2B;
  --black: #231f20;

  --volume: "VolumeTCSansRegular", Georgia, serif;
  --volume-ref: "VolumeTCRegular";
  --volume-italic: "VolumeTCItalic", Georgia, serif;
  --body: "Afacad", "Helvetica Neue", Arial, sans-serif;
  --hand: "Caveat", cursive;

  --sidebar: 165px;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--volume);
  font-size: 1.25rem;
  line-height: 1.5;   /* overrides the reset's line-height: 1 */
}

a { color: inherit; }

/* ---------- Sidebar ---------- */
.site-header {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--sidebar);
  padding: 48px 0 0 40px;
  border-right: 1px solid var(--line);
}

.logo {
  font-family: var(--volume);
  font-size: 3.4rem;
  color: var(--dark-grey);
  line-height: 1;
  text-decoration: none;
}

.site-nav ul {
  margin-top: 150px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  font-size: .8rem;
  font: var(--volume);
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
 color: var(--line);
}

.site-nav a[aria-current="page"] {
  color: var(--muted-navy);
  text-decoration-thickness: 1px;
}

/* ---------- Main area ---------- */
main {
  margin-left: var(--sidebar);
  padding: 110px 120px 120px 110px;
}


/* ---------- Page heading ---------- */
.page-title {
  margin-bottom: 20px;
  font-family: var(--body);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-navy);
}

.page-title span {
  color: var(--muted);
  font-weight: 300;
}

.small-title {
  color: var(--muted);
  font-family: var(--body);
  font-variant-caps: small-caps;
  font-weight: 300;
  font-size: 1.5rem;
  letter-spacing: 0.06em;
}

/* ---------- Intro ---------- */
.intro {
  margin-bottom: 40px;
  font-size: 1.2rem;
  line-height: 1.5;
  font-family: var(--body);
  color: var(--black);
}

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

/* ---------- Experience timeline (film strip) ---------- */

.timeline {
  --strip: 230px;        
  --hole-inset: 12px;    
  --hole-width: 12px;
  position: relative;
  margin: 28px 0 64px;
}


.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--strip);
  background:
    repeating-linear-gradient(to bottom, var(--paper) 0 9px, transparent 9px 25px)
      left var(--hole-inset) top 8px / var(--hole-width) 100% no-repeat,
    repeating-linear-gradient(to bottom, var(--paper) 0 9px, transparent 9px 25px)
      right var(--hole-inset) top 8px / var(--hole-width) 100% no-repeat,
    var(--film);
}

.pencil-note::before {
  content: "↑ ";
}

/* Each chapter: frame on the left, text on the right */
.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: var(--strip) minmax(0, 34em);
  column-gap: 56px;
  min-height: 200px;
}

.timeline__item--current {
  min-height: 225px;
}

.film {
  position: relative;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.frame {
  width: 150px;
  height: 160px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--frame, #E8E2D8);
}

.frame__no {
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  color: #4F4A45;
}

.frame__year {
  font-family: var(--volume);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--dark-grey);
}

/* The text beside each frame */
.timeline__text {
  align-self: center;
  padding: 24px 0;
}

.timeline__meta {
  font-size: 0.9rem;
  color: var(--muted);
  font-family: var(--body);
  text-transform: uppercase;
  font-weight: 300;
  letter-spacing: 0.06em;
}

.timeline__role {
  margin: 6px 0 4px;
  font-family: var(--volume);
  font-size: 1.4rem;
  line-height: 1.2;
  color: var(--muted-navy);
}

.timeline__place {
  font-size: 1rem;
  color: var(--muted);
  font-family: var(--body);
}

.timeline__note {
  margin-top: 8px;
  font-style: italic;
  font-weight: 400;
  font-family: var(--body);
  font-size: 1rem;
  color: var(--black)
}

/* ---------- Red pencil circle ---------- */
.pencil-circle {
  position: absolute;
  top: -8px;
  left: 2px;
  width: 226px;
  height: 214px;
  overflow: visible;
  pointer-events: none;
}

.pencil-circle path {
  fill: none;
  stroke: var(--red);
  stroke-width: 3;
  stroke-linecap: round;
}

 .pencil-note {
  position: absolute;
  top: 195px;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  z-index: 1;
  white-space: nowrap;
  font-family: var(--hand);
  font-size: 1.6rem;
  color: var(--red);
}


/* Handwritten reveal: the note is "written" left to right */
.js .pencil-note {
  opacity: 0;
  filter: blur(6px);
}

.js .is-drawn .pencil-note {
  opacity: 1;
  filter: blur(0);
  transition: opacity 0.8s ease, filter 0.8s ease; 
}

.js .pencil-circle path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.js .is-drawn .pencil-circle path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.8s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  .js .is-drawn .pencil-circle path,
  .js .is-drawn .pencil-note {
    transition: none;
  }
}

/* ---------- Ending: contact & CV ---------- */
.contact-cta {
  max-width: 36em;
  padding-top: 48px;
  border-top: 1px solid var(--line);
}

.contact-cta__text {
  margin-top: 12px;
  font-family: var(--body);
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--black);
}

.contact-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* Buttons */
.button {
  display: inline-block;
  padding: 12px 26px;
  border: 1px solid var(--muted-navy);
  font-family: var(--body);
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--muted-navy);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.button:hover {
  background: var(--paper);
  color: var(--red);
  border: 1px solid var(--red);

}
/* ---------- Work grid ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 80px 64px;
  max-width: 1200px;
  margin-top: 40px;
}

.work-card a {
  display: grid;
  text-decoration: none;
  grid-template-rows: 340px auto auto; 
}

.work-card img {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  align-self: center;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.3s ease;
}

/* A different slight tilt for each tile, like prints scattered on a table */
.work-card:nth-child(1) { --tilt: -3deg; }
.work-card:nth-child(2) { --tilt: 1deg; }
.work-card:nth-child(3) { --tilt: 2.5deg; }
.work-card:nth-child(4) { --tilt: -2deg; }
.work-card:nth-child(5) { --tilt: 1.5deg; }
.work-card:nth-child(6) { --tilt: -1deg; }

/* Straightens and lifts on hover, like picking up a print */
.work-card a:hover img,
.work-card a:focus-visible img {
  transform: rotate(0deg) translateY(-6px);
}

.work-card a:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 6px;
}

.work-card__title {
  margin-top: 20px;
  font-family: var(--volume);
  font-size: 1.25rem;
  color: var(--muted-navy);
}

.work-card__type {
  margin-top: 2px;
  font-family: var(--body);
  font-size: 1rem;
  color: var(--muted);
}

.work-card__status {
  margin-left: 6px;
  font-family: var(--hand);
  font-size: 1.2rem;
  color: var(--red);
}

@media (prefers-reduced-motion: reduce) {
  .work-card img { transition: none; }
}

/* ---------- Case study pages ---------- */
.back-link {
  display: inline-block;
  margin-bottom: 32px;
  font-size: 0.95rem;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  font-family: var(--body);
}

.back-link:hover { color: var(--red); }

/* Title on the left, polaroid on the right */
.case-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 64px;
  align-items: center;
  max-width: 1000px;
  margin-bottom: 56px;
}

.case-title {
  font-family: var(--volume);
  font-size: 3.2rem;
  line-height: 1.05;
  color: var(--muted-navy);
}

.case-subtitle {
  margin-top: 12px;
  font-size: 1.3rem;
  font-style: italic;
  color: var(--line);
  font-family: var(--volume-reg);
}

.case-intro {
  margin-top: 12px;
  font-size: 1.3rem;
  color: var(--muted);
  font-family: var(--body);
}

/* Overview strip */
.case-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  font-family: var(--body);
  gap: 32px;
  max-width: 1000px;
  padding: 24px 0;
  margin-bottom: 72px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.case-overview dt {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.case-overview dd {
  margin-top: 4px;
  font-size: 1.05rem;
  color: var(--black);
}

/* Sections: label on the left, content on the right */
.case-section {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 48px;
  max-width: 1000px;
  margin-bottom: 72px;
  font-family: var(--body);
}

.case-section__label {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.case-section__body p {
  padding-right: 1.2rem;
  font-size: 1.15rem;
  line-height: 1.6;
}

.case-section__body p + p {
  margin-top: 1em;
}

/* Numbered process steps */
.case-steps {
  border-top: 1px solid var(--line);
}

.case-steps > li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.case-steps__no {
  font-family: var(--volume-reg);
  font-size: 2rem;
  line-height: 1;
  color: var(--red);
}

.case-steps h3 {
  font-family: var(--volume-reg);
  font-size: 1.3rem;
  color: var(--line);
}

.case-steps p {
  margin-top: 6px;
  max-width: 36em;
  font-size: 1.1rem;
  line-height: 1.6;
  font-family: var(--body);
}

/* Before & after */
.case-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.case-compare figcaption {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Footer: back to all work + next project */
.case-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  max-width: 1000px;
  margin-top: 24px;
  padding: 48px 0 24px;
  border-top: 1px solid var(--line);
}

.case-footer__link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
}

.case-footer__link--next {
  text-align: right;
  margin-left: auto;   /* stays on the right even if there's no "previous" */
}

.case-footer__label {
  font-size: 0.85rem;
  text-transform: uppercase;
  font-family: var(--body);
  letter-spacing: 0.1em;
  color: var(--muted);
}

.case-footer__title {
  font-family: var(--volume);
  font-size: 1.2rem;
  line-height: 1.1;
  color: var(--muted-navy);
  transition: color 0.2s ease;
}

.case-footer__link:hover .case-footer__title,
.case-footer__link:focus-visible .case-footer__title {
  color: var(--red);
}


/* Door Gallery for BeitelArabi Page */

.door-carousel {
  margin-top: 3rem;
}

.door-track {
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.door-track::-webkit-scrollbar {
  display: none;
}

.door-track figure {
  flex: 0 0 calc((100% - 4rem) / 3);
  margin: 0;
  scroll-snap-align: start;
}

.door-track img {
  display: block;
  width: 100%;
  height: auto;
}

.door-track figcaption {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.carousel-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.carousel-count {
  margin-right: 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.carousel-btn {
  background: none;
  border: none;
  padding: 0.25rem;
  color: var(--muted-navy);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

.carousel-btn svg {
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.carousel-btn.prev:hover:not(:disabled) {
  transform: translateX(-3px);
}

.carousel-btn.next:hover:not(:disabled) {
  transform: translateX(3px);
}

.carousel-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

.carousel-btn:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .door-track { scroll-behavior: auto; }
  .carousel-btn { transition: none; }
}


/* Colour swatches for case studies */
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.swatches li {
  display: flex;
  flex-direction: column;
  width: 90px;
}

.swatch {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--swatch);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* ---------- 404 page ---------- */
.error-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 70vh;
  margin-top: 5rem;
  margin-left: 20rem;
}

.error-code {
  font-family: var(--volume);
  font-size: 2rem;
  letter-spacing: 0.08em;
  margin-bottom: .3rem;
  color: var(--red);
}


/* ===== MOBILE ===== */
@media (max-width: 800px) {

  /* Sidebar becomes a top bar */
  .site-header {
    position: static;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .logo {
    font-size: 2.2rem;
  }

  .site-nav ul {
    margin-top: 0;
    flex-direction: row;
    gap: 18px;
    font-size: 1rem;
  }
/* Main content uses the full width */
  main {
    margin-left: 0;
    padding: 40px 24px 56px;
  }

  .intro {
    font-size: 1.05rem;
  }
  /* ---------- Timeline: horizontal film piece per entry ---------- */

  /* Remove the long vertical strip */
  .timeline::before {
    display: none;
  }

  .timeline {
    display: flex;
    flex-direction: column;
    gap: 36px;
  }

  /* Film on top, text underneath */
  .timeline__item,
  .timeline__item--current {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
  }

  /* A short piece of film with holes along the top and bottom */
  .film {
    width: 164px;
    height: 104px;
    padding: 20px 12px;
    background:
      repeating-linear-gradient(to right, var(--paper) 0 9px, transparent 9px 22px)
        left 7px top 6px / 100% 7px no-repeat,
      repeating-linear-gradient(to right, var(--paper) 0 9px, transparent 9px 22px)
        left 7px bottom 6px / 100% 7px no-repeat,
      var(--film);
  }

  /* The frame becomes landscape, filling the film piece */
  .frame {
    width: 100%;
    height: 100%;
    padding: 6px 8px;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }

  .frame__no {
    align-self: flex-start;
    font-size: 0.5rem;
  }

  .frame__year {
    font-size: 1.4rem;
  }

  /* Text uses the full width */
  .timeline__text {
    padding: 0;
  }

  /* ---------- Red circle around the current film piece ---------- */
  .pencil-circle {
    top: -10px;
    left: -10px;
    width: 184px;
    height: 124px;
  }

  .pencil-circle path {
    stroke-width: 3.5;
  }

  /* "you're here" sits beside the film, arrow pointing left */
  .pencil-note {
    top: 50%;
    left: calc(100% + 22px);
    transform: translateY(-50%) rotate(-4deg);
    font-size: 1.4rem;
  }

  .pencil-note::before {
    content: "← ";
  }

  /* ---------- Buttons stack full width ---------- */
  .contact-cta__actions {
    flex-direction: column;
  }

  .button {
    text-align: center;
  }

  /* ---------- Work page: single centred column ---------- */
  .work-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 52px;
    margin-top: 24px;
  }

  .work-card a {
    grid-template-rows: auto auto auto;   
    justify-items: center;
    text-align: center;
  }

  .work-card__title {
    margin-top: 18px;
    justify-items: left;
    text-align: left;
  }
  
  /* ---------- Case study: header ---------- */
  .back-link {
    margin-bottom: 24px;
  }

  .case-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    margin-bottom: 40px;
  }

  /* Polaroid first, centred */
  .case-header__image {
    order: -1;
    justify-self: center;
    width: 230px;
  }

  .case-title {
    font-size: 2.2rem;
  }

  .case-subtitle {
    font-size: 1.1rem;
  }

  .case-intro {
    font-size: 1rem;
  }

  /* ---------- Overview: 2 × 2 grid ---------- */
  .case-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
    margin-bottom: 48px;
  }

  .case-overview dd {
    font-size: 0.95rem;
  }

  /* ---------- Case study: sections ---------- */
  .case-section {
    grid-template-columns: minmax(0, 1fr);   /* label above content */
    gap: 12px;
    margin-bottom: 48px;
  }

  .case-section__body p {
    font-size: 1rem;
  }

  /* Process steps: narrower number column */
  .case-steps li {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    padding: 18px 0;
  }

  .case-steps__no {
    font-size: 1.5rem;
  }

  .case-steps h3 {
    font-size: 1.15rem;
  }

  .case-steps p {
    font-size: 0.95rem;
  }

  /* Before & after stack */
  .case-compare {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  /* Footer: keep previous / next side by side */
  .case-footer__title {
    font-size: 1.2rem;
  }

    /* ---------- Door carousel: swipeable on mobile ---------- */
  .door-track figure {
    flex: 0 0 calc((100% - 2rem) / 2);
  }

  /* ---------- 404 page ---------- */
  .error-page {
    min-height: 60vh;
    margin-left: .5rem;
  }


}