/* ---------- Global type + spacing ---------- */
:root{
  --content-max: 70ch;         /* ideal reading width */

  /* ---------- Colors ---------- */
  --color-bg: #232C33;         /* warm cream page background #F5E6D3 */
  --color-accent: #3D5F8F;     /* navy accent: navbar background, timeline end node, dates #134074 */
  --color-text-body: #fff;  /* card body copy  #2b2b2b*/
  --color-aboutme-card: #3D5F8F ; /* #000 #5bc0be  */
  --color-textandtitles: #fff;
  
  /* Contact form submit button (was Bootstrap's btn-dark) */
  --color-btn: #3D5F8F; /* #212529 */
  --color-btn-hover: #496F99;
  --color-btn-hover-rgb: 66, 70, 73;   /* used for the focus-ring alpha below */
  --color-btn-hover-border: #373b3e;   /* shared by hover + active */
  --color-btn-active: #496F99;
  /* Base colors, kept as RGB triplets so translucent variants can reuse them */
  --color-white-rgb: 255, 255, 255;
  --color-black-rgb: 0, 0, 0;
  --color-white: rgb(var(--color-white-rgb));
  --color-black: rgb(var(--color-black-rgb));

  /* Derived translucent colors */
  --color-nav-link: rgba(var(--color-white-rgb), 0.85);
  --color-nav-link-hover-bg: rgba(var(--color-white-rgb), 0.12);
  --color-shadow: rgba(var(--color-black-rgb), 0.15);
  --color-shadow-strong: rgba(var(--color-black-rgb), 0.2);
  --color-timeline-end-glow: rgba(var(--color-white-rgb), 0.5);
  --color-btn-focus-ring: rgba(var(--color-btn-hover-rgb), 0.5);
  --color-btn-active-shadow: rgba(var(--color-black-rgb), 0.125);
}

body.site-bg{
  background-color: var(--color-bg);
  /* A little nicer default reading text */
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: var(--color-textandtitles);
}

/* Headings: consistent weight + spacing */
h1, h2, h3{
  letter-spacing: 0.2px;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

/* Paragraph rhythm */
p{
  margin-bottom: 0.85rem;
}

/* Keep long text from stretching too wide */
.readable{
  max-width: var(--content-max);
}


/* ---------- Navbar polish ---------- */
.navbar {
  position: sticky;
  top: 0.75rem;
  z-index: 1030;
  background-color: var(--color-accent);
}

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

.navbar-dark .navbar-nav .nav-link {
  color: var(--color-nav-link);
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: 0.375rem;
  transition: color 150ms ease, background-color 150ms ease;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus-visible {
  color: var(--color-white);
  background-color: var(--color-nav-link-hover-bg);
}

.navbar-dark .navbar-nav .nav-link.active,
.navbar-dark .navbar-nav .nav-link[aria-current="page"] {
  color: var(--color-white);
  font-weight: 700;
}

#logo { justify-content: space-between; }

/* Collapse the longer menu on phones and tablets. */
@media (max-width: 991.98px) {
  #logo { width: 100%; }
  .navbar { max-height: calc(100dvh - 2rem); overflow-y: auto; }
}

/* A dedicated sidebar keeps navigation beside the content on wide screens. */
@media (min-width: 1400px) {
  body.site-bg { padding-left: 224px; }
  .nav-logo { height: 200px; }
  #logo { justify-content: center; }
  #logo .navbar-brand { margin-right: 0; }
  .navbar {
    position: fixed;
    left: 0;
    top: 0;
    width: 192px;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
  }
  #navbarNavDropdown {
    margin-left: 0 !important;
    margin-top: 0.75rem;
  }
  .navbar .navbar-nav {
    flex-direction: column;
    width: 100%;
  }
  main [id] { scroll-margin-top: 1rem; }
}
.about-img{
  width: 280px;
  max-width: 33%;
  height: auto;
  flex-shrink: 0;
  object-fit: cover;
}

/* About Me card */
.about-card{
  width: 100%;
  max-width: 1140px;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  background-color: var(--color-aboutme-card);
  color: var(--color-text-body);
}

.about-text{
  max-width: var(--content-max);
  font-size: clamp(1.125rem, 2vw, 1.5rem);
}

.about-text h1{
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

.approach-text{
  font-size: 1.125rem;
}

.approach-lead{
  font-size: 1.25rem;
}

/* Selected work case studies */
.services-list{
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: 1.25rem;
  font-size: 1.125rem;
}

.services-list li + li{
  margin-top: 0.75rem;
}

.services-list li::marker{
  color: #5D83AB;
}

.selected-work-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.work-card{
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: 0.75rem;
  background-color: var(--color-white);
  color: var(--color-bg);
  box-shadow: 0 0.5rem 1rem var(--color-shadow);
}

.work-card-header{
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.work-logo{
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  object-fit: contain;
}

.work-role{
  color: var(--color-accent);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.work-card h3{
  font-size: 1.4rem;
  margin-bottom: 0;
}

.work-details{
  margin-bottom: 0;
}

.work-details dt{
  color: var(--color-accent);
  margin-bottom: 0.25rem;
}

.work-details dd{
  margin: 0 0 1.25rem;
}

.work-details dd:last-child{
  margin-bottom: 0;
}

.gallery-preview{
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--color-accent);
  border-radius: 0.25rem;
  background: transparent;
  overflow: hidden;
  cursor: zoom-in;
}

.gallery-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.gallery-more summary{
  width: fit-content;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-accent);
  border-radius: 0.375rem;
  color: var(--color-accent);
  cursor: pointer;
}

.gallery-more summary:hover{
  background-color: #eef2f7;
}

.gallery-more summary:focus-visible{
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

.gallery-collapse-label,
.gallery-more[open] .gallery-expand-label{
  display: none;
}

.gallery-more[open] .gallery-collapse-label{
  display: inline;
}

.gallery-preview:focus-visible{
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

.gallery-preview img{
  width: 100%;
  height: 150px;
  object-fit: cover;
  object-position: top;
}

#photomodal .modal-content{
  color: var(--color-bg);
  height: 100%;
  overflow: hidden;
}

#photomodal .modal-dialog{
  max-width: 1000px;
  height: calc(100vh - 2rem);
  height: calc(100dvh - 2rem);
  margin: 1rem auto;
  width: calc(100% - 2rem);
}

#photomodal .modal-header,
#photomodal .modal-footer{
  flex-shrink: 0;
}

#photomodal .modal-title{
  min-width: 0;
  overflow-wrap: anywhere;
}

