/* ============================================
   Ian Cameron Portfolio — style.css
   Responsive, cross-browser safe
   Fonts: DM Serif Display (headings) + DM Sans (body)
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.7;
  color: #1a1a1a;
  background-color: #fafaf8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --- CSS Variables --- */
:root {
  --color-bg: #fafaf8;
  --color-surface: #ffffff;
  --color-text-primary: #1a1a1a;
  --color-text-secondary: #555550;
  --color-text-muted: #757570;
  --color-border: rgba(26, 26, 26, 0.12);
  --color-border-strong: rgba(26, 26, 26, 0.2);
  --color-accent: #1a1a1a;

  --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  --max-width: 760px;
  --radius-sm: 4px;
  --radius-md: 8px;
}

/* --- Gradient background animation --- */
.gradient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}

.orb-1 {
  width: 80vw;
  height: 80vw;
  background: radial-gradient(circle, rgba(200, 190, 175, 0.75) 0%, transparent 70%);
  top: -20%;
  left: -10%;
  animation: drift1 28s ease-in-out infinite;
}

.orb-2 {
  width: 65vw;
  height: 65vw;
  background: radial-gradient(circle, rgba(180, 190, 205, 0.6) 0%, transparent 70%);
  bottom: 10%;
  right: -15%;
  animation: drift2 34s ease-in-out infinite;
}

.orb-3 {
  width: 55vw;
  height: 55vw;
  background: radial-gradient(circle, rgba(205, 195, 175, 0.55) 0%, transparent 70%);
  top: 40%;
  left: 30%;
  animation: drift3 22s ease-in-out infinite;
}

@keyframes drift1 {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(8%, 12%); }
  66%  { transform: translate(-5%, 20%); }
  100% { transform: translate(0, 0); }
}

@keyframes drift2 {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-10%, -8%); }
  66%  { transform: translate(6%, -15%); }
  100% { transform: translate(0, 0); }
}

@keyframes drift3 {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(-12%, 8%); }
  100% { transform: translate(0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .gradient-orb { animation: none; }
}

/* --- Layout --- */
.site {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Nav --- */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem clamp(1.5rem, 5vw, 4rem);
  /*max-width: calc(var(--max-width) + 8rem);*/
  margin: 0 auto;
  width: 100%;
}

.nav-logo {
  display: block;
  height: 60px;
  width: auto;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text-secondary);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--color-text-primary);
}

/* --- Main Content Wrapper --- */
main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 2rem);
  width: 100%;
}

/* --- Hero Portrait --- */
.hero-portrait {
  display: block;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  margin-bottom: 1.75rem;
  filter: grayscale(100%);
  opacity: 0.9;
  border: 1px solid var(--color-border);
}

/* --- Hero --- */
.hero {
  padding: clamp(3rem, 8vw, 5rem) 0 clamp(3rem, 8vw, 5rem);
  position: relative;
}

.hero-eyebrow {
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 1.75rem;
  font-weight: 400;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5.5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--color-text-primary);
  margin-bottom: 1.75rem;
  letter-spacing: -0.01em;
}

.hero-headline em {
  font-style: italic;
  color: var(--color-text-primary);
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  line-height: 1.75;
  color: var(--color-text-secondary);
  max-width: 560px;
  margin-bottom: 2rem;
  font-weight: 300;
}

.br-desktop {
  display: none;
}

@media (min-width: 600px) {
  .br-desktop { display: block; }
}

.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border-strong);
  padding-bottom: 1px;
  transition: border-color 0.2s ease, gap 0.2s ease;
}

.cta-link:hover {
  border-color: var(--color-text-primary);
  gap: 0.625rem;
}

/* --- Section Label --- */
.section-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 400;
  margin-bottom: 2.5rem;
}

/* --- Full-width section dividers --- */
.hero::after,
.work-section::after,
.approach-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 1px;
  background-color: var(--color-border);
}

/* --- Work Section --- */
.work-section {
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  position: relative;
}

.work-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.work-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 2rem;
  padding: 2.25rem 0;
  border-bottom: 1px solid var(--color-border);
}

.work-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.work-meta {
  padding-top: 4px;
}

.work-year {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-weight: 400;
  margin-bottom: 0.75rem;
  white-space: nowrap;
}

.work-tags {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.work-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-text-primary);
  margin-bottom: 0.875rem;
  letter-spacing: -0.01em;
}

.work-desc {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--color-text-secondary);
  font-weight: 300;
  margin-bottom: 1rem;
}

.case-study-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

.case-study-note svg {
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.awards-row {
  margin-bottom: 0.75rem;
}

.award-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 20px;
  padding: 4px 12px;
}

.award-badge svg {
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

/* --- Approach Section --- */
.approach-section {
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  position: relative;
}

.approach-grid {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 3rem;
  align-items: start;
}

.approach-body {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.approach-body p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text-secondary);
  font-weight: 300;
}

.approach-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 1rem;
  padding-top: 4px;
}

.stat-block {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--color-text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--color-text-muted);
  font-weight: 400;
}

/* --- Footer / Contact --- */
.footer-section {
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 5vw, 2rem);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
}

.footer-cta {
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 3vw, 1.375rem);
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-text-primary);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--color-text-primary);
}

.footer-link svg {
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.footer-right-block {
  text-align: right;
  flex-shrink: 0;
}

.footer-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 0.25rem;
}

.footer-location {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* --- Design note --- */
.design-note {
  text-align: center;
  padding: 2rem clamp(1.5rem, 5vw, 2rem) 3rem;
}

.design-note-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 0.875rem;
}

.time-icon {
  display: block;
  color: var(--color-text-muted);
  opacity: 0.2;
  transition: opacity 0.3s ease, color 0.3s ease;
}

.time-icon.active {
  opacity: 1;
  color: var(--color-text-primary);
}

.design-note p {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
}

/* --- Responsive: Tablet --- */
@media (max-width: 680px) {
  .nav {
    padding: 1.5rem clamp(1.25rem, 5vw, 2rem);
  }

  .work-item {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 2rem 0;
  }

  .work-meta {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding-top: 0;
  }

  .work-tags {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
  }

  .approach-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .approach-stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
  }

  .footer-right-block {
    text-align: left;
  }

  .hero-portrait {
    width: 70px;
    height: 70px;
  }

  .nav-logo {
    height: 40px;
  }
}

/* --- Responsive: Mobile --- */
@media (max-width: 480px) {
  .nav-links {
    gap: 1.25rem;
  }

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

  .footer-cta {
    font-size: 1.125rem;
  }

  .hero-portrait {
    width: 70px;
    height: 70px;
  }

  .nav-logo {
    height: 40px;
  }
}

/* --- Skip link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--color-text-primary);
  color: var(--color-bg);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* --- Focus styles for accessibility --- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-text-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* --- Print styles --- */
@media print {
  .nav-links,
  .cta-link,
  .footer-links { display: none; }
  body { background: white; color: black; }
  .hero, .work-section, .approach-section { border-color: #ccc; }
}
