/* ==========================================================
   STYLESHEET
   CSS describes how your HTML looks. Each rule has a selector
   (what to style) and properties (how to style it).
   ========================================================== */


/* 1. VARIABLES
   Colours and sizes defined once, reused everywhere with var(--name).
   Change a value here and the whole site updates. */
:root {
  --paper: #0c0310;   /* page background */
  --ink:   #ff0000;   /* main text */
  --muted: #2ffff1e5;   /* secondary text */
  --rule:  #ffffff;   /* thin lines */

  --serif: "Apple chancery", chancery, serif;
  --sans:  system-ui, -apple-system, "helvetica bold", Helvetica, sans-serif;

  --page-width: none;  /* max width of the content, none = full width */
  --gutter: clamp(1.25rem, 4vw, 3rem);  /* side spacing, grows with screen */
}


/* 2. BASICS */
* {
  box-sizing: border-box;  /* makes width/padding maths predictable */
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.8rem;
  line-height: 1.6;
}

a {
  color: inherit;
}

/* Visible outline when navigating with the keyboard (accessibility) */
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}


/* 3. HEADER */
.site-header {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 2rem var(--gutter) 1.5rem;

  display: flex;                    /* puts name and nav side by side */
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;                  /* on narrow screens, nav drops below */
  gap: 0.75rem 2rem;
}

.site-name {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(1.75rem, 4vw, 2.5rem);  /* scales with the screen */
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.site-name a {
  text-transform: uppercase;  /* makes the name stand out */
  letterspacing: 0.02em;  /* adds a little space between letters */
  font-size: 0.9rem;
}


/* 4. NAVIGATION */
.nav-list {
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;   /* removes the bullet points */
}

.nav-list a {
  text-decoration: none;
  color: var(--muted);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {   /* the page you're currently on */
  color: var(--ink);
  border-bottom-color: var(--ink);
}


/* 5. HOME PAGE: IMAGE COVERS THE WHOLE SCREEN */
main {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 var(--gutter) 3rem;
}

.cover {
  position: fixed;        /* stays in place, fills the window */
  inset: 0;               /* shorthand for top/right/bottom/left: 0 */
  z-index: -1;            /* sends it behind the header */
  background: var(--ink); /* dark colour shows if the image is missing */
}

.cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;      /* fills the screen and crops the edges, never stretches */
  object-position: center; /* try "top" or "left center" to choose what stays visible */
}



/* On the home page, the header text turns white */
.home {
  color: #fff;
}

.home .site-header {
  max-width: none;        /* header spans the full width */
}

.home .nav-list a {
  color: rgba(255, 255, 255, 0.85);
}

.home .nav-list a:hover {
  color: #fff;
  border-bottom-color: #fff;
}

.home a:focus-visible {
  outline-color: #fff;
}


/* 6. TEXT PAGES (about, works) */
.text-page {
  max-width: 40rem;           /* keeps lines a comfortable length */
}

.text-page h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 1rem 0 1.5rem;
}


/* 7. FOOTER */
.site-footer {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}


/* 8. SMALL SCREENS */
@media (max-width: 480px) {
  .nav-list {
    gap: 1.25rem;
  }
}

/* Name and links stacked on the left */
.site-header {
  flex-direction: column;   /* items go top to bottom instead of side by side */
  align-items: flex-start;  /* aligns them to the left */
  gap: 1rem;             /* space between the name and the links */
}

