/* ================================================
   Robert Ryan — Earth Cycle CV  |  style.css
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Design Tokens ── */
:root {
  --sidebar-w: 268px;

  /* Greens */
  --g-darkest : #0a1810;
  --g-dark    : #0f2018;
  --g-mid     : #2d6a4f;
  --g-bright  : #52b788;
  --g-pale    : #edf5f0;
  --g-faint   : #f5faf7;

  /* Gold */
  --gold      : #c8873a;
  --gold-pale : #fdf5e8;

  /* Text */
  --t1        : #1a2820;
  --t2        : #3d5248;
  --t3        : #6a8278;

  /* Sidebar text */
  --st1       : #c5dbd0;
  --st2       : #7a9888;

  /* Utility */
  --white     : #ffffff;
  --bg-alt    : #f3f8f5;
  --border    : #d6e8de;
  --blight    : #eaf2ed;

  /* Shadows */
  --sh-sm   : 0 2px 10px rgba(10,24,16,.08);
  --sh-md   : 0 6px 28px rgba(10,24,16,.12);
  --sh-lg   : 0 16px 52px rgba(10,24,16,.18);

  /* Radii */
  --r  : 10px;
  --rl : 16px;
}

/* ── Reset ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', sans-serif;
  color: var(--t1);
  background: var(--white);
  display: flex;
  min-height: 100vh;
  line-height: 1.65;
}

img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }

/* ================================================
   SIDEBAR
   ================================================ */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--g-dark);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 200;
  border-right: 1px solid rgba(255,255,255,.05);
  transition: transform .3s ease;
}

.sidebar::-webkit-scrollbar         { width: 3px; }
.sidebar::-webkit-scrollbar-track   { background: transparent; }
.sidebar::-webkit-scrollbar-thumb   { background: var(--g-mid); border-radius: 2px; }

/* Branding */
.sb-brand {
  padding: 30px 26px 22px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.sb-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
}

.sb-monogram {
  width: 38px; height: 38px;
  background: var(--gold);
  color: var(--g-darkest);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .5px;
}

.sb-name {
  font-size: .8rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 1.25;
}

.sb-tag {
  font-size: .67rem;
  color: var(--st2);
  letter-spacing: .5px;
  text-transform: uppercase;
  line-height: 1.6;
}

/* Navigation */
.sb-nav { flex: 1; padding: 18px 0; }

.sb-group {
  font-size: .63rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--st2);
  padding: 18px 26px 5px;
}

.sb-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 26px;
  font-size: .8rem;
  color: var(--st1);
  border-left: 2px solid transparent;
  transition: all .18s ease;
  line-height: 1.3;
}

.sb-nav a:hover {
  color: var(--white);
  background: rgba(255,255,255,.04);
  border-left-color: var(--g-bright);
}

.sb-nav a.active {
  color: var(--white);
  background: rgba(82,183,136,.1);
  border-left-color: var(--g-bright);
  font-weight: 500;
}

.sb-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--st2);
  flex-shrink: 0;
  transition: background .18s;
}
.sb-nav a:hover .sb-dot,
.sb-nav a.active .sb-dot { background: var(--g-bright); }

/* Footer */
.sb-foot {
  padding: 18px 26px;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.sb-foot p {
  font-size: .7rem;
  color: var(--st2);
  line-height: 1.65;
}
.sb-foot strong {
  display: block;
  color: var(--st1);
  font-size: .75rem;
  margin-bottom: 3px;
}

/* Mobile toggle */
.mob-btn {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 300;
  background: var(--g-dark);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  padding: 9px 11px;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
}
.mob-btn span {
  display: block; width: 20px; height: 2px;
  background: var(--white);
  border-radius: 1px;
  transition: transform .22s, opacity .22s;
}

.mob-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,24,16,.6);
  z-index: 150;
  backdrop-filter: blur(2px);
}

/* ================================================
   MAIN CONTENT
   ================================================ */

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}

/* ================================================
   REVEAL ANIMATION
   ================================================ */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }

/* ================================================
   SECTION SHELL
   ================================================ */

.section {
  padding: 88px 72px;
  border-bottom: 1px solid var(--blight);
  max-width: 1200px;
  margin: 0 auto;
}

/* Full-bleed wrapper for sections needing edge-to-edge bg */
.section-wrap { border-bottom: 1px solid var(--blight); }
.section-wrap.alt { background: var(--bg-alt); }

.sec-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--g-mid);
  margin-bottom: 9px;
}

.sec-title {
  font-family: 'Inter', sans-serif;
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--t1);
  line-height: 1.18;
  margin-bottom: 5px;
  letter-spacing: -.3px;
}
.sec-title em { font-style: normal; color: var(--g-mid); font-weight: 600; }

.title-rule {
  width: 48px; height: 3px;
  background: var(--gold);
  border-radius: 2px;
  margin-bottom: 30px;
}

.sec-lead {
  font-size: 1.05rem;
  color: var(--t2);
  line-height: 1.8;
  max-width: 780px;
  margin-bottom: 0;
}

.sec-body {
  font-size: .93rem;
  color: var(--t2);
  line-height: 1.85;
  max-width: 780px;
}
.sec-body + .sec-body { margin-top: 1em; }

/* ================================================
   SECTION 1 — BACKGROUND (HERO)
   ================================================ */

.hero-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 400px;
  border-bottom: 1px solid var(--blight);
}

.hero-content {
  padding: 88px 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--white);
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--g-pale);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 5px 15px;
  font-size: .75rem;
  font-weight: 500;
  color: var(--g-mid);
  letter-spacing: .2px;
  margin-bottom: 20px;
  align-self: flex-start;
}
.hero-pill::before {
  content:'';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--g-bright);
}

.hero-name {
  font-family: 'Inter', sans-serif;
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--t1);
  line-height: 1.1;
  letter-spacing: -.5px;
  margin-bottom: 4px;
}

.hero-role {
  font-size: 1.05rem;
  color: var(--gold);
  font-weight: 500;
  letter-spacing: .2px;
  margin-bottom: 28px;
}

.hero-bio {
  font-size: .95rem;
  color: var(--t2);
  line-height: 1.88;
  max-width: 600px;
}
.hero-bio p + p { margin-top: 1em; }

.hero-stats {
  display: flex;
  gap: 36px;
  margin-top: 44px;
  padding-top: 30px;
  border-top: 1px solid var(--blight);
  flex-wrap: wrap;
}

.stat-num {
  font-family: 'Inter', sans-serif;
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--g-mid);
  line-height: 1;
  letter-spacing: -.5px;
  display: block;
}
.stat-lbl {
  font-size: .72rem;
  color: var(--t3);
  font-weight: 500;
  letter-spacing: .3px;
  text-transform: uppercase;
  display: block;
  margin-top: 3px;
}

.hero-photo {
  position: relative;
  overflow: hidden;
  background: var(--g-darkest);
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.hero-photo::after {
  content:'';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(15,32,24,.3), transparent 50%),
              linear-gradient(to top, rgba(10,24,16,.55), transparent 38%);
  pointer-events: none;
}

/* ================================================
   QUALIFICATIONS CARDS
   ================================================ */

.qual-intro {
  font-size: .95rem;
  color: var(--t2);
  line-height: 1.85;
  max-width: 780px;
  margin-bottom: 40px;
}

.qual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.qcard {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: var(--sh-sm);
  transition: box-shadow .2s, transform .2s;
}
.qcard:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }

.qcard.hero-card {
  grid-column: 1 / -1;
  background: var(--g-dark);
  border-color: rgba(82,183,136,.18);
}

.qcard-icon {
  font-size: 1.3rem;
  margin-bottom: 2px;
}

.qcard-title {
  font-size: .93rem;
  font-weight: 600;
  color: var(--t1);
  line-height: 1.35;
}
.qcard.hero-card .qcard-title { color: var(--white); font-size: 1rem; }

