/* ==========================================================================
   Rory Stewart Arnold — Portfolio
   Plain CSS. Edit the variables below to change colours, type and spacing
   across every page.
   ========================================================================== */

:root {
  /* Colours */
  --color-bg: #fcfaf6;        /* page background (off-white) */
  --color-text: #111111;      /* main text */
  --color-accent: #47E9D1;    /* green logo underline */
  --color-dark: #343434	;      /* footer block */
  --color-placeholder: #888884; /* grey image placeholders */
  --color-white: #ffffff;

  /* Type */
  --font: "Amarna", system-ui, sans-serif;       /* headings, nav, buttons */
  --font-body: "Domine", Georgia, serif;         /* body copy and captions */

  /* Layout */
  --max-width: 1280px;
  --gutter: 80px;             /* left/right page margin on desktop */
  --section-space: 120px;     /* vertical space between case study sections */
}

/* ---------- Reset / base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p {
  margin: 0;
}

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

a {
  color: inherit;
}

/* ---------- Page container ---------- */

.container {
  width: 100%;
  max-width: calc(var(--max-width) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Keeps the dark footer starting at the same height as the Figma frames
   (978px from the top) on short pages. */
.page {
  /* min-height: 978px; */
}

/* ---------- Header / nav ---------- */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: 32px;
  height: 194px; /* 32px top padding + 162px nav bar */
}

.site-header-case {
	height: 164px;
}

.logo {
  position: relative;
  display: block;
  width: 240px;
  height: 42px;
  font-weight: 700;
  font-size: 20px;
  line-height: normal;
  text-decoration: none;
  white-space: nowrap;
}

/* Green underline under the logo (29px from the top at 20px, as in Figma;
   set in em so it stays the same distance below the text on mobile) */
.logo::after {
  content: "";
  position: absolute;
  left: 0;
  right: 2px;
  top: 1.45em;
  height: 4px;
  background: var(--color-accent);
}

.menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-weight: 700;
  font-size: 28px;
  line-height: normal;
  text-align: right;
}

.menu a {
  text-decoration: none;
}

.menu a:hover,
.menu a:focus-visible {
  text-decoration: underline;
}

/* The current page is plain text, not a link */
.menu [aria-current="page"] {
  text-decoration: none;
}

/* ---------- Intro (Home / Work / About) ---------- */

.intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 48px;
  max-width: 874px;
}

.page-title {
  font-weight: 700;
  font-size: 76px;
  line-height: 92px;
}

.body-text {
  max-width: 740px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 20px;
  line-height: 32px;
}

/* Headings inside body copy stay in Amarna */
.body-text h2,
.body-text h3 {
  font-family: var(--font);
}

.body-text p + p {
  margin-top: 1.2em;
}

/* ---------- Button ---------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  height: 64px;
  padding: 8px 35px;
  border: 2px solid #000;
  border-radius: 42px;
  font-weight: 700;
  font-size: 24px;
  line-height: normal;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.button:hover,
.button:focus-visible {
  background: var(--color-text);
  color: var(--color-bg);
}

/* ---------- Case study list (Work page) ---------- */

.case-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-weight: 500;
  font-size: 52px;
  line-height: 92px;
}

.case-list a {
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-position: from-font;
}

.case-list .arrow {
  font-weight: 700;
}

.case-list a:hover .arrow,
.case-list a:focus-visible .arrow {
  display: inline-block;
  transform: translateX(6px);
  transition: transform 0.15s;
}

/* ---------- Case study page ---------- */

/* An image (or video) with an optional caption underneath */
.media {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Images fill the width and keep their own proportions, so nothing is
   cropped at any screen size. The block's height comes from the image. */
.media img,
.media video {
  width: 100%;
  height: auto;
}

.caption {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  line-height: 28px;
}

/* Empty placeholders (no <img> yet) show as grey blocks in the Figma proportions */
.media:empty { background: var(--color-placeholder); }
.hero .media:empty { aspect-ratio: 1280 / 720; }
.gallery .media:empty { aspect-ratio: 624 / 560; }
.gallery--single .media:empty { aspect-ratio: 1280 / 560; }

.hero {
  position: relative;
}

.hero-title {
  position: absolute; /* sits on top of the hero image, bottom left */
  left: 80px;
  bottom: 64px;
  font-weight: 400;
  font-size: 72px;
  line-height: 1.05;
  color: var(--color-white);
}

.text-section {
  display: grid;
  grid-template-columns: 296px minmax(0, 843px);
  gap: 32px;
  padding-bottom: var(--section-space);
}

/* The first text section after the hero also has space above it */
.hero + .text-section {
  padding-top: var(--section-space);
}

.section-label {
  font-weight: 700;
  font-size: 24px;
  line-height: normal;
}

.section-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section-body .body-text {
  max-width: none;
}

.section-heading {
  font-weight: 700;
  font-size: 40px;
  line-height: 60px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  padding-bottom: var(--section-space);
}

.gallery--single {
  grid-template-columns: 1fr;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--color-dark);
  color: var(--color-bg);
  min-height: 543px;
}