.nav-list {
  flex-direction: column;   /* "About" and "Selected works" under each other */
  gap: 0.4rem;              /* space between the two links */
}/* Name and links: identical style */
.site-name,
.site-name a,
.nav-list a,
.home .nav-list a {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 700;          /* bold */
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 1.0rem;       /* one size for all three */
  line-height: 1.3;
  color: inherit;            /* same colour as the surrounding text */
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

/* Same hover effect for all three */
.site-name a:hover,
.nav-list a:hover,
.home .nav-list a:hover {
  color: inherit;
  
}/* Hover: change colour instead of underlining */
.site-name a,
.nav-list a,
.home .nav-list a {
}

.site-name a:hover,
.nav-list a:hover,
.nav-list a[aria-current="page"],
.home .nav-list a:hover {
  color: #ffff00;                /* the hover colour: change this one value */
  border-bottom-color: transparent;  /* no underline */
}
/* ABOUT PAGE */
.text-page h2,
.cv-section h3 {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.text-page h2 {
  font-size: 1.5rem;
  margin: 1rem 0 1.5rem;
}

.cv-section {
  margin-top: 3rem;
}

.cv-section h3 {
  font-size: 1rem;
  margin: 0 0 1rem;
}

.cv-list {
  list-style: none;
  margin: 0;
  padding: 0;
}



.cv-year {
  color: var(--muted);
}


@media (max-width: 480px) {
  .cv-list li {
    grid-template-columns: 4rem 1fr;
  }
}
/* SELECTED WORKS */
.works h2 {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 1.5rem;
  margin: 1rem 0 1.5rem;
}

.works-list {
  max-width: 100%;
}

.work {
  margin: 0 0 5rem;           /* space between works */
}

.work-open {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  max-width: 100%;
}

.work-open img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 85vh;           /* large, but always fits on screen */
  background: var(--rule);
}

.work figcaption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.work-title {
  font-style: italic;
}

.work-meta {
  display: block;
  color: var(--muted);
}

/* FULL-SCREEN VIEW */
.lightbox {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;        /* whole artwork visible, never cropped */
  cursor: zoom-out;
}

.lightbox-close {
  position: absolute;
  top: 0;
  right: 0;
  padding: 1.25rem var(--gutter);
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 1.125rem;
}

/* Stops the page behind from scrolling while the full-screen view is open */
body:has(dialog[open]) {
  overflow: hidden;
}
/* HEADER: name and links in one stack, top left, on every page */
.site-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  max-width: none;
  margin: 0;
}

/* ABOUT AND WORKS: header stack on the left, content in a column to the right */
body:not(.home) {
  display: grid;
  grid-template-columns: clamp(16rem, 17vw, 24rem) 1fr;  /* left column, then the rest */
  align-items: start;
}

body:not(.home) .site-header {
  grid-column: 1;
  grid-row: 1;
  position: sticky;      /* stays in the top-left corner while the page scrolls */
  top: 0;
}

body:not(.home) main {
  grid-column: 2;
  grid-row: 1;
  max-width: none;
  margin: 0;
  padding: 2rem var(--gutter) 3rem 0;
}

body:not(.home) .site-footer {
  grid-column: 2;
  grid-row: 2;
  max-width: none;
  margin: 0;
  padding-left: 0;
  padding-right: var(--gutter);
}

/* Lines up the page heading with your name */
.text-page h2,
.works h2 {
  margin-top: 0;
  line-height: 1.3;
}

/* Phones: not enough room for two columns, so everything stacks */
@media (max-width: 700px) {
  body:not(.home) {
    display: block;
  }
  body:not(.home) .site-header {
    position: static;
  }
  body:not(.home) main {
    padding-left: var(--gutter);
  }
  body:not(.home) .site-footer {
    padding-left: var(--gutter);
  }
}
/* Short sentence under the name */
.tagline {
  margin: 0;
  font-family: var(--serif);   /* a different font from the Helvetica above */
  font-weight: 800;
  font-style: normal;
  font-size: 1.0rem;
  line-height: 1.4;
  color: var(--muted);
}

/* Pulls it closer to the name (cancels most of the header's 1.25rem gap) */
.site-name + .tagline {
  margin-top: -1rem;
}

/* On the home page it sits on the photo, so it needs to be light */
.home .tagline {
  color: rgba(30, 253, 231, 0.85);
}