.qcard-body {
  font-size: .82rem;
  color: var(--t3);
  line-height: 1.6;
}
.qcard.hero-card .qcard-body { color: var(--st2); }

.qbadge {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 11px;
  border-radius: 50px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: uppercase;
  background: var(--g-pale);
  color: var(--g-mid);
  border: 1px solid var(--border);
  align-self: flex-start;
}
.qcard.hero-card .qbadge {
  background: rgba(200,135,58,.15);
  color: #e8a060;
  border-color: rgba(200,135,58,.25);
}

/* ================================================
   SPLIT LAYOUT
   ================================================ */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
  margin-top: 40px;
}

.split.img-left  .s-images { order: 1; }
.split.img-left  .s-text   { order: 2; }
.split.img-right .s-images { order: 2; }
.split.img-right .s-text   { order: 1; }

/* ================================================
   IMAGE COMPONENTS
   ================================================ */

.img-main {
  border-radius: var(--rl);
  overflow: hidden;
  box-shadow: var(--sh-md);
  background: var(--g-darkest);
}
.img-main img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  object-position: top center;
}

.img-stack { display: flex; flex-direction: column; gap: 12px; }
.img-stack .img-main img { max-height: 210px; }

.img-caption {
  font-size: .75rem;
  color: var(--t3);
  font-style: italic;
  text-align: center;
  margin-top: 8px;
  line-height: 1.5;
}

/* Gallery — 2 columns */
.gallery {
  display: grid;
  gap: 12px;
  margin-top: 36px;
}
.gallery.g2 { grid-template-columns: 1fr 1fr; }
.gallery.g3 { grid-template-columns: 1fr 1fr 1fr; }
.gallery.g2x1 { grid-template-columns: 2fr 1fr; }

.gitem {
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  background: var(--g-darkest);
  transition: box-shadow .2s, transform .2s;
}
.gitem:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }

.gitem img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform .3s ease;
}
.gitem:hover img { transform: scale(1.03); }
.gitem.tall img  { height: 300px; }
.gitem.short img { height: 160px; }

/* ================================================
   HIGHLIGHT BOXES
   ================================================ */

.hbox {
  background: var(--g-pale);
  border-left: 3px solid var(--g-mid);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 18px 22px;
  margin: 20px 0;
  font-size: .88rem;
  color: var(--t2);
  line-height: 1.72;
}
.hbox strong { color: var(--g-mid); }

.hbox.gold {
  background: var(--gold-pale);
  border-left-color: var(--gold);
}
.hbox.gold strong { color: var(--gold); }

/* ================================================
   FEATURE LIST
   ================================================ */

.flist {
  list-style: none;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.flist li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: .88rem;
  color: var(--t2);
  line-height: 1.6;
}
.flist li::before {
  content: '';
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--g-pale);
  border: 1.5px solid var(--g-bright);
  flex-shrink: 0;
  margin-top: 1px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l3 2.5 5-5.5' stroke='%2352b788' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 68%;
  background-repeat: no-repeat;
  background-position: center;
}

/* ================================================
   SOFTWARE TAGS GRID
   ================================================ */

.sw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 32px;
}

.sw-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--sh-sm);
  transition: box-shadow .2s, transform .2s;
}
.sw-item:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }

.sw-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--g-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.sw-text strong {
  display: block;
  font-size: .84rem;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 2px;
  line-height: 1.3;
}
.sw-text span {
  font-size: .76rem;
  color: var(--t3);
}

/* ================================================
   TRAINING SECTION
   ================================================ */

.training-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
  margin-top: 40px;
}

.training-img {
  border-radius: var(--rl);
  overflow: hidden;
  box-shadow: var(--sh-md);
}
.training-img img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  object-position: center top;
}

.training-block { margin-bottom: 32px; }
.training-block h3 {
  font-size: .88rem;
  font-weight: 700;
  color: var(--t1);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--blight);
}

/* ================================================
   PASSIVE HOUSE CERT GRID
   ================================================ */

