/* Alex Smith Finance — clean, minimal, professional */

:root {
  --color-text: #1a1a1a;
  --color-text-muted: #4a4a4a;
  --color-bg: #fafafa;
  --color-bg-section: #ffffff;
  --color-accent: #0f2d5c;
  --color-accent-hover: #1a3d7a;
  --color-border: #e5e5e5;
  --max-width: 900px;
  --space-unit: 8px;
  --space-s: calc(var(--space-unit) * 2);
  --space-m: calc(var(--space-unit) * 4);
  --space-l: calc(var(--space-unit) * 6);
  --space-xl: calc(var(--space-unit) * 10);
  --space-2xl: calc(var(--space-unit) * 12);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'DM Serif Display', Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* Site header — sticky nav */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header-scrolled {
  background-color: var(--color-bg-section);
  box-shadow: 0 1px 0 var(--color-border);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-s) var(--space-m);
  gap: var(--space-s);
}

.nav-logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-accent);
  text-decoration: none;
}

.site-header:not(.site-header-scrolled) .nav-logo {
  color: #fff;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.site-header:not(.site-header-scrolled) .nav-toggle-bar {
  background: #fff;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: var(--space-m);
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
}

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

.site-header:not(.site-header-scrolled) .nav-link {
  color: rgba(255, 255, 255, 0.9);
}

.site-header:not(.site-header-scrolled) .nav-link:hover {
  color: #fff;
}

.nav-link-cta {
  color: var(--color-accent);
}

.site-header:not(.site-header-scrolled) .nav-link-cta {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 0.4em 0.8em;
  border-radius: 4px;
}

.site-header:not(.site-header-scrolled) .nav-link-cta:hover {
  background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 767px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-s) 0;
    gap: var(--space-s);
  }

  .nav-menu-open {
    display: flex;
  }

  .site-header-scrolled .nav-menu {
    border-top: 1px solid var(--color-border);
  }

  /* When menu is open, always show background so links are readable over hero */
  .site-header.nav-open {
    background-color: var(--color-bg-section);
    box-shadow: 0 1px 0 var(--color-border);
  }

  .site-header.nav-open .nav-logo {
    color: var(--color-accent);
  }

  .site-header.nav-open .nav-toggle-bar {
    background: var(--color-text);
  }

  .site-header.nav-open .nav-link {
    color: var(--color-text-muted);
  }

  .site-header.nav-open .nav-link-cta {
    color: var(--color-accent);
    border-color: var(--color-accent);
  }
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }
}

.main-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-m);
  padding-top: 0;
}

@media (min-width: 640px) {
  .main-wrap {
    padding: var(--space-xl) var(--space-m);
  }
}

/* Sections */
.section {
  padding: var(--space-l) 0;
  border-bottom: 1px solid var(--color-border);
}

.section:last-of-type {
  border-bottom: none;
}

@media (min-width: 640px) {
  .section {
    padding: var(--space-2xl) 0;
  }
}

.section-title {
  margin: 0 0 var(--space-m);
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-accent);
}

@media (min-width: 640px) {
  .section-title {
    font-size: 1.75rem;
  }
}

/* Hero — full-viewport dark gradient */
.hero {
  position: relative;
  min-height: 100vh;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  padding: calc(60px + var(--space-xl)) var(--space-m) var(--space-xl);
  background: linear-gradient(160deg, #0a1628 0%, #0f2d5c 50%, #1a3d7a 100%);
  border-bottom: none;
  display: flex;
  align-items: center;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.hero-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
  align-items: flex-start;
}

@media (min-width: 768px) {
  .hero-layout {
    flex-direction: row;
    align-items: center;
    gap: var(--space-xl);
  }
}

.hero-photo-wrap {
  flex-shrink: 0;
}

.hero-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

@media (min-width: 768px) {
  .hero-photo {
    width: 200px;
    height: 200px;
  }
}

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

.hero-title {
  margin: 0 0 var(--space-m);
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1.2;
  color: #fff;
}

.hero-title .name {
  display: inline-block;
  color: #fff;
  position: relative;
}

.hero-title .name::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), transparent);
  animation: accent-line 2s ease-out;
}

