/* --------------CSS by Jonathan Newkirk----------------- */

/* Google Fonts are loaded with <link> tags in each page's <head> (faster than @import) */

/* --------------CSS Reset----------------- */

/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

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;
}

/* --------------ROOT VARIABLES----------------- */

:root{
    --light-teal: #61959B;
    --deep-teal: #0A7682;
    --jet-black: #000000;
    --light-grey: #d9d9d9;
    --dark-grey: #333333;
    --white: #FFFFFF;
    --charcoal: #272727;
    --mid-grey: #5C5959;
    --red: #CE2029;
    --amber: #FFBF00;
    --orange: #FFAC1C;
    --navy: #012b3a;
    --gold: #ba915b;
    --beige: #947F68;
    --hunter-green: #133530;

    --font-barlow: 'Barlow', sans-serif;
    --font-lora: 'Lora', serif;
    --font-montserrat: 'Montserrat', sans-serif;
}

/* --------------LIGHT MODE (default)----------------- */
/* Light is the default. Dark-mode versions of these rules are in the DARK MODE section near
   the bottom, and screen-size changes are in the MEDIA QUERIES section after that. */

/* paper texture: a tiny tiled SVG of fine noise drawn over the white page color.
   Strength: change the last number in the feColorMatrix (0.10 = subtle, 0.18 = strong).
   Grain size: change baseFrequency (0.9 = fine, 0.5 = coarser). Dark mode stays plain. */
body{
    background: var(--white);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400'><filter id='n' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.25  0 0 0 0 0.22  0 0 0 0 0.18  0 0 0 0.10 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    color: var(--dark-grey);
}

/* --------------BEGIN GLOBAL STYLES----------------- */

/* --------------HEADER----------------- */

#header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem;
    background-color: var(--charcoal);
    position: sticky;
    top: 0;
    z-index: 1000;
}

#home-link{
    color: var(--white);
    font-family: var(--font-montserrat), sans-serif;
    font-size: 1.25rem;
    text-decoration: none;
    font-weight: 600;
    padding-left: 35px;
    text-transform: uppercase;
}

#home-link:hover{
    color:var(--mid-grey);
}

#logo{
    width: 80px;
}

#mode_toggle{
    width: 50px;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* --------------NAV----------------- */

#nav{
    display: flex;
    margin-left: auto;
    align-items: center;
    padding-right: 35px;
    gap: 1rem;
}

#nav a{
    text-decoration: none;
    color: var(--white);
    font-family: var(--font-barlow);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    outline: 1px solid var(--white);
    padding: 0.5rem 1rem;
}

#nav a:hover{
    color:var(--jet-black);
    background: var(--white);
}

#nav ul{
    display: flex;
    margin: 0;
    padding: 0;
}

#nav-box{
    display: inline-block;
    padding: 0.9rem 1.5rem;
}

/* --------------MOBILE MENU (hamburger + full-screen overlay)----------------- */

/* HOME link: only shows in the mobile menu (desktop already has your name as the home link) */

.nav-home{
    display: none;
}

/* hidden on desktop */

#menu-toggle,
#nav-close{
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--white);
    padding: 0;
}

#menu-toggle svg,
#nav-close svg{
    width: 100%;
    height: 100%; 
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

body.menu-open{
    overflow: hidden;   /* stop the page scrolling behind the menu */
}

/* --------------BODY----------------- */

/* --------------ABF GRAPHICS----------------- */

h1{
    font-family: var(--font-montserrat), sans-serif;
    font-weight: 600;
    color: var(--dark-grey);
    text-transform: uppercase;
    text-align: center;
    line-height: .9;
}

h1 span{
  display: block;
}

#first-name{
    letter-spacing: -0.03em;
    font-size: clamp(2vw, 5vw, 7vw);
}

#last-name{
    letter-spacing: 0.035em;
    font-size: clamp(2.2vw, 5.2vw, 7.2vw);
}

#top-logo img{
    width: 10em;
    margin-top: 2em;
    margin-bottom: .4em;
}

