/* ============================================================
   Blaise Cary portfolio - shared styles for every page
   ============================================================ */

/* ---------- Font ---------- */
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- Colours and sizes (change these to restyle the whole site) ---------- */
:root {
  --bg: #fff;            /* page background */
  --text: #000;          /* all text */
  --on-image: #fff;      /* text that sits on top of photos */
  --margin: 24px;        /* space at the left and right edges of the page */
  /* Left column: a quarter of the window, but never too narrow for the name */
  --sidebar-width: max(25vw, 365px);
  --gap: 8px;
}

/* ---------- Basics ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

/* ---------- Sidebar (left column on desktop, top bar on phones) ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  padding: 43px 0 0 var(--margin);
  text-align: left;
  background: var(--bg);
  z-index: 10;
}
.logo {
  display: inline-block;
  color: var(--text);
  font-size: 90px;
  font-weight: 700;
  line-height: 95px;
  text-decoration: none;
  text-transform: uppercase;
}
.logo:hover { opacity: 0.6; }
.menu-button { display: none; }
.nav { margin-top: 100px; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav a {
  display: inline-block;
  padding: 4px 0;
  color: var(--text);
  font-size: 30px;
  font-weight: 100;
  line-height: 38px;
  text-decoration: none;
  text-transform: uppercase;
}
.nav a:hover { opacity: 0.6; }
.nav a[aria-current="page"] { font-weight: 600; }
.social {
  display: flex;
  justify-content: flex-start;
  gap: 14px;
  margin-top: 64px;
}
.social a { color: var(--text); }
.social a:hover { opacity: 0.6; }
.social svg { width: 18px; height: 18px; display: block; }

/* ---------- Main area ---------- */
main {
  margin-left: var(--sidebar-width);
  padding-right: var(--margin);   /* same space on the right as on the left */
  min-height: 100vh;
}
.site-footer {
  margin-left: var(--sidebar-width);
  padding: 60px var(--margin) 40px;
  color: var(--text);
  font-size: 20px;
  font-weight: 500;
  text-align: right;
}

/* ---------- Home page: project tiles, wide rectangles stacked one above the other ---------- */
/* They fill everything right of the left column, up to the right-hand margin. */
.tiles {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 43px 0;
}
.tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;    /* wide rectangle */
  border-radius: 5px;      /* rounded corners */
  overflow: hidden;
  color: var(--on-image);
  text-decoration: none;
}
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.37);
  font-size: 50px;
  font-weight: 400;
  text-align: center;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.25s;
}
.tile:hover span, .tile:focus-visible span { opacity: 1; }

/* ---------- Project pages: full-screen cover ---------- */
.masthead {
  position: sticky;
  top: 0;
  margin-right: calc(-1 * var(--margin));   /* the cover photo still fills to the edge */
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: center / cover no-repeat;
}
.masthead::before { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.3); }
.masthead h1 {
  position: relative;
  margin: 0;
  padding: 0 24px;
  color: var(--on-image);
  font-size: 80px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}
.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  width: 18px;
  height: 18px;
  border-right: 2px solid var(--on-image);
  border-bottom: 2px solid var(--on-image);
  transform: translateX(-50%) rotate(45deg);
}
.project {
  position: relative;
  z-index: 1;
  background: var(--bg);
  padding-top: 40px;
}

/* ---------- Page titles and text blocks ---------- */
.page-title { padding: 0 24px; margin-bottom: 24px; }
.page-title h2 {
  margin: 0;
  color: var(--text);
  font-size: 50px;
  font-weight: 400;
  text-transform: uppercase;
}
.page-title p { margin: 6px 0 0; font-size: 20px; font-weight: 500; }
.text {
  max-width: 800px;
  padding: 0 24px;
  margin: 40px 0;
  font-size: 18px;
  font-weight: 400;
  line-height: 26px;
}
.text h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
}
.text p { margin: 0 0 12px; }
.text a { color: var(--text); }

/* ---------- Rows of images (1 to 6 side by side, all the same height) ---------- */
.row {
  display: flex;
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.row figure { margin: 0; min-width: 0; }
.row img { width: 100%; }

/* ---------- Two columns (About page) ---------- */
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.columns .text { margin-top: 0; }

/* ---------- About page ---------- */
.about { padding: 60px 0 0; }
.button {
  display: inline-block;
  margin-top: 12px;
  padding: 12px 22px;
  border: 1px solid var(--text);
  color: var(--text);
  text-decoration: none;
  text-transform: uppercase;
}
.button:hover { background: var(--text); color: var(--bg); }

/* ---------- Back-to-top button ---------- */
.to-top {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 20;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--text);
  font: 300 32px/1 inherit;
  font-family: inherit;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { opacity: 0.6; }

/* ---------- Not-found page ---------- */
.not-found { padding: 120px 24px; }

/* ============================================================
   Phones and small tablets (screens narrower than 900px)
   ============================================================ */
@media (max-width: 900px) {
  :root { --margin: 16px; }   /* smaller side margins on phones */
  .sidebar {
    position: sticky;
    inset: auto;
    top: 0;
    width: 100%;
    padding: 14px var(--margin);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .logo { font-size: 40px; line-height: 1; }
  .logo br { display: none; }
  .menu-button {
    display: block;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 0;
    background: none;
    color: var(--text);
    cursor: pointer;
  }
  .menu-button svg { width: 24px; height: 24px; display: block; }
  .nav {
    display: none;
    position: fixed;
    inset: 72px 0 0 0;
    margin: 0;
    padding: 32px 16px;
    background: var(--bg);
  }
  .nav.open { display: block; }
  .social { margin-top: 32px; }
  main, .site-footer { margin-left: 0; }
  main { padding-left: var(--margin); }
  .masthead { margin: 0 calc(-1 * var(--margin)); }
  .site-footer { padding: 40px var(--margin); font-size: 16px; }
  .tiles { padding: 16px 0; gap: 16px; }
  .tile { width: 100%; }
  .tile span { opacity: 1; background: rgba(0, 0, 0, 0.25); font-size: 32px; }
  .masthead { height: 70vh; }
  .masthead h1 { font-size: 44px; }
  .page-title, .text { padding: 0; }
  .page-title h2 { font-size: 32px; }
  .text { font-size: 16px; line-height: 24px; }
  .row { flex-direction: column; }
  .row figure { flex: none !important; }
  .columns { grid-template-columns: 1fr; gap: 24px; }
  .to-top { left: auto; right: 12px; bottom: 12px; }
}
