/* =====================================================
   jaredmgrant.com — style.css
   ===================================================== */

/* ── Custom Properties ── */
:root {
  --color-navy:       #1a2e4a;
  --color-navy-dark:  #0f1d30;
  --color-bg:         #ffffff;
  --color-bg-alt:     #f8f7f4;
  --color-text:       #333333;
  --color-text-muted: #666666;
  --color-border:     #e0dbd4;

  --font-heading: 'Merriweather', Georgia, serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;

  --max-width:       1100px;
  --section-padding: 6rem 1.5rem;
  --nav-height:      64px;

  --transition:    0.25s ease;
  --radius:        8px;
  --shadow:        0 2px 12px rgba(26, 46, 74, 0.08);
  --shadow-hover:  0 6px 24px rgba(26, 46, 74, 0.14);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

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

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

a {
  color: var(--color-navy);
  text-decoration: none;
  transition: opacity var(--transition);
}
a:hover { opacity: 0.75; }

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-navy);
  line-height: 1.3;
  font-weight: 700;
}

h2 { font-size: clamp(1.6rem, 3vw, 2rem); margin-bottom: 1.5rem; }
h3 { font-size: 1.2rem;  margin-bottom: 0.4rem; }
h4 { font-size: 0.85rem; margin-bottom: 0.6rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ── Layout ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.section--alt {
  background-color: var(--color-bg-alt);
}

.section--dark {
  background-color: var(--color-navy);
  color: #fff;
}
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: #fff;
}

.section__intro {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 640px;
  margin-bottom: 2.5rem;
  line-height: 1.75;
}
.section--dark .section__intro {
  color: rgba(255, 255, 255, 0.7);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition);
  border: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn--primary {
  background-color: var(--color-navy);
  color: #fff;
  border-color: var(--color-navy);
}
.btn--primary:hover {
  background-color: var(--color-navy-dark);
  border-color: var(--color-navy-dark);
  opacity: 1;
}

.btn--secondary {
  background-color: transparent;
  color: var(--color-navy);
  border-color: var(--color-navy);
}
.btn--secondary:hover {
  background-color: var(--color-navy);
  color: #fff;
  opacity: 1;
}

.btn--outline {
  background-color: transparent;
  color: var(--color-navy);
  border-color: var(--color-border);
}
.btn--outline:hover:not(:disabled) {
  border-color: var(--color-navy);
  opacity: 1;
}
.btn--outline:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--outline-light {
  background-color: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}
.btn--outline-light:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.75);
  opacity: 1;
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
  transition: box-shadow var(--transition);
}
.nav.scrolled {
  box-shadow: var(--shadow);
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__wordmark {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-navy);
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.nav__wordmark:hover { opacity: 0.75; }

.nav__links {
  list-style: none;
  display: flex;
  gap: 2rem;
  align-items: center;
}
.nav__links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: 0.01em;
  transition: color var(--transition);
}
.nav__links a:hover {
  color: var(--color-navy);
  opacity: 1;
}

.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}
.nav__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-navy);
  transition: transform var(--transition), opacity var(--transition);
  transform-origin: center;
}
.nav__hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav__hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Hero ── */
.hero {
  padding: calc(var(--nav-height) + 5rem) 1.5rem 5rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: center;
  width: 100%;
}

.hero__text {
  max-width: 560px;
}

.hero__name {
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  color: var(--color-navy);
  margin-bottom: 1.25rem;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.hero__tagline {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.65;
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
  font-weight: 400;
}

.hero__ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero__photo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero__avatar {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background-color: var(--color-bg-alt);
  border: 3px solid var(--color-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 3.25rem;
  font-weight: 700;
  color: var(--color-navy);
  letter-spacing: -0.02em;
  flex-shrink: 0;
  user-select: none;
}

.hero__avatar--photo {
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* ── About ── */
.about__bio {
  max-width: 680px;
}
.about__bio p {
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 1.5rem;
  color: var(--color-text);
}

/* ── Experience Timeline ── */
.timeline {
  position: relative;
  padding-left: 2.25rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.75rem;
  bottom: 0.75rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-navy) 0%, var(--color-border) 100%);
}

.timeline__item {
  position: relative;
  margin-bottom: 1.25rem;
}
.timeline__item:last-child {
  margin-bottom: 0;
}

.timeline__marker {
  position: absolute;
  left: -2.75rem;
  top: 1.3rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--color-navy);
  border: 3px solid var(--color-bg);
  box-shadow: 0 0 0 2px var(--color-navy);
  flex-shrink: 0;
}