#top-logo{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1rem; /* Keeps edges from touching phone screen borders */
  margin-top: 2.5rem; /* space between the header and the hero */
}

/* Scales the geometric logo proportionally on mobile and desktop */

#top-logo img{
  width: clamp(180px, 32vw, 310px);
  height: auto;
  margin-bottom: clamp(1.25rem, 3vw, 2.25rem);
}

/* Locks the divider line and subtitle width to the exact width of your name */

.lockup{
  /* ONE NUMBER resizes the whole name block: 0.8 = 20% smaller, 1 = the old size */
  --k: 0.8;
  /* The name stops shrinking below an 850px-wide screen (the 14.5vw / 15.4vw part is only a safety
     net so it never gets wider than a very small phone) */
  --name1: clamp(min(calc(850px * 0.078 * var(--k)), 14.5vw), calc(7.8vw * var(--k)), calc(5.2rem * var(--k)));
  --name2: clamp(min(calc(850px * 0.083 * var(--k)), 15.4vw), calc(8.3vw * var(--k)), calc(5.55rem * var(--k)));
  /* the title line is never narrower than the description under it (the 1.03 is that rule) */
  --title-size: max(clamp(0.82rem, calc(2.55vw * var(--k)), calc(1.7rem * var(--k))), calc(var(--bio-size) * 1.03));
  --bio-size: clamp(1rem, calc(2.3vw * var(--k)), calc(1.52rem * var(--k)));

  --name-space: 3rem;      /* empty space above the name (inside the block) */
  padding-top: var(--name-space);

  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  max-width: 100%;
  position: relative;      /* lets the two vertical lines be placed beside the text */
}

/* vertical lines on either side of the name block.
   They start at the top of the letters in JONATHAN and end at the bottom of the last line of text. */

.lockup::before,
.lockup::after{
  content: "";
  position: absolute;
  top: calc(var(--name-space) + var(--name1) * 0.105);
  bottom: 5.4px;
  width: 1.5px;
  background: var(--dark-grey);
}

.lockup::before{
  left: calc(-1 * clamp(0.75rem, calc(8vw * var(--k)), calc(7.5rem * var(--k))));    /* distance from the text: edit these numbers */
}

.lockup::after{
  right: calc(-1 * clamp(0.75rem, calc(8vw * var(--k)), calc(7.5rem * var(--k))));
}

h1{
  font-family: var(--font-montserrat), sans-serif;
  font-weight: 600;
  color: var(--dark-grey);
  text-transform: uppercase;
  line-height: 0.92;
  margin: 0;
}

h1 span{
  display: block;
}

/* Sized so "JONATHAN" and "NEWKIRK" align cleanly at the left and right edges */

#first-name{
  letter-spacing: -0.02em;
  font-size: var(--name1);
}

#last-name{
  letter-spacing: 0.042em;
  font-size: var(--name2);
}

/* Stretches across 100% of the .lockup container (matching your name's width) */

.divider{
  width: 100%;
  border: none;
  border-top: 1.5px solid var(--dark-grey);
  margin: clamp(calc(0.75rem * var(--k)), calc(2vw * var(--k)), calc(1.25rem * var(--k))) 0;
}

/* Bold sans-serif title line */

.title{
  font-family: var(--font-montserrat), sans-serif;
  font-weight: 700;
  color: var(--dark-grey);
  font-size: var(--title-size);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 0.35em 0;
}

/* Two-line serif description underneath */

.bio{
  font-family: var(--font-lora), serif;
  font-weight: 400;
  color: var(--dark-grey);
  font-size: var(--bio-size);
  line-height: 1.32;
  margin: 0;
}

#hero-art img{
  max-width: 100%;
  height: auto;
}

/* --------------BTF GRAPHICS----------------- */

#below-the-fold{
    display: flex;
    flex-direction: column;
    background: transparent;   /* lets the paper grain show through */
    margin-top: 2rem;
}

.service-buttons{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem 0;
    margin: 2rem auto 6rem;    /* space under the buttons (double what it was) */
    padding: 0 1rem;
}