/* ---------- Case study navigation (fixed to the bottom of the screen) ---------- */

.case-study {
  padding-bottom: 72px; /* keeps the end of the page clear of the bar */
}

.case-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: var(--color-dark);
  color: var(--color-bg);
}

.case-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  max-width: calc(var(--max-width) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.case-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 44px;
  font-weight: 700;
  font-size: 24px;
  line-height: normal;
  text-decoration: none;
}

.case-nav a:hover,
.case-nav a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 6px;
}

.case-nav a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.case-nav-next { margin-left: auto; } /* stays on the right even with no previous link */

/* Mirror the arrow used in the buttons for the "previous" link */
.case-nav-prev .arrow {
  display: inline-block;
  transform: scaleX(-1);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --gutter: 40px;
    --section-space: 80px;
  }

  .page-title {
    font-size: 60px;
    line-height: 72px;
  }

  .hero-title {
    left: 48px;
    bottom: 40px;
    font-size: 56px;
  }

  .text-section {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .section-heading {
    font-size: 32px;
    line-height: 46px;
  }

}

/* Mobile */
@media (max-width: 640px) {
  :root {
    --gutter: 16px;
    --section-space: 56px;
  }

  body {
    font-size: 18px;
  }

  .page {
    min-height: 0;
    padding-bottom: 96px;
  }

  .site-header {
    height: auto;
    padding-top: 24px;
    padding-bottom: 64px;
  }

  .logo {
    width: auto;
    height: 34px;
    font-size: 16px;
  }

  .menu {
    font-size: 22px;
  }

  .intro {
    gap: 32px;
  }

  .page-title {
    font-size: 44px;
    line-height: 52px;
  }

  .body-text {
    font-size: 18px;
    line-height: 28px;
  }

  .button {
    height: 56px;
    padding: 8px 28px;
    font-size: 20px;
  }

  .case-list {
    font-size: 36px;
    line-height: 64px;
  }

  .hero-title {
    left: 16px;
    bottom: 12px;
    font-size: 32px;
  }

  .text-section {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .section-heading {
    font-size: 26px;
    line-height: 36px;
  }

  .gallery {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .site-footer {
    min-height: 240px;
  }

  .case-nav-inner {
    gap: 12px;
    min-height: 64px;
  }

  .case-nav a {
    font-size: 16px;
  }

  .case-study {
    padding-bottom: 64px;
  }
}


/* Animation */

/* Home page: the page block is the frame for the ripples. It fills the screen
   and clips anything that spills past its edges, so the circles are cut off
   at the corner instead of making the page scroll. */
.page--home {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
}

.ripple-background {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.circle{
  position: absolute;
  border-radius: 50%;
  background: #47E9D1;
  animation: ripple 15s infinite;
  box-shadow: 0px 0px 1px 0px #508fb9;
  z-index: -100;

}

.small{
  width: 200px;
  height: 200px;
  right: -100px;
  bottom: -100px;
}

.medium{
  width: 400px;
  height: 400px;
  right: -200px;
  bottom: -200px;
}

.large{
  width: 600px;
  height: 600px;
  right: -300px;
  bottom: -300px;
}

.xlarge{
  width: 800px;
  height: 800px;
  right: -400px;
  bottom: -400px;
}

.xxlarge{
  width: 1000px;
  height: 1000px;
  right: -500px;
  bottom: -500px;
}

.shade1{
  opacity: 0.2;
}
.shade2{
  opacity: 0.5;
}

.shade3{
  opacity: 0.7;
}

.shade4{
  opacity: 0.8;
}

.shade5{
  opacity: 0.9;
}

@keyframes ripple{
  0%{
    transform: scale(0.8);
  }
  
  50%{
    transform: scale(1.2);
  }
  
  100%{
    transform: scale(0.8);
  }
}