#photomodal .modal-body{
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  min-height: 0;
  overflow: auto;
}

#photomodal .modalimg{
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

#photomodal .modal-footer{
  flex-wrap: nowrap;
  gap: 0.5rem;
}

#photo-position{
  text-align: center;
}

@media (max-width: 575.98px){
  #photomodal .modal-header,
  #photomodal .modal-body,
  #photomodal .modal-footer{
    padding: 0.75rem;
  }
}

@media (max-width: 767.98px){
  .selected-work-grid{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 399.98px){
  .work-card-header{
    flex-direction: column;
    align-items: flex-start;
  }
}

main [id]{
  scroll-margin-top: var(--anchor-offset, 6rem);
}
.timeline{
		--tl-bar-left: 25px;   /* spine position, shared by the spine + every node */
		--tl-bar-width: 6px;
		--tl-bar-color: var(--color-white);
		--tl-node-size: 40px;
		--tl-node-top: 15px;   /* fixed offset from the top of each card, so it works no matter how tall the card's text is */
		--tl-node-color: var(--color-white);
		--tl-node-end-color: var(--color-accent); /* accent used elsewhere on the site, marks the final node */
		--tl-card-left: 70px;  /* where each card starts; shared with the connector so they can't drift apart */
		position: relative;
		margin: 0 auto;
		max-width:910px;
		width:90%;
  box-sizing: border-box;
	}

.timelinecontainer {
  position: relative;
  width: auto;
  max-width: 100%;
  padding: 10px 25px 10px var(--tl-card-left);
  background-color: inherit;
  box-sizing: border-box;
  /* draws this card's own slice of the spine so it can never drift out of alignment with the node below */
  background-image: linear-gradient(var(--tl-bar-color), var(--tl-bar-color));
  background-repeat: no-repeat;
  background-position: var(--tl-bar-left) 0;
  background-size: var(--tl-bar-width) 100%;
}

/* Scroll-reveal: JS adds "reveal-init" up front (so no-JS visitors always see full content),
   then adds "is-visible" as each entry scrolls into view. */
.timelinecontainer.reveal-init {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.timelinecontainer.reveal-init.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* end the timeline: stop the spine exactly at the last node's center instead of trailing past it */
.timelinecontainer:last-child {
  background-size: var(--tl-bar-width) calc(var(--tl-node-top) + (var(--tl-node-size) / 2));
}

.timelinecontainer::after {
  content: '';
  position: absolute;
  width: var(--tl-node-size);
  height: var(--tl-node-size);
  /* centers the node on the spine using the same variables the spine is drawn with */
  left: calc(var(--tl-bar-left) + (var(--tl-bar-width) / 2) - (var(--tl-node-size) / 2));
  top: var(--tl-node-top);
  background-color: var(--tl-node-color);
  background-image: var(--node-img, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 4px solid var(--color-white);
  border-radius: 50%;
  box-sizing: border-box;
  z-index: 2;
}

/* the last card's node reads as the end of the timeline */
.timelinecontainer:last-child::after {
  background-color: var(--tl-node-end-color);
  box-shadow: 0 0 0 4px var(--color-timeline-end-glow);
}

/* stem connecting each node to its card, same thickness/color as the spine and centered on the node */
.timelinecontainer::before {
  content: '';
  position: absolute;
  left: calc(var(--tl-bar-left) + (var(--tl-bar-width) / 2) + (var(--tl-node-size) / 2));
  top: calc(var(--tl-node-top) + (var(--tl-node-size) / 2) - (var(--tl-bar-width) / 2));
  width: calc(var(--tl-card-left) - (var(--tl-bar-left) + (var(--tl-bar-width) / 2) + (var(--tl-node-size) / 2)));
  height: var(--tl-bar-width);
  background-color: var(--tl-bar-color);
  z-index: 2;
}


.content {
  display: block;
  text-align: left;
  padding: 14px 18px;
  background-color: var(--color-white);
  position: relative;
  color: var(--color-black);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.content:hover,
.content:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 0.75rem 1.25rem var(--color-shadow);
}
/* Respect the OS-level motion preference: skip the scroll-reveal slide/fade and the
   card hover-lift, and show every timeline entry in place immediately. */
@media (prefers-reduced-motion: reduce) {
  .timelinecontainer.reveal-init,
  .timelinecontainer.reveal-init.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .content,
  .content:hover,
  .content:focus-within {
    transform: none;
    transition: box-shadow 120ms ease;
  }
}

.content-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.6rem;
  row-gap: 0.1rem;
  margin-bottom: 0.35rem;
}

.content-date {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.content-title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.25;
}

.content-body {
  margin: 0;
  font-size: 0.95rem;
}

/* Give timeline copy more room on phones while keeping the spine and nodes. */
@media (max-width: 575.98px) {
  .timeline {
    --tl-bar-left: 10px;
    --tl-bar-width: 4px;
    --tl-node-size: 24px;
    --tl-card-left: 32px;
    width: 100%;
  }

  .timelinecontainer {
    padding-right: 0;
  }

  .timelinecontainer::after {
    border-width: 2px;
  }

  .timeline .content {
    padding: 14px 12px;
    overflow-wrap: anywhere;
  }

  .timeline .content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
  }

  .timeline .content-body {
    font-size: 1rem;
  }

  .timeline .content-body + .content-body {
    margin-top: 0.75rem;
  }

  .timeline .content ul {
    padding-left: 1.25rem;
    margin-bottom: 0;
  }
}

@media (max-width: 767.98px) {
  .about-img {
    max-width: 280px;
    width: 100%;
    height: auto;
  }
}

/* Keep the stacked introduction compact until the side-by-side layout begins. */
@media (max-width: 767.98px) {
  #about_me .about-card {
    padding: 1rem;
    gap: 0.75rem !important;
  }

  #about_me .about-img {
    width: clamp(80px, 25vw, 120px);
    height: clamp(80px, 25vw, 120px);
    object-fit: cover;
    object-position: center;
  }

  #about_me .about-text {
    font-size: 1rem;
    line-height: 1.5;
  }

  #about_me h1 {
    font-size: 1.5rem;
  }

  #about_me .btn {
    width: 100%;
    font-size: 1.125rem;
  }
}