#carousel{
 position: relative;
 margin: 2rem 0 4rem 0;
}

.project-carousel{
    display: grid;
    grid-template-columns: 1fr;
    column-gap: 1rem;
    align-items: start;
}

.project-carousel > img{
    width: 100%;
}

/* --------------IMAGE MOSAIC (homepage)----------------- */

/* A grid of 6 columns x 2 rows. script.js places and fades the tiles. */

#mosaic{
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 0;                      /* no space between tiles */
    aspect-ratio: 21 / 9;        /* shape of the container: change this to make it taller or shorter */
    margin: 2rem clamp(1rem, 4vw, 3rem) 1rem;   /* top space above the images: edit the first number (2rem); left and right space: edit 4vw or the 3rem limit */
    transition: aspect-ratio .5s ease;   /* phones: the box glides between its 1-image and 2-image shapes */
}

/* pause / play button, centered under the images */

.mosaic-controls{
    display: flex;
    justify-content: center;
    margin: 0 0 4rem 0;
}

#mosaic-toggle{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid currentColor;
    color: var(--jet-black);
    cursor: pointer;
}

#mosaic-toggle svg{
    width: 14px;
    height: 14px;
    fill: currentColor;
}

#mosaic-toggle .icon-play{
    display: none;               /* only shown while paused */
}

#mosaic-toggle.paused .icon-play{
    display: block;
}

#mosaic-toggle.paused .icon-pause{
    display: none;
}

#mosaic-toggle:hover{
    background: var(--charcoal);
    color: var(--white);
}

.mosaic-tile{
    opacity: 0;                  /* tiles start invisible, then ease in */
    overflow: hidden;
}

.mosaic-tile.visible{
    opacity: 1;
}

.mosaic-tile img{
    width: 100%;
    height: 100%;
    object-fit: cover;           /* fills the tile, crops the edges if needed */
    display: block;
}

/* grey stand-ins until you add real images */

.mosaic-tile.placeholder{
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mid-grey);
    font-family: var(--font-barlow);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
}

/* --------------CLIENT LOGOS (home page)----------------- */

#clients{
    color: var(--jet-black);
}

/* A fixed grid: 4 logos across, 2 rows. Every size below is in "em", and the
   font-size on this list is the ONE number that scales everything. It is
   16px on desktop and shrinks with the screen width, so on a phone the whole
   grid gets smaller together, like a picture, and never re-wraps. */

.client-logos{
    --cell: 11.875em;                                   /* width of each of the 4 columns */
    font-size: min(16px, calc((100vw - 2rem) / 47.5));  /* 47.5em = 4 columns */
    display: grid;
    grid-template-columns: repeat(4, var(--cell));
    justify-content: center;
    align-items: center;
    gap: 2em 0;                                         /* space between the two rows */
    margin: 0 auto;
    padding: 0;
}

.client-logos li{
    display: flex;
    align-items: center;
    justify-content: center;      /* each logo is centered in its column */
}

/* every logo sits in the same box so different shapes look even */

.client-logos img{
    width: 9.375em;
    height: 4em;
    object-fit: contain;          /* full-color logos show exactly as they are */
}

/* smaller logos (add class="logo-small"): Marvel, Disney and Star Wars */

.client-logos img.logo-small{
    width: 6em;
    height: 2.5em;
}

/* Little Tikes: 25% smaller than the standard box */

.client-logos img.logo-lt{
    width: 7em;
    height: 3em;
}

/* one-color logos: black in light mode, white in dark mode (add class="logo-mono") */

.client-logos img.logo-mono{
    filter: brightness(0);
}

/* ONE SWITCH for all of them: once every logo is a one-color file, change
   <ul class="client-logos"> to <ul class="client-logos mono"> in index.html and
   every logo goes black in light mode and white in dark mode. */

.client-logos.mono img{
    filter: brightness(0);
}

/* grey stand-in until you add the real logo */

.logo-placeholder{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 9.375em;
    height: 4em;
    border: 1px dashed currentColor;
    opacity: .45;
    font-family: var(--font-barlow);
    font-size: .75em;
    letter-spacing: .1em;
    text-transform: uppercase;
}

