/* ============================================================
   JAMIESON ROTHWELL PORTFOLIO — style.css
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@500;700&display=swap');

/* ============================================================
   CSS VARIABLES — LIGHT MODE
   ============================================================ */
:root {
  color-scheme: light dark;

  --bg:         #F0F1F1;
  --charcoal:   #000000;
  --grey:       #454747;
  --dark-grey:  #1E1E1E;
  --off-white:  #F0F1F1;
  --border:     rgba(0, 0, 0, 0.08);
  --footer-border: rgba(0, 0, 0, 0.12);
  --card-bg:    #e2e3e3;

  --max-width:   1362px;
  --section-gap: 80px;
  --nav-height:  68px;
}

/* ============================================================
   DARK MODE — system preference only, no manual toggle
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #141414;
    --charcoal:     #F0F1F1;
    --grey:         #9A9B9B;
    --dark-grey:    #E8E8E8;
    --off-white:    #141414;
    --border:       rgba(255, 255, 255, 0.08);
    --footer-border: rgba(255, 255, 255, 0.12);
    --card-bg:      #2A2A2A;
  }

  body,
  .page-wrapper {
    background-color: #141414;
    color: #F0F1F1;
  }

  .site-nav {
    background-color: #141414;
  }

  .footer-divider {
    background-color: #F0F1F1;
  }
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ============================================================
   FOCUS STYLES — keyboard navigation
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--charcoal);
  outline-offset: 4px;
  border-radius: 4px;
}

.cs-card:focus-visible {
  outline: 2px solid var(--charcoal);
  outline-offset: 8px;
  border-radius: 12px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Figtree', sans-serif;
  background-color: var(--bg);
  color: var(--charcoal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

/* ============================================================
   PAGE WRAPPER
   ============================================================ */
.page-wrapper {
  background-color: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   CONTAINER
   ============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg);
  width: 100%;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 20px;
  font-weight: 500;
  color: var(--charcoal);
  line-height: normal;
  transition: opacity 0.2s ease;
}

