/* ============================================================
   robswain.au — styles.css
   ============================================================ */

/* ------------------------------------------------------------
   Custom Properties
   ------------------------------------------------------------ */
:root {
  /* Backgrounds — warm undertone so maroon accents feel at home */
  --bg-base:        #0f0b0b;
  --bg-surface:     #161010;
  /* Accents */
  --accent-maroon:  #800020;
  --accent-maroon-h:#a0002a;

  /* Text */
  --text-primary:   #ede8e8;
  --text-secondary: #a09898;
  --text-tertiary:  #635a5a;

  /* Borders */
  --border:         #2a2020;
  --border-light:   #352828;

  /* Typography */
  --font:           'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:      'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Layout */
  --max-width:      860px;
  --section-pad:    100px 24px;
  --radius-sm:      4px;

  /* Transitions */
  --transition:     200ms ease;
}

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

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

body {
  background-color: var(--bg-base);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul {
  list-style: none;
}

/* Selection colour */
::selection {
  background: var(--accent-maroon);
  color: #fff;
}

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--accent-maroon);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* Scrollbar (webkit) */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-maroon); }

/* ------------------------------------------------------------
   Typography
   ------------------------------------------------------------ */
h1, h2, h3, h4 {
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(48px, 8vw, 80px); font-weight: 700; }
h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }

p { color: var(--text-secondary); }

/* ------------------------------------------------------------
   Layout Utilities
   ------------------------------------------------------------ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: var(--section-pad);
}

/* Section heading with maroon left-tick */
.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 56px;
}

.section-heading::before {
  content: '';
  display: block;
  width: 4px;
  height: 1.2em;
  background: var(--accent-maroon);
  border-radius: 2px;
  flex-shrink: 0;
}

/* Fade-in animation (driven by IntersectionObserver in script.js) */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------
   Navigation
   ------------------------------------------------------------ */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background var(--transition), border-color var(--transition), backdrop-filter var(--transition);
  border-bottom: 1px solid transparent;
}

header.scrolled {
  background: rgba(13, 13, 13, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  transition: color var(--transition);
}

.nav-logo:hover {
  color: var(--accent-maroon);
}

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

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-maroon);
  transition: width var(--transition);
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  padding-top: 80px; /* offset for fixed nav */
}

.hero-label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

.hero-name {
  color: var(--accent-maroon);
  display: inline-block;
  margin-bottom: 12px;
}

/* Gradient rule between name and subtitle */
.hero-rule {
  display: block;
  width: 120px;
  height: 2px;
  background: var(--accent-maroon);
  border-radius: 1px;
  margin: 20px 0 24px;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.hero-tagline {
  font-size: 1rem;
  color: var(--text-tertiary);
  margin-bottom: 40px;
  max-width: 480px;
}


/* ------------------------------------------------------------
   About
   ------------------------------------------------------------ */
.about-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 56px;
  align-items: start;
}

/* Photo / monogram */
.about-photo-wrap {
  position: relative;
}

.about-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  display: block;
}

.about-bio p {
  margin-bottom: 16px;
  line-height: 1.75;
}

.about-bio p:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------
   Experience
   ------------------------------------------------------------ */
#experience {
  border-top: 1px solid var(--border);
}

.experience-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.experience-item {
  padding: 28px 0 28px 24px;
  border-left: 2px solid var(--border);
  position: relative;
  transition: border-color var(--transition);
}

.experience-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 36px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg-base);
  transition: background var(--transition);
}

.experience-item:hover {
  border-left-color: var(--accent-maroon);
}

.experience-item:hover::before {
  background: var(--accent-maroon);
}

.experience-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.experience-role {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.05rem;
}

.experience-company {
  color: var(--accent-maroon);
  font-weight: 500;
  font-size: 0.95rem;
}

.experience-dates {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  margin-left: auto;
}

.experience-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
}

.post-body p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 600px;
  margin-bottom: 16px;
}

.post-body p:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------
   Contact
   ------------------------------------------------------------ */
#contact {
  border-top: 1px solid var(--border);
  text-align: center;
}

.contact-inner {
  max-width: 520px;
  margin: 0 auto;
}

.contact-heading {
  margin-bottom: 16px;
}

.contact-sub {
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.7;
}

.btn-contact {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: var(--accent-maroon);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: background var(--transition), transform var(--transition);
  margin-bottom: 40px;
}

.btn-contact:hover {
  background: var(--accent-maroon-h);
  transform: translateY(-1px);
}

.btn-contact svg {
  width: 18px;
  height: 18px;
}

.contact-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.contact-socials a {
  color: var(--text-tertiary);
  transition: color var(--transition);
  line-height: 0;
}

.contact-socials a:hover {
  color: var(--text-primary);
}

.contact-socials svg {
  width: 24px;
  height: 24px;
}

/* ------------------------------------------------------------
   Scroll Arrow
   ------------------------------------------------------------ */
.scroll-arrow {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  opacity: 0.5;
  transition: opacity var(--transition), transform var(--transition);
  padding: 8px;
  line-height: 0;
  animation: arrow-bob 2s ease-in-out infinite;
}

.scroll-arrow svg {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.scroll-arrow:hover {
  opacity: 1;
  animation-play-state: paused;
}

.scroll-arrow.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
}

.scroll-arrow--up {
  bottom: auto;
  top: 72px; /* clears the fixed nav header */
}

.scroll-arrow--up.hidden {
  transform: translateX(-50%) translateY(-8px);
}

@keyframes arrow-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

@keyframes arrow-bob-up {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(-6px); }
}

.scroll-arrow--up:not(.hidden) {
  animation-name: arrow-bob-up;
}

/* ------------------------------------------------------------
   Utilities
   ------------------------------------------------------------ */

/* Inline body links that use the accent colour */
.link-accent {
  color: var(--accent-maroon);
}

/* Services: deliverables block follows the areas list */
#posture-review .experience-list + .about-bio {
  margin-top: 48px;
}

/* Contact page: left-aligned variant of .contact-inner */
.contact-inner--left {
  text-align: left;
}

/* Contact page: reach section paragraph spacing */
#reach p {
  margin-bottom: 32px;
  line-height: 1.75;
}

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
footer {
  border-top: 1px solid var(--border);
  padding: 24px;
}

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

.footer-inner span {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 640px) {
  :root {
    --section-pad: 72px 20px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .about-photo {
    width: 100px;
    height: 100px;
  }

  .experience-meta {
    flex-direction: column;
    gap: 4px;
  }

  .experience-dates {
    margin-left: 0;
  }

  .nav-links {
    gap: 20px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .hero-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}