/* thin lines above and below the logos (matches the button/outline color in both modes) */

.section-divider{
    width: min(1100px, calc(100% - 3rem));
    margin: 3.5rem auto 4rem;
    border: 0;
    border-top: 1.5px solid var(--dark-grey);
}

/* extra breathing room around the divider above the testimonials */

.section-divider.testimonial-divider{
    margin: 1.8rem auto 6.5rem;
}

#services{
    color: var(--jet-black);
    fill: var(--jet-black);
}

#capabilities{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;   /* keeps the last card centered */
    gap: 4rem;
    padding: 0 1.5rem;         /* left and right margin so the cards don't touch the screen edge */
}

.capability-card{
    flex: 0 0 calc(50% - 2rem);   /* every card the same width: half the row minus half the gap */
    /* keep your existing display:flex, column, align-items, text-align */
}

h2{
    font-family: var(--font-barlow);
    font-size: 3.5rem;
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
    margin: 7rem 0 2rem 0;
}

.capability-card{
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
}

.cap-icon{
    flex-shrink: 0;
    width: 100px;
    height: 100px;
}

/* --------------WHAT I DO rows (desktop)----------------- */

#capabilities h3{
    font-family: var(--font-barlow);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

#capabilities .line1{
    font-family: var(--font-lora);
    font-size: 1rem;
    margin-bottom: .5rem;
}

#capabilities .line2{
    font-family: var(--font-barlow);
    font-weight: 600;
    font-size: 1rem;
}

strong{
    font-weight: 800;
}

.icon{
    height: 50px;
    width: 150px;
    object-fit: contain;
    object-position: left center;
}

.project-carousel{
    display: none;
}

.project-carousel.active{
    display: grid;
}

.eyes-carousel{
    display: none;
    width: 100%;
    height: auto;
}

.eyes-carousel.active{
    display: block;
}

/* --------------LINE BUTTONS (home, about, gallery, back to top)----------------- */

/* Use it like this:  <a class="btn-line" href="...">Text</a>   (or a <button>)
   Plain capital letters with a thin vertical line on each side. Buttons next to
   each other share one line. On hover the button fills in. */

.btn-line{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: -1.5px;                     /* neighbors overlap, so they share one line */
    padding: 1em 1.6em;
    border: 0;
    border-left: 1.5px solid var(--dark-grey);
    border-right: 1.5px solid var(--dark-grey);
    border-radius: 0;
    background: transparent;
    color: var(--dark-grey);
    font-family: var(--font-barlow), sans-serif;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: .02em;
    line-height: 1.2;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

.btn-line:active{
    background: var(--charcoal);
    color: var(--white);
}

.btn-line:focus-visible{
    outline: 2px solid var(--dark-grey);
    outline-offset: 3px;
}

/* home page buttons sit side by side and wrap on small screens */

#about-button{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.5rem 0;
    margin: 6rem auto 4rem auto;
    padding: 0 1rem;
}

/* about page: "My Gallery" button at the bottom of the page */

.page-end-wrap{
    display: flex;
    justify-content: center;
    margin: 0 auto;
    padding: 1rem 1rem 5rem;
}

/* gallery page: "Back to Top" button at the bottom of the page */

.back-to-top-wrap{
    display: flex;
    justify-content: center;
    margin: 0 auto;
    padding: 4rem 1rem 5rem;
}

#about-section{
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 3rem;
    align-items: center;       /* use "start" to line both tops up */
    max-width: 1100px;         /* narrower than the page, so it can be centered */
    margin: 4rem auto;            /* centers the whole block */
    padding: 0 2rem 4rem 2rem; /* space from the screen edges */
}

#about-text p{
    font-family: var(--font-lora);
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--dark-grey);
    margin-bottom: 1rem;       /* your reset removed paragraph spacing */
}

#about-image{
    width: 100%;
    height: auto;
    display: block;
}