@keyframes accent-line {
  from {
    transform: scaleX(0);
    transform-origin: left;
  }
  to {
    transform: scaleX(1);
    transform-origin: left;
  }
}

.hero-tagline {
  margin: 0 0 var(--space-l);
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 36em;
}

.btn {
  display: inline-block;
  padding: 0.75em 1.5em;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-sans);
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn-primary {
  background: #fff;
  color: var(--color-accent);
  border: none;
}

.btn-primary:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

@media (max-width: 639px) {
  .hero {
    min-height: 90vh;
    padding-left: var(--space-m);
    padding-right: var(--space-m);
  }

  .hero-layout {
    align-items: center;
    text-align: center;
  }

  .hero-photo {
    width: 130px;
    height: 130px;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-tagline {
    font-size: 1rem;
  }
}

@media (min-width: 640px) {
  .hero-title {
    font-size: 3.25rem;
  }

  .hero-tagline {
    font-size: 1.25rem;
  }
}

/* By the Numbers */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-m);
}

.metric-card {
  padding: var(--space-l);
  background: var(--color-bg-section);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: 4px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.metric-card:hover {
  box-shadow: 0 4px 12px rgba(15, 45, 92, 0.08);
  transform: translateY(-2px);
}

.metric-value {
  display: block;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  color: var(--color-accent);
  line-height: 1.2;
}

.metric-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-top: 0.25em;
}

@media (max-width: 639px) {
  .metric-card {
    padding: var(--space-m);
  }

  .metric-value {
    font-size: 1.5rem;
    word-break: break-word;
  }
}

@media (min-width: 640px) {
  .metrics-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-l);
  }

  .metric-value {
    font-size: 2.5rem;
  }
}

/* Prose (paragraphs) */
.prose {
  margin: 0;
  font-size: 1.0625rem;
}

.prose p {
  margin: 0 0 1em;
}

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

/* Work I Do */
.work-grid {
  display: grid;
  gap: var(--space-l);
}

@media (min-width: 640px) {
  .work-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
}

.work-column-title {
  margin: 0 0 var(--space-s);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--color-accent);
}

.work-list {
  margin: 0;
  padding-left: 1.25em;
}

.work-list li {
  margin-bottom: 0.5em;
}

.work-list li:last-child {
  margin-bottom: 0;
}

.work-list-single {
  max-width: 36em;
}

/* Education */
.education-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
}

.education-item {
  padding: var(--space-m);
  background: var(--color-bg-section);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: 4px;
}

.education-degree {
  margin: 0 0 0.25em;
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 400;
  color: var(--color-text);
}

.education-school {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-accent);
}

/* Experience */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
}

.experience-details {
  padding: 0;
  background: var(--color-bg-section);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: 4px;
  overflow: hidden;
}

.experience-summary {
  list-style: none;
  padding: var(--space-m);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-m);
  font-family: var(--font-sans);
}

.experience-summary::-webkit-details-marker {
  display: none;
}

/* Plus/minus toggle icon */
.experience-toggle {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background-color 0.2s ease;
}

.experience-toggle::before,
.experience-toggle::after {
  content: "";
  position: absolute;
  background: var(--color-accent);
  transition: transform 0.2s ease;
}

.experience-toggle::before {
  width: 12px;
  height: 2px;
}

.experience-toggle::after {
  width: 2px;
  height: 12px;
}

.experience-details[open] .experience-toggle::after {
  transform: rotate(90deg);
  opacity: 0;
}

.experience-details[open] .experience-toggle {
  background: var(--color-accent);
}

.experience-details[open] .experience-toggle::before {
  background: #fff;
}

.experience-details[open] .experience-toggle::after {
  background: #fff;
}

.experience-summary .experience-company-name {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--color-text);
  flex: 1;
}

.experience-expanded-header {
  padding: 0 var(--space-m);
  padding-bottom: var(--space-s);
}

.experience-role {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-accent);
  margin: 0 0 0.15em;
}

.experience-dates {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
}