.timeline__card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: box-shadow var(--transition);
}
.timeline__card:hover {
  box-shadow: var(--shadow);
}

.timeline__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.timeline__header-text {
  flex: 1;
  min-width: 0;
}

.timeline__role {
  font-size: 1.1rem;
  color: var(--color-navy);
  margin-bottom: 0.2rem;
}

.timeline__meta {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-bottom: 0.6rem;
}
.timeline__dates {
  font-weight: 600;
}

.timeline__summary {
  font-size: 0.93rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  margin: 0;
}

.timeline__toggle {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  min-width: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: border-color var(--transition), color var(--transition), background-color var(--transition);
  margin-top: 0.1rem;
}
.timeline__toggle:hover {
  border-color: var(--color-navy);
  color: var(--color-navy);
  background-color: rgba(26, 46, 74, 0.04);
}
.timeline__toggle svg {
  transition: transform var(--transition);
  flex-shrink: 0;
}
.timeline__toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.timeline__detail {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}
.timeline__detail h4 {
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  margin-top: 1rem;
  margin-bottom: 0.6rem;
}
.timeline__detail h4:first-child {
  margin-top: 0;
}
.timeline__detail p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--color-text);
}

/* ── Cards (Writing + Demos) ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}
.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.card__tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.2rem 0.55rem;
  margin-bottom: 1rem;
}
.card__tag--demo {
  color: var(--color-navy);
  background-color: rgba(26, 46, 74, 0.06);
  border-color: rgba(26, 46, 74, 0.15);
}

.card h3 {
  font-size: 1.08rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.card p {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 1.25rem;
  flex: 1;
}
.card p:last-child {
  margin-bottom: 0;
}

/* ── Contact ── */
.contact__inner {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form__group label {
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}
.form__group input,
.form__group textarea {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: #fff;
  transition: border-color var(--transition), background-color var(--transition);
  outline: none;
  resize: vertical;
  width: 100%;
}
.form__group input::placeholder,
.form__group textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
.form__group input:focus,
.form__group textarea:focus {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
}

.contact__links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 0.25rem;
}
.contact__links p {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.65;
}

/* ── Footer ── */
.footer {
  background-color: var(--color-navy-dark);
  padding: 1.5rem;
  text-align: center;
}
.footer p {
  font-size: 0.83rem;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
}

/* ── Scroll Animations ── */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive — 768px breakpoint ── */
@media (max-width: 768px) {
  :root {
    --section-padding: 4rem 1.25rem;
  }

  /* Nav */
  .nav__hamburger {
    display: flex;
  }
  .nav__links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    display: none;
    box-shadow: var(--shadow);
  }
  .nav__links.open {
    display: flex;
  }
  .nav__links li {
    width: 100%;
  }
  .nav__links a {
    display: block;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
  }

  /* Hero */
  .hero {
    padding: calc(var(--nav-height) + 3rem) 1.25rem 3rem;
    min-height: auto;
  }
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: center;
  }
  .hero__photo {
    order: -1;
  }
  .hero__avatar {
    width: 160px;
    height: 160px;
    font-size: 2.2rem;
  }
  .hero__avatar--photo {
    width: 160px;
    height: 160px;
  }
  .hero__text {
    max-width: 100%;
  }
  .hero__ctas {
    justify-content: center;
  }

  /* Timeline */
  .timeline {
    padding-left: 1.5rem;
  }
  .timeline__marker {
    left: -2rem;
    width: 10px;
    height: 10px;
  }

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

  /* Contact */
  .contact__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 480px) {
  .hero__ctas {
    flex-direction: column;
    align-items: center;
  }
  .btn {
    width: 100%;
    justify-content: center;
  }
}