h3{
    text-align: center;
    font-family: var(--font-barlow);
    font-size: 2rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

#about-section-title,
#gallery-title{
    font-family: var(--font-barlow);
    font-size: 3.5rem;
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
    line-height: 1;
    margin: 5rem 0 2rem 0;
}

/* Gallery page only: more space above the title and between the title and the buttons */

#gallery-title{
    margin: 8rem 0 3rem 0;
}

.highlight{
    font-weight: 600;
}

a.highlight{
    text-decoration: none;
    color: var(--dark-grey);
}

a.highlight:hover{
    color:var(--red);
}

/* --------------FOOTER----------------- */

footer{
    display: flex;
    flex-direction: column;      /* "Site Design" line sits above the copyright line */
    align-items: center;
    justify-content: center;
    gap: .4rem;
    text-align: center;
    padding: 1rem 1rem;
    background-color: var(--mid-grey);
    color: var(--white);
    text-transform: uppercase;
    font-family: var(--font-barlow);
    font-size: .75rem;
}

/* --------------COLLEAGUE QUOTES (home page)----------------- */

#testimonials{
    padding: 0 1.5rem;
    margin-bottom: 5rem;         /* space between the last quotes and the button below */
}

.testimonial-grid{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4rem 5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.testimonial{
    margin: 0;
    text-align: center;
}

.testimonial blockquote p{
    font-family: var(--font-lora), serif;
    font-style: italic;
    font-size: 1rem;           /* same size as the text in the capability cards */
    line-height: 1.6;
    color: var(--dark-grey);
}

/* short line between the quote and the name */

.testimonial figcaption::before{
    content: "";
    display: block;
    width: 3rem;
    margin: 1.75rem auto 1.25rem auto;
    border-top: 1.5px solid var(--dark-grey);
}

.testimonial-name,
.testimonial-role{
    display: block;
    font-family: var(--font-barlow), sans-serif;
    color: var(--dark-grey);
}

.testimonial-name{
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.testimonial-role{
    margin-top: .4rem;
    font-size: .9rem;
    line-height: 1.35;
}

/* --------------CONTACT POPUP (full screen, same look as the mobile menu)----------------- */

#contact-dialog{
    box-sizing: border-box;
    position: fixed;
    inset: 0;
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    border: none;
    border-radius: 0;
    background: var(--dark-grey);
    color: var(--white);
    text-align: center;
}

/* <dialog> hides itself when closed, so only style the layout when open */

#contact-dialog[open]{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: contact-fade .3s ease;
}

@keyframes contact-fade{
    from{ opacity: 0; }
    to{ opacity: 1; }
}

#contact-dialog::backdrop{
    background: var(--dark-grey);
}

#contact-dialog h2{               /* overrides your big global h2 */
    font-size: 1.75rem;
    margin: 0 0 1.5rem 0;
    color: var(--white);
}

/* X in the corner, same as the menu */

#contact-close{
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 48px;
    height: 48px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--white);
    cursor: pointer;
}

#contact-close svg{
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.contact-list{
    display: flex;
    flex-direction: column;
    gap: .5rem;
    width: min(80vw, 360px);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* outlined blocks, same as the menu links */

.contact-list a,
.contact-phone{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: 1rem;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--white);
    font-family: var(--font-barlow);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-decoration: none;
    outline: 1px solid var(--white);
}

.contact-list a:hover{
    background: var(--white);
    color: var(--jet-black);
}

.contact-icon{
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.contact-phone{
    flex-direction: column;
    gap: .75rem;
}

.phone-buttons{
    display: flex;
    gap: .5rem;
    width: 100%;
}

.phone-buttons button{
    flex: 1;
    padding: .7rem;
    border: none;
    border-radius: 0;
    background: transparent;
    outline: 1px solid var(--white);
    color: var(--white);
    font-family: var(--font-barlow);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
}

.phone-buttons button:hover{
    background: var(--white);
    color: var(--jet-black);
}

/* name at the bottom, like the menu */

#contact-dialog::after{
    content: "JONATHAN NEWKIRK";
    position: absolute;
    bottom: 3rem;
    left: 0;
    right: 0;
    color: var(--white);
    font-family: var(--font-montserrat);
    font-weight: 600;
    letter-spacing: .15em;
}