.experience-content {
  padding: 0 var(--space-m) var(--space-m);
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.experience-content p {
  margin: 0;
}

@media (max-width: 639px) {
  .experience-toggle {
    width: 32px;
    height: 32px;
  }

  .experience-summary {
    padding: var(--space-m) var(--space-s);
    gap: var(--space-s);
  }

  .experience-expanded-header {
    padding: 0 var(--space-s);
    padding-bottom: var(--space-s);
  }

  .experience-content {
    padding: 0 var(--space-s) var(--space-m);
  }
}

/* Testimonials */
.testimonials-grid {
  display: grid;
  gap: var(--space-l);
}

@media (min-width: 640px) {
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.testimonial-card {
  margin: 0;
  padding: var(--space-l);
  background: var(--color-bg-section);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  position: relative;
}

.testimonial-quote {
  position: absolute;
  top: var(--space-s);
  left: var(--space-m);
  font-family: var(--font-serif);
  font-size: 3rem;
  line-height: 1;
  color: var(--color-accent);
  opacity: 0.2;
}

.testimonial-text {
  margin: 0 0 var(--space-s);
  padding-top: var(--space-m);
  font-size: 1rem;
  font-style: italic;
  color: var(--color-text);
}

.testimonial-attribution {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.testimonial-attribution cite {
  font-style: normal;
}

/* Beyond Finance */
.beyond-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
}

@media (min-width: 768px) {
  .beyond-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-xl);
  }
}

.beyond-photo-wrap {
  flex-shrink: 0;
}

.beyond-photo {
  width: 220px;
  height: 280px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--color-border);
}

@media (max-width: 767px) {
  .beyond-layout {
    align-items: center;
  }

  .beyond-photo {
    width: 100%;
    max-width: 300px;
    height: auto;
    aspect-ratio: 3 / 4;
  }
}

.beyond-text {
  flex: 1;
  min-width: 0;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--color-text-muted);
}

/* Contact */
.contact-intro {
  margin: 0 0 var(--space-l);
  max-width: 36em;
  color: var(--color-text-muted);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-m);
  align-items: center;
  margin-bottom: var(--space-xl);
}

.contact-email,
.contact-linkedin {
  font-weight: 500;
}

.contact-form {
  max-width: 28em;
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
}

@media (max-width: 639px) {
  .contact-form {
    max-width: 100%;
  }
}

.contact-form label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.contact-form input,
.contact-form textarea {
  padding: 0.6em 0.75em;
  font-family: var(--font-sans);
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg-section);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 0;
}

.contact-form .btn {
  align-self: flex-start;
}

.contact-form .btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.contact-form .btn-primary:hover {
  background: var(--color-accent-hover);
}

/* Site footer (in layout) */
.site-footer {
  padding: var(--space-l) var(--space-m);
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
}

.site-footer .footer-copy {
  margin: 0 0 0.25em;
}

.site-footer .footer-links {
  margin: 0;
}

.site-footer .footer-link {
  color: var(--color-accent);
  text-decoration: none;
  margin: 0 0.5em;
}

.site-footer .footer-link:hover {
  text-decoration: underline;
}

.link {
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: none;
}

.link:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* Insights / blog listing */
.post-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
}

.post-card {
  padding: var(--space-m);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: 4px;
  background: var(--color-bg-section);
}

.post-card-title {
  margin: 0 0 0.25em;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
}

.post-card-title a {
  color: var(--color-text);
  text-decoration: none;
}

.post-card-title a:hover {
  color: var(--color-accent);
}

.post-card-date {
  display: block;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5em;
}

.post-card-excerpt {
  margin: 0 0 0.5em;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.post-card-link {
  font-size: 0.9375rem;
}

/* Single post page */
.post-page {
  padding: var(--space-m) 0;
}

.post-header {
  margin-bottom: var(--space-l);
}

.post-title {
  margin: 0 0 0.25em;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  color: var(--color-text);
}

.post-date {
  display: block;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.post-body {
  font-size: 1.0625rem;
}

.post-body h2 {
  margin: 1.5em 0 0.5em;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--color-accent);
}

.post-body h2:first-child {
  margin-top: 0;
}

.post-body hr {
  margin: 2em 0;
  border: none;
  border-top: 1px solid var(--color-border);
}

/* Focus for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
