/* ---------- Colours and fonts: change these in one place ---------- */
:root {
  --bg: #1c1d1f;
  --bg-soft: #26282b;
  --text: #ecebe6;
  --text-dim: #a9a9a4;
  --accent: #0ba6e8;          /* Atelier Designs brand blue — thin lines and hover colour */
  /* Century Gothic isn't a free font, so it can't be hosted here for everyone to download.
     Naming it first means anyone who has it installed (it ships with MS Office) sees the
     real thing; everyone else gets Jost, a free geometric sans that's a close match. */
  --heading-font: "Century Gothic", "Jost", "Poppins", sans-serif;
  --body-font: "Century Gothic", "Jost", "Poppins", sans-serif;
  --header-height: 72px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-height); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body-font);
  font-size: 1.15rem;
  line-height: 1.7;
}

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

/* ---------- Header ---------- */
header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;   /* logo | nav | spacer, so nav sits dead-centre */
  align-items: center;
  padding: 0 clamp(16px, 4vw, 48px);
  background: rgba(28, 29, 31, 0.92);
  backdrop-filter: blur(6px);
  z-index: 10;
}
.header-logo { justify-self: start; }
.header-logo img { height: 44px; width: auto; }

nav { grid-column: 2; justify-self: center; }
nav ul { display: flex; gap: clamp(16px, 3vw, 40px); list-style: none; }
nav a {
  font-family: var(--heading-font);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}
nav a:hover, nav a:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg-soft) url("../images/hero.jpg") center / cover no-repeat;
}
.hero::before {              /* a light vignette to keep the header/nav readable over the photo */
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
}

.scroll-hint {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 1px;
  height: 56px;
  background: var(--text);
  opacity: 0.7;
}

/* ---------- Sections ---------- */
section { padding: clamp(72px, 10vw, 128px) clamp(16px, 4vw, 48px); }

.section-title {
  font-family: var(--heading-font);
  font-size: 2.55rem;   /* 3x the original 0.85rem */
  font-weight: 600;
  letter-spacing: 0.1em;   /* tightened from 0.35em — that spacing was tuned for small caps text, too wide at this size */
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 40px;
  text-align: center;
}

/* About: centred, single column */
.about-grid {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.about-text p + p { margin-top: 1.2em; }
.about-text .lead { font-size: 1.3rem; font-weight: 500; letter-spacing: 0.01em; }
.about-text p { color: var(--text-dim); }
.about-text .lead { color: var(--text); }

/* Projects: coverflow-style carousel — one large centred photo, neighbours
   peeking either side. JS (js/projects-carousel.js) keeps the centred one
   marked .is-active and re-centres a photo when you hover or focus it. */
#projects { background: var(--bg-soft); text-align: center; overflow: hidden; }
.projects-inner { max-width: 100%; margin: 0 auto; }
.project-carousel {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-block: 10px 28px;
  margin-inline: clamp(-16px, -4vw, -48px);   /* bleed past the section's side padding for a fuller peek */
  text-align: left;
  scrollbar-width: none;        /* Firefox: hidden — hover/focus drives navigation */
}
.project-carousel::-webkit-scrollbar { display: none; }

.project-link {
  /* Fixed box — never resized or moved by the active/inactive state, so it can't
     shift out from under the pointer mid-transition and re-trigger itself.
     Only the .project figure inside it visually scales. */
  display: block;
  position: relative;
  flex: 0 0 clamp(280px, 46vw, 620px);
  scroll-snap-align: center;
  opacity: 0.4;
  filter: saturate(0.7);
  transition: opacity 0.5s ease, filter 0.5s ease;
  z-index: 1;
}
.project-link.is-active {
  opacity: 1;
  filter: none;
  z-index: 2;
}
.project {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--bg);
  cursor: pointer;
  border-radius: 2px;
  transform: scale(0.86);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.project-link.is-active .project { transform: scale(1); }
.project img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.project-link.is-active .project img:hover { transform: scale(1.04); }
.project figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 48px 24px 18px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  font-family: var(--heading-font);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
}
.project-link.is-active .project figcaption { opacity: 1; transform: none; }

/* Contact */
.contact-inner { max-width: 620px; margin: 0 auto; text-align: center; }
.contact-inner .intro { color: var(--text-dim); margin-bottom: 36px; }

form { display: grid; gap: 14px; text-align: left; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { position: absolute; left: -9999px; }   /* hidden visually, still read by screen readers */
input, textarea {
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  color: var(--text);
  border: 1px solid #494b4f;
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.2s;
}
input::placeholder, textarea::placeholder { color: #85857f; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 150px; resize: vertical; }

button {
  justify-self: center;
  margin-top: 8px;
  padding: 14px 40px;
  background: var(--text);
  color: var(--bg);
  border: 0;
  cursor: pointer;
  font-family: var(--heading-font);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  transition: background 0.2s;
}
button:hover, button:focus-visible { background: var(--accent); outline: none; }

.contact-details { margin-top: 56px; color: var(--text-dim); }
.contact-details p + p { margin-top: 4px; }

footer {
  padding: 28px 16px;
  text-align: center;
  font-family: var(--heading-font);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #6f6f6a;
  border-top: 1px solid #2f3134;
}

/* ---------- Project detail page ---------- */
.project-page main { padding-top: var(--header-height); }
.project-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-soft);
}
.project-hero img { width: 100%; height: 100%; object-fit: cover; }

.back-link {
  display: inline-block;
  margin: 32px clamp(16px, 4vw, 48px) 0;
  font-family: var(--heading-font);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-dim);
  transition: color 0.2s;
}
.back-link:hover, .back-link:focus-visible { color: var(--accent); outline: none; }

.project-body {
  max-width: 800px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) clamp(16px, 4vw, 48px);
}
.project-body h1 {
  font-family: var(--heading-font);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}
.project-meta {
  font-family: var(--heading-font);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 32px;
}
.project-body p { color: var(--text-dim); margin-top: 1.2em; }
.project-body p:first-of-type { margin-top: 0; }

.project-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 48px clamp(16px, 4vw, 48px) 0;
  max-width: 1100px;
  margin-inline: auto;
}
.project-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; }
  nav a { letter-spacing: 0.14em; font-size: 0.72rem; }
  .project-gallery { grid-template-columns: 1fr; }
}

/* Contact form availability and direct email fallback. */
#contact-form button:disabled { opacity: .5; cursor: not-allowed; background: var(--text); }
#form-status { font-size: .9rem; line-height: 1.6; color: var(--text-dim); margin: 4px 0 0; }
.contact-details a { color: var(--accent); overflow-wrap: anywhere; text-decoration: underline; text-underline-offset: 4px; }