/* --------------PROJECT DETAIL PANELS (gallery page)----------------- */

.project-detail{
    max-width: 1200px;
    margin: 3rem auto 4rem auto;
    padding: 0 1.5rem;
    color: var(--dark-grey);
    scroll-margin-top: 90px;       /* keeps the sticky header off the top of the panel */
}

.project-detail[hidden]{
    display: none;
}

/* ONE square image on the left, text on the right */

.project-intro{
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: start;      /* square and text both start at the top */
}

.project-image{
    order: -1;               /* image comes first = left column */
    width: 100%;
    aspect-ratio: 1 / 1;     /* every project image is the same square */
    object-fit: cover;       /* fills the square without stretching */
    display: block;
}

/* large full-width image at the bottom of each project */

.project-banner{
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-top: 1.33rem;
}

/* temporary grey square standing in for the project image */

.project-placeholder{
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-grey);
    color: var(--mid-grey);
    font-family: var(--font-barlow);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.project-detail .project-eyebrow{
    font-family: var(--font-barlow);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 1rem;
}

.project-detail h2{                 /* overrides your big global h2 */
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    text-align: left;
    line-height: 1;
    margin: 0 0 1.25rem 0;
    color: var(--dark-grey);
}

.project-detail .project-subtitle{
    font-family: var(--font-lora);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    padding-bottom: .75rem;
    margin-bottom: 2rem;
    border-bottom: 1.5px solid var(--dark-grey);
}

.project-detail h3,
.project-detail h4{
    font-family: var(--font-barlow);
    font-weight: 600;
    text-transform: uppercase;
    text-align: left;
    color: var(--mid-grey);
}

.project-detail h3{
    font-size: 1.25rem;
    margin: 1.75rem 0 .5rem 0;
}

.project-detail h4{
    font-size: 1.1rem;
    margin-bottom: .75rem;
}

.project-detail p{
    font-family: var(--font-lora);
    font-size: 1rem;
    line-height: 1.5;
}

/* Process: big title, rule, then columns that fit as many as there is room for */

.project-process{
    margin-top: 4rem;
}

.project-detail .section-title{
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    color: var(--dark-grey);
    text-align: left;
    margin: 0 0 1.5rem 0;
    padding-bottom: 1.5rem;
    border-bottom: 1.5px solid var(--dark-grey);
}

.process-grid{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));   /* 2 x 2 by default */
    gap: 2.5rem;
    margin-top: 2rem;
}

.project-result{
    margin-top: 4rem;
}

.result-box{
    padding: 1.5rem 1.75rem;
    background: var(--dark-grey);      /* one box (dark grey in light mode, white in dark mode) */
    color: var(--white);
}

.result-box p{
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.result-box p:last-child{
    margin-bottom: 0;
}

/* keep the page the same width whether or not a scrollbar is showing */

html{
    scrollbar-gutter: stable;
}

/* ==========================================================================
   DARK MODE
   script.js adds the class "dark-mode" to <body>. Every rule in this section
   overrides its light-mode twin above, using the same palette colors.
   ========================================================================== */

body.dark-mode{
    background: var(--dark-grey);
    color: var(--light-grey);
}

body.dark-mode #header{
    border-bottom: 1px solid var(--mid-grey);    /* keeps the header visible against the dark page */
}

body.dark-mode h1{
    color: var(--light-grey);
}

body.dark-mode .lockup::before,
body.dark-mode .lockup::after{
    background: var(--light-grey);
}

body.dark-mode h1{
    color: var(--light-grey);
}

body.dark-mode .divider{
    border-top: 1.5px solid var(--light-grey);
}

body.dark-mode .title{
    color: var(--light-grey);
}

body.dark-mode .bio{
    color: var(--light-grey);
}

body.dark-mode #below-the-fold{
    background: var(--dark-grey);
}

body.dark-mode #mosaic-toggle{
    color: var(--light-grey);
}