.cert-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 36px;
}
.cert-grid .gitem:first-child { grid-column: span 2; }
.cert-grid .gitem img         { height: 230px; }
.cert-grid .gitem:first-child img { height: 280px; }

/* ================================================
   FOOTER
   ================================================ */

.site-footer {
  background: var(--g-darkest);
  color: var(--st2);
  padding: 48px 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.sf-brand strong { display: block; color: var(--white); font-size: .95rem; font-weight: 600; margin-bottom: 4px; }
.sf-brand p      { font-size: .76rem; line-height: 1.65; }
.sf-right        { font-size: .73rem; text-align: right; line-height: 1.7; }

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 1120px) {
  .section          { padding: 72px 52px; }
  .hero-content     { padding: 72px 52px; }
  .hero-wrap        { grid-template-columns: 1fr 360px; }
  .split            { gap: 44px; }
}

@media (max-width: 920px) {
  .hero-wrap  { grid-template-columns: 1fr; min-height: auto; }
  .hero-photo { height: 400px; }

  .split,
  .training-wrap { grid-template-columns: 1fr; gap: 32px; }

  .split.img-left  .s-images,
  .split.img-right .s-images { order: 0; }
  .split.img-left  .s-text,
  .split.img-right .s-text   { order: 0; }

  .qual-grid { grid-template-columns: 1fr; }
  .qcard.hero-card { grid-column: 1; }

  .cert-grid { grid-template-columns: 1fr 1fr; }
  .cert-grid .gitem:first-child { grid-column: 1 / -1; }

  .site-footer { padding: 40px 52px; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    width: 268px;
    transform: translateX(-268px);
  }
  .sidebar.open { transform: translateX(0); }

  .mob-btn  { display: flex; }
  .mob-overlay.show { display: block; }

  .section        { padding: 60px 24px; }
  .hero-content   { padding: 80px 24px 56px; }
  .hero-name      { font-size: 2.6rem; }
  .sec-title      { font-size: 1.8rem; }
  .hero-stats     { gap: 22px; }

  .gallery.g2,
  .gallery.g3,
  .gallery.g2x1   { grid-template-columns: 1fr; }
  .cert-grid      { grid-template-columns: 1fr; }
  .cert-grid .gitem:first-child { grid-column: 1; }

  .sw-grid { grid-template-columns: 1fr; }

  .site-footer { padding: 36px 24px; flex-direction: column; align-items: flex-start; }
  .sf-right    { text-align: left; }
}

/* ================================================
   LIGHTBOX
   ================================================ */

/* Cursor on all lightboxable images */
.gitem img,
.img-main img,
.training-img img,
.hero-photo img {
  cursor: zoom-in;
}

/* Backdrop */
.lb-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 12, 0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.lb-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

/* Inner frame */
.lb-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(92vw, 1280px);
  max-height: 92vh;
  transform: scale(.93) translateY(10px);
  transition: transform .28s ease;
}
.lb-backdrop.open .lb-frame {
  transform: scale(1) translateY(0);
}

/* The image */
.lb-img {
  max-width: 100%;
  max-height: calc(90vh - 60px);
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .7);
  object-fit: contain;
  display: block;
}

/* Caption */
.lb-caption {
  margin-top: 14px;
  color: rgba(255, 255, 255, .65);
  font-size: .8rem;
  font-style: italic;
  text-align: center;
  line-height: 1.55;
  max-width: 640px;
  padding: 0 8px;
}

/* Close button */
.lb-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  color: var(--white);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, transform .18s;
  z-index: 1001;
}
.lb-close:hover {
  background: rgba(255, 255, 255, .22);
  transform: scale(1.08);
}

/* Nav arrows */
.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  color: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, transform .18s;
  z-index: 1001;
  line-height: 1;
}
.lb-nav:hover {
  background: rgba(255, 255, 255, .22);
}
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lb-nav:disabled {
  opacity: .25;
  cursor: default;
  pointer-events: none;
}

@media (max-width: 768px) {
  .lb-nav { display: none; }
  .lb-backdrop { padding: 12px; }
}