/* ---------- Contact form polish ---------- */
#contact-form .form-label{
  margin-bottom: 0.4rem;
}

#contact-form .invalid-feedback{
  color: #ffb4ab;
}

#contact-form .form-control{
  padding: 0.65rem 0.85rem;
  scroll-margin-top: var(--anchor-offset, 6rem);
}

#contact-form textarea.form-control{
  resize: vertical;
}

/* Submit button (was Bootstrap's btn-dark) */
.btn-contact{
  --bs-btn-color: var(--color-white);
  --bs-btn-bg: var(--color-btn);
  --bs-btn-border-color: var(--color-btn);
  --bs-btn-hover-color: var(--color-white);
  --bs-btn-hover-bg: var(--color-btn-hover);
  --bs-btn-hover-border-color: var(--color-btn-hover-border);
  --bs-btn-active-color: var(--color-white);
  --bs-btn-active-bg: var(--color-btn-active);
  --bs-btn-active-border-color: var(--color-btn-hover-border);
  color: var(--color-white);
  background-color: var(--color-btn);
  border-color: var(--color-btn);
}

.btn-contact:hover{
  color: var(--color-white);
  background-color: var(--color-btn-hover);
  border-color: var(--color-btn-hover-border);
}

.btn-contact:focus-visible{
  outline: 2px solid var(--color-white);
  outline-offset: 3px;
  box-shadow: 0 0 0 0.25rem var(--color-btn-focus-ring);
}

.btn-contact:active{
  color: var(--color-white);
  background-color: var(--color-btn-active) !important;
  border-color: var(--color-btn-hover-border) !important;
  box-shadow: inset 0 3px 5px var(--color-btn-active-shadow) !important;
}

.btn-contact:disabled{
  color: var(--color-white);
  background-color: var(--color-btn);
  border-color: var(--color-btn);
  opacity: 0.65;
}

/* Make status message spacing consistent */
#form-status .alert{
  margin-top: 1rem;
}

.weather-box{
  width: fit-content;
  margin: 0 auto 0.75rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--color-accent);
  border-radius: 0.5rem;
  font-size: 0.9rem;
}