body.dark-mode #mosaic-toggle:hover{
    background: var(--light-grey);
    color: var(--jet-black);
}

body.dark-mode #clients{
    color: var(--light-grey);
}

body.dark-mode .client-logos img.logo-mono{
    filter: brightness(0) invert(1);
}

body.dark-mode .client-logos.mono img{
    filter: brightness(0) invert(1);
}

body.dark-mode .section-divider{
    border-top: 1.5px solid var(--light-grey);
}

body.dark-mode #services{
    color: var(--light-grey);
    fill: var(--light-grey);
}

body.dark-mode .btn-line{
    border-left: 1.5px solid var(--light-grey);
    border-right: 1.5px solid var(--light-grey);
    color: var(--light-grey);
}

body.dark-mode .btn-line:active{
    background: var(--light-grey);
    color: var(--jet-black);
}

body.dark-mode .btn-line:focus-visible{
    outline: 2px solid var(--light-grey);
}

body.dark-mode #about-text p{
    color: var(--light-grey);
}

body.dark-mode a.highlight{
    color: var(--light-grey);
}

body.dark-mode a.highlight:hover{
    color: var(--red);
}

body.dark-mode footer{
    background-color: var(--dark-grey);
}

body.dark-mode .testimonial blockquote p{
    color: var(--light-grey);
}

body.dark-mode .testimonial figcaption::before{
    border-top: 1.5px solid var(--light-grey);
}

body.dark-mode .testimonial-name,
body.dark-mode .testimonial-role{
    color: var(--light-grey);
}

body.dark-mode .project-detail{
    color: var(--light-grey);
}

body.dark-mode .project-detail h2{
    color: var(--light-grey);
}

body.dark-mode .project-detail .project-subtitle{
    border-bottom: 1.5px solid var(--light-grey);
}

body.dark-mode .project-detail h3,
body.dark-mode .project-detail h4{
    color: var(--light-grey);
}

body.dark-mode .project-detail .section-title{
    color: var(--light-grey);
    border-bottom: 1.5px solid var(--light-grey);
}

body.dark-mode .result-box{
    background: var(--white);
    color: var(--jet-black);
}

/* ==========================================================================
   MEDIA QUERIES (screen-size changes), light mode first, then dark mode
   ========================================================================== */

/* CHANGE THIS ONE NUMBER to move the breakpoint (890px, 700px, etc.) */

@media (max-width: 890px){
    #menu-toggle{
        display: block;
        width: 44px;
        height: 44px;
        margin-left: .5rem;
    }

    #mode_toggle{
        margin-left: auto;   /* pushes toggle + hamburger to the right */
    }

    /* the same <nav> becomes a full-screen overlay */

    #nav{
        position: fixed;
        inset: 0;
        z-index: 2000;
        margin: 0;
        padding: 0;
        gap: 2rem;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: var(--dark-grey);
        opacity: 0;
        visibility: hidden;   /* also removes hidden links from keyboard tabbing */
        transition: opacity .3s ease, visibility .3s;
    }

    #nav.open{
        opacity: 1;
        visibility: visible;
    }

    #nav-close{
        display: block;
        position: absolute;
        top: 1.25rem;
        right: 1.25rem;
        width: 48px;
        height: 48px;
    }

    #nav ul{
        flex-direction: column;
        gap: .5rem;
        width: min(80vw, 320px);
    }

    .nav-home{
        display: block;   /* show HOME at the top of the menu */
    }

    #nav a{
        display: block;
        text-align: center;
        font-size: 1.1rem;
        padding: 1rem;
        color: var(--white);
        outline: 1px solid var(--white);
    }

    #nav a:hover{
        background: var(--white);
        color: var(--jet-black);
    }

    /* name at the bottom, like the logo in your reference */

    #nav::after{
        content: "JONATHAN NEWKIRK";
        position: absolute;
        bottom: 3rem;
        color: var(--white);
        font-family: var(--font-montserrat);
        font-weight: 600;
        letter-spacing: .15em;
    }
}

