/* ===========================================================
   Jake Amaral — Cape Town Portfolio
   Palette: UF Orange #FA4616 / UF Blue #0021A5
   =========================================================== */

:root {
  --uf-blue: #0021A5;
  --uf-blue-dark: #001a80;
  --uf-orange: #FA4616;
  --ink: #16181d;
  --body: #3f444e;
  --muted: #767d8a;
  --line: #e3e6ec;
  --bg: #ffffff;
  --bg-soft: #f6f7fa;
  --radius: 12px;
  --shadow: 0 2px 14px rgba(16, 24, 48, 0.07);
  --wrap: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 .6rem;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1.1rem; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .9rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--uf-blue);
  letter-spacing: -0.01em;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
}

.nav-btn {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-size: .93rem;
  color: var(--body);
  padding: .45rem .8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.nav-btn:hover { background: var(--bg-soft); color: var(--ink); }

.nav-btn.active {
  background: var(--uf-blue);
  color: #fff;
  font-weight: 600;
}

/* ---------------- Layout ---------------- */

main {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem) 4rem;
}

.tab-panel { display: none; animation: fade .28s ease both; }
.tab-panel.active { display: block; }

@keyframes fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

h2 { position: relative; padding-bottom: .7rem; margin-bottom: 1.8rem; }
h2::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 62px; height: 4px;
  border-radius: 2px;
  background: var(--uf-orange);
}

.prose { max-width: 74ch; }

/* ---------------- Photo slots ---------------- */

.photo-slot {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}

/* Images keep their own proportions -- portrait and landscape both fit
   without cropping heads off. */
.photo-slot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* shown only when the image file is missing */
.photo-slot.missing img { display: none; }

.photo-slot.missing::before {
  content: attr(data-label);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 240px;
  height: 100%;
  padding: 1.5rem;
  color: var(--muted);
  font-size: .88rem;
  letter-spacing: .02em;
  border: 2px dashed #cfd5e0;
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(45deg, #fafbfd 0 12px, #f3f5f9 12px 24px);
}

/* ---------------- Home ---------------- */

.hero {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  align-items: center;
}

.hero-photo { box-shadow: var(--shadow); }

.hero-sub {
  color: var(--uf-orange);
  font-weight: 600;
  letter-spacing: .01em;
  margin-bottom: 1.6rem;
}

.hero-facts {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  border-top: 1px solid var(--line);
}

.hero-facts li {
  padding: .85rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 500;
}

.hero-facts span {
  display: block;
  font-size: .72rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: .1rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; }

.cta {
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  padding: .6rem 1.15rem;
  border-radius: 999px;
  border: 1.5px solid var(--uf-blue);
  background: #fff;
  color: var(--uf-blue);
  transition: background .15s, color .15s, transform .15s;
}

.cta:hover {
  background: var(--uf-blue);
  color: #fff;
  transform: translateY(-1px);
}

/* ---------------- Split (text + photo) ---------------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.split .photo-slot {
  position: sticky;
  top: 100px;
  box-shadow: var(--shadow);
}

.split-text h2 { margin-top: -.4rem; }

/* ---------------- Gallery ---------------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.2rem, 3vw, 2rem);
  align-items: start;
}

.gallery-item { background: none; }
.gallery-item img { box-shadow: var(--shadow); }

.gallery-item figcaption {
  margin-top: .8rem;
  font-size: .93rem;
  color: var(--muted);
  line-height: 1.55;
}

.gallery-item.missing::before { min-height: 220px; }

/* ---------------- Safe Cities ---------------- */

.wide-photo {
  margin-bottom: 2.2rem;
  box-shadow: var(--shadow);
}

.wide-photo.missing::before { min-height: 300px; }

/* The Safe Cities logo is a small square -- show it at its own size
   rather than stretching it across the column. */
.logo-photo {
  max-width: 220px;
  margin: 0 0 2.4rem;
  background: none;
}

.logo-photo.missing::before { min-height: 200px; }

.disciplines { margin: 1.6rem 0 0; }

.disciplines dt {
  font-weight: 700;
  color: var(--uf-blue);
  margin-top: 1.5rem;
  font-size: 1.02rem;
}

.disciplines dd {
  margin: .45rem 0 0 1.4rem;
  position: relative;
}

.disciplines dd::before {
  content: "";
  position: absolute;
  left: -1.15rem;
  top: .72em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--uf-orange);
}

/* ---------------- Project ---------------- */

/* Single feature photo, centred so a tall portrait shot doesn't
   run the full width of the column. */
.single-photo {
  max-width: 520px;
  margin: 0 auto 2.6rem;
  box-shadow: var(--shadow);
}

.single-photo.missing::before { min-height: 300px; }

/* ---------------- Demo video ---------------- */

.download-card {
  max-width: 620px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3rem) clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.download-lead {
  margin: 0 0 1.8rem;
  color: var(--body);
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .85rem 1.7rem;
  border-radius: 999px;
  background: var(--uf-blue);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s, transform .15s;
}

.download-btn:hover {
  background: var(--uf-blue-dark);
  transform: translateY(-1px);
}

.download-icon { font-size: 1.15em; line-height: 1; }

.download-meta {
  margin: 1rem 0 0;
  font-size: .84rem;
  color: var(--muted);
  letter-spacing: .02em;
}

/* ---------------- Journey / week tabs ---------------- */

.week-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.week-btn {
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  padding: .5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--body);
  transition: all .15s;
}

.week-btn:hover { border-color: var(--uf-orange); color: var(--ink); }

.week-btn.active {
  background: var(--uf-orange);
  border-color: var(--uf-orange);
  color: #fff;
}

.week-panel { display: none; animation: fade .25s ease both; }
.week-panel.active { display: block; }

.week-panel h3 {
  margin-top: -.35rem;
  margin-bottom: 1rem;
  color: var(--uf-blue);
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 1rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: .85rem;
  color: var(--muted);
}

/* ---------------- Responsive ---------------- */

/* Seven tabs need room -- drop the nav onto its own full-width row
   before it starts wrapping awkwardly beside the title. */
@media (max-width: 1100px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: .55rem;
  }

  .main-nav { width: 100%; }

  .nav-btn { font-size: .88rem; padding: .45rem .62rem; }
}

@media (max-width: 860px) {
  .hero,
  .split { grid-template-columns: 1fr; }

  .split .photo-slot {
    position: static;
    order: -1;
    margin-bottom: 1.2rem;
  }

  .split-text { order: 1; }

  /* keep tall portrait shots from swallowing the whole screen */
  .hero-photo,
  .split .photo-slot {
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 620px) {
  body { font-size: 16px; }

  .site-header { justify-content: center; }
  .main-nav { justify-content: center; }
  .nav-btn { font-size: .85rem; padding: .4rem .65rem; }

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

@media print {
  .site-header, .hero-actions, .week-tabs { display: none; }
  .tab-panel, .week-panel { display: block !important; }
}