.nav-logo:hover { opacity: 0.6; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-links a {
  font-size: 20px;
  font-weight: 500;
  color: var(--charcoal);
  line-height: normal;
  transition: opacity 0.2s ease;
}

.nav-links a:hover { opacity: 0.6; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

/* Display / H1 */
h1, .display-heading {
  font-size: 96px;
  font-weight: 700;
  line-height: 90px;
  letter-spacing: -1.92px;
  color: var(--charcoal);
}

/* H3 */
h3, .h3 {
  font-size: 40px;
  font-weight: 500;
  line-height: 40px;
  color: var(--charcoal);
}

/* H4 */
h4, .h4 {
  font-size: 36px;
  font-weight: 500;
  line-height: 32px;
  color: var(--grey);
}

/* H5 */
h5, .h5 {
  font-size: 32px;
  font-weight: 500;
  line-height: 32px;
  letter-spacing: -3px;
  color: var(--charcoal);
}

/* H6 / Nav */
h6, .h6 {
  font-size: 20px;
  font-weight: 500;
  line-height: normal;
  color: var(--charcoal);
}

/* Section Heading */
.section-heading {
  font-size: 64px;
  font-weight: 700;
  line-height: 68px;
  letter-spacing: -1.28px;
  color: var(--dark-grey);
}

/* Section Body */
.section-body {
  font-size: 18px;
  font-weight: 500;
  line-height: 28px;
  color: var(--charcoal);
}

.section-body p + p {
  margin-top: 16px;
}

.section-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}

.section-body a:hover { opacity: 0.6; }

/* Sub-heading */
.sub-heading {
  font-size: 36px;
  font-weight: 500;
  line-height: 32px;
  color: var(--grey);
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding-top: var(--section-gap);
}

.section:last-of-type {
  padding-bottom: var(--section-gap);
}

.section-inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.section-text {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ============================================================
   HERO — INDEX PAGE
   ============================================================ */
.hero-section {
  padding-top: 60px;
  padding-bottom: 40px;
  overflow: hidden;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  position: relative;
}

.hero-text {
  flex: 1;
  max-width: 700px;
  padding-top: 20px;
}

.hero-text h1 {
  margin-bottom: 24px;
}

.hero-text .hero-subtitle {
  font-size: 36px;
  font-weight: 500;
  line-height: 40px;
  color: var(--grey);
}

.hero-image {
  flex-shrink: 0;
  width: 700px;
  height: 700px;
  border-radius: 16px;
  overflow: hidden;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ============================================================
   CASE STUDY CARDS
   ============================================================ */
.cs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.cs-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: opacity 0.25s ease;
}

.cs-card:hover { opacity: 0.85; }

.cs-card:hover .cs-card-image img {
  transform: scale(1.03);
}

.cs-card-image {
  aspect-ratio: 440 / 443;
  border-radius: 10px;
  overflow: hidden;
  background-color: var(--card-bg);
}

.cs-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 10px;
  transition: transform 0.4s ease;
}

.cs-card-title {
  font-size: 28px;
  font-weight: 500;
  line-height: 32px;
  color: var(--charcoal);
}

/* ============================================================
   CASE STUDY HERO
   ============================================================ */
.cs-hero {
  padding-top: 48px;
}

.cs-hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.cs-hero-text {
  margin-bottom: 36px;
}

.cs-hero-text h1 {
  margin-bottom: 20px;
  white-space: pre-line;
}

.cs-hero-text .cs-hero-subtitle {
  font-size: 28px;
  font-weight: 500;
  line-height: 36px;
  color: var(--grey);
  max-width: 900px;
}

.cs-hero-image {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
}

.cs-hero-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

/* ============================================================
   IMAGE LAYOUTS
   ============================================================ */
.img-full {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

.img-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.img-grid-2 img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

.img-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.img-grid-3 img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

.img-grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.img-grid-4 img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

.img-with-label {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.img-with-label img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

.img-label {
  font-size: 18px;
  font-weight: 500;
  color: var(--grey);
  text-align: center;
}

/* ============================================================
   IMAGE GAP STACKS
   ============================================================ */
.image-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ============================================================
   ABOUT SECTION
   ============================================================ */
.about-section {
  padding-top: var(--section-gap);
  padding-bottom: var(--section-gap);
}

.about-inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  margin-top: auto;
  padding-bottom: 40px;
}

.footer-divider {
  width: 100%;
  height: 1px;
  background-color: var(--charcoal);
  margin-bottom: 36px;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 48px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col-heading {
  font-size: 18px;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.footer-col a,
.footer-col p {
  font-size: 18px;
  font-weight: 500;
  color: var(--grey);
  line-height: normal;
  transition: opacity 0.2s ease;
}

.footer-col a:hover { opacity: 0.6; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--footer-border);
}

.footer-bottom span,
.footer-bottom a {
  font-size: 18px;
  font-weight: 500;
  color: var(--grey);
}

.back-to-top { transition: opacity 0.2s ease; }
.back-to-top:hover { opacity: 0.6; }

/* ============================================================
   UTILITY
   ============================================================ */
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }

.white-bg {
  background-color: #ffffff;
  border-radius: 10px;
  padding: 10px;
}

.white-bg img {
  border-radius: 6px;
}

/* Disclaimer / NDA note */
.text-note {
  font-size: 16px;
  font-weight: 500;
  font-style: italic;
  color: var(--grey);
  line-height: 24px;
}

/* ============================================================
   RESPONSIVE — 1024px
   ============================================================ */
@media (max-width: 1024px) {
  h1, .display-heading {
    font-size: 72px;
    line-height: 68px;
  }

  .section-heading {
    font-size: 48px;
    line-height: 52px;
  }

  .hero-image {
    width: 500px;
    height: 500px;
  }

  .cs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-columns {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================================
   RESPONSIVE — 768px  (iPad Mini portrait and below)
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --section-gap: 48px;
  }

  h1, .display-heading {
    font-size: 52px;
    line-height: 54px;
    letter-spacing: -1px;
  }

  .section-heading {
    font-size: 36px;
    line-height: 40px;
    letter-spacing: -0.5px;
  }

  .section-body {
    font-size: 16px;
    line-height: 26px;
  }

  .sub-heading {
    font-size: 24px;
    line-height: 30px;
  }

  h3, .h3 {
    font-size: 28px;
    line-height: 32px;
  }

  h4, .h4 {
    font-size: 22px;
    line-height: 28px;
  }

  /* Hero */
  .hero-section {
    overflow: visible;
  }

  .hero-inner {
    flex-direction: column-reverse;
    align-items: stretch;
    justify-content: flex-start;
    gap: 24px;
  }

  .hero-image {
    width: 100%;
    height: 360px;
    position: relative;
  }

  .hero-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
  }

  .hero-text {
    max-width: 100%;
    padding-top: 0;
  }

  .hero-text .hero-subtitle {
    font-size: 22px;
    line-height: 28px;
  }

  /* Case study hero */
  .cs-hero-text h1 {
    white-space: normal;
  }

  .cs-hero-text .cs-hero-subtitle {
    font-size: 20px;
    line-height: 28px;
  }

  /* Cards */
  .cs-grid {
    grid-template-columns: 1fr;
  }

  .cs-card-title {
    font-size: 22px;
    line-height: 28px;
  }

  /* Grids */
  .img-grid-2,
  .img-grid-3,
  .img-grid-4 {
    grid-template-columns: 1fr;
  }

  /* Nav */
  .nav-links {
    gap: 20px;
  }

  .nav-links a,
  .nav-logo {
    font-size: 16px;
  }

  /* Footer */
  .footer-columns {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .footer-col a,
  .footer-col p,
  .footer-col-heading {
    font-size: 15px;
  }

  .footer-bottom span,
  .footer-bottom a {
    font-size: 13px;
  }
}

/* ============================================================
   RESPONSIVE — 430px  (iPhone 14 Pro and smaller)
   ============================================================ */
@media (max-width: 430px) {
  :root {
    --section-gap: 40px;
  }

  h1, .display-heading {
    font-size: 38px;
    line-height: 42px;
    letter-spacing: -0.5px;
  }

  .section-heading {
    font-size: 26px;
    line-height: 30px;
    letter-spacing: -0.3px;
  }

  .section-body {
    font-size: 15px;
    line-height: 24px;
  }

  h3, .h3 {
    font-size: 22px;
    line-height: 26px;
  }

  /* Hero */
  .hero-section {
    padding-top: 32px;
    padding-bottom: 24px;
  }

  .hero-image {
    height: 300px;
    position: relative;
  }

  .hero-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
  }

  .hero-text .hero-subtitle {
    font-size: 18px;
    line-height: 26px;
  }

  /* Case study hero */
  .cs-hero {
    padding-top: 28px;
  }

  .cs-hero-text .cs-hero-subtitle {
    font-size: 17px;
    line-height: 24px;
  }

  /* Cards */
  .cs-card-title {
    font-size: 18px;
    line-height: 24px;
  }

  /* Nav */
  .nav-links {
    gap: 16px;
  }

  .nav-links a,
  .nav-logo {
    font-size: 15px;
  }

  /* Footer */
  .footer-columns {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}

/* ============================================================
   RESPONSIVE — 480px  (kept for any legacy overrides)
   ============================================================ */
@media (max-width: 480px) {
  .footer-columns {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}