/* phones: the lines keep the same distance from the text as on larger screens, so the text
   is sized to leave room for them (it never goes below a readable 12px) */

@media (max-width: 700px){
    .lockup{
    --bio-size: clamp(12px, calc((87.2vw - 16px) / 22.7), 1rem);
    --title-size: max(12px, calc(var(--bio-size) * 1.03));
  }
}

/* small screens: the side lines are hidden (change 550px to show them on more or fewer screens) */

@media (max-width: 550px){
    .lockup::before,
  .lockup::after{ display: none; }
}

/* desktop only: more breathing room above and below the project buttons */

@media (min-width: 891px){
    .service-buttons{
        margin: 5rem auto 8rem;   /* top = space above the buttons, bottom = space under them */
    }
}

/* phones: a taller box so the tiles stay big enough */

@media (max-width: 700px){
    #mosaic{
        aspect-ratio: 4 / 3;
    }
}

/* small screens: less space above the name block and above the carousel */

@media (max-width: 550px){
    #top-logo{
        margin-top: 1rem;
    }

    #mosaic{
        margin-top: 1rem;
    }
}

@media (max-width:550px){
    .section-divider.testimonial-divider{ margin: 1.2rem auto 4.5rem; }
}

/* Every card gets the same height, so the gap between rows is identical
   no matter how many lines a card's text wraps to. */

@media (min-width: 1065px){
    #capabilities{
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 1fr;               /* all rows the same height */
        gap: 2rem 4rem;                    /* space between rows, space between columns */
        max-width: 1100px;                 /* stops the columns spreading apart on wide screens */
        margin-left: auto;
        margin-right: auto;                /* keeps the block centered */
    }

    .capability-card{
        justify-content: flex-start;       /* icons start at the top of each card */
    }

    /* an odd last card sits centered on its own row */

    .capability-card:last-child:nth-child(odd){
        grid-column: 1 / -1;
        justify-self: center;
        width: calc(50% - 2rem);
    }
}

/* fills in only while the mouse is over it (or while it is being pressed).
   Once clicked and the mouse moves away, it goes back to normal. The
   open project is NOT kept filled. */

@media (hover: hover){
    .btn-line:hover{
        background: var(--charcoal);
        color: var(--white);
    }

    body.dark-mode .btn-line:hover{
        background: var(--light-grey);
        color: var(--jet-black);
    }
}

/* phones: slightly smaller text so a long title fits on one line */

@media (max-width: 600px){
    .btn-line{
        font-size: .85rem;
        padding: .9em 1.1em;
    }
}

@media (max-width: 700px){
    #about-section{
        grid-template-columns: 1fr;   /* stack on phones */
    }
}

/* phones and small tablets: one quote per row */

@media (max-width: 800px){
    .testimonial-grid{
        grid-template-columns: 1fr;
        gap: 3.5rem;
    }
}

@media (max-width: 800px){
    .project-banner{
        aspect-ratio: 4 / 3;     /* a bit taller on phones so it isn't a thin strip */
    }
}

/* wide screens: all 4 steps in one row. CHANGE 1240px to move where it switches. */

@media (min-width: 1240px){
    .process-grid{
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* phones: one column */

@media (max-width: 600px){
    .process-grid{
        grid-template-columns: 1fr;
    }
}

/* desktop: reserve room for the title and subtitle so the Background heading
   starts in the same place in every project (a one-line title like
   "Style That Sells" doesn't pull everything upward). Background and Problem
   are NOT reserved, so Problem tucks right under the Background paragraph. */

@media (min-width: 801px){
    .project-text h2{
        min-height: 2em;                      /* title: two lines (line-height is 1) */
    }

    .project-text .project-subtitle{
        min-height: 3.12rem;                  /* subtitle: two lines */
    }
}

/* narrower desktops: the longer titles wrap to three lines */

@media (min-width: 801px) and (max-width: 999px){
    .project-text h2{
        min-height: 3em;
    }
}

@media (max-width: 800px){
    .project-intro{
        grid-template-columns: 1fr;    /* stack: image, then text */
        gap: 2rem;
    }
}
