/* ============================================================
   Carter Haley — Portfolio Stylesheet
   ============================================================ */

:root {
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-serif: 'Lora', Georgia, 'Times New Roman', serif;

  --color-text:     #1A1A1A;
  --color-text-sub: #5A5549;
  --color-text-dim: #9A9186;
  --color-bg:       #F6F3EE;
  --color-border:   #D4CFC6;
  --color-rule:     #DDD9D0;

  --max-width:  820px;
  --nav-height: 54px;
}

/* ── Reset & Base ─────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
}

body.portfolio-body {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
}

body.portfolio-body *:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Layout ───────────────────────────────────────────────── */

.pf-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.pf-section {
  padding: 4rem 0;
}

.pf-rule {
  border: none;
  border-top: 1px solid var(--color-rule);
  margin: 0;
}

/* ── Navigation ───────────────────────────────────────────── */

.pf-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--nav-height);
  background: rgba(246, 243, 238, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

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

.pf-nav__brand {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  flex-shrink: 0;
}

.pf-nav__brand:hover {
  color: var(--color-text);
  text-decoration: none;
}

.pf-nav__links {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.pf-nav__links li a {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--color-text-sub);
  text-decoration: none;
  padding: 0.375rem 0.75rem;
  transition: color 0.1s;
  display: block;
}

.pf-nav__links li a:hover {
  color: var(--color-text);
}

.pf-nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--color-text);
}

/* ── Landing ──────────────────────────────────────────────── */

.pf-landing {
  height: 100vh;    /* base fallback */
  height: 100svh;   /* progressive: excludes mobile browser chrome */
  min-height: 540px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: var(--nav-height);
  position: relative;
}

.pf-landing__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: var(--max-width);
  padding: 0 2rem;
  margin: 0 auto;  /* defensive centering if flex context is unavailable */
}

.pf-landing__logo-wrap {
  margin-bottom: 2rem;
  line-height: 0;
}

.pf-landing__logo {
  width: 120px;
  height: 120px;
  animation: pf-spin 26s linear infinite;
  display: block;
}

@keyframes pf-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.pf-landing__name {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--color-text);
  margin: 0 0 0.5rem;
}

.pf-landing__role {
  font-size: 0.875rem;
  color: var(--color-text-sub);
  margin: 0 0 2rem;
  line-height: 1.6;
  max-width: 420px;
}

.pf-landing__links {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pf-landing__scroll {
  position: absolute;
  bottom: 2.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-text-dim);
  text-decoration: none;
  animation: pf-bob 2.4s ease-in-out infinite;
  padding: 0.5rem;
}

.pf-landing__scroll:hover {
  color: var(--color-text-sub);
}

@keyframes pf-bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%       { transform: translate(-50%, 7px); }
}

/* ── Link styles ──────────────────────────────────────────── */

.pf-link {
  font-size: 0.9375rem;
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--color-border);
  transition: text-decoration-color 0.15s;
}

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

/* ── Section intro paragraph ──────────────────────────────── */

.pf-section-intro {
  font-size: 1.0625rem;
  color: var(--color-text);
  line-height: 1.8;
  max-width: 660px;
  margin: 0 0 2.5rem;
}

/* ── Section titles ───────────────────────────────────────── */

.pf-section-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-text);
  margin: 0 0 2rem;
}

.pf-section-lede {
  font-size: 1rem;
  color: var(--color-text-sub);
  line-height: 1.75;
  max-width: 600px;
  margin: -1.25rem 0 2rem;
}

/* ── Work Focus ───────────────────────────────────────────── */

.pf-focus-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pf-focus-list li {
  font-size: 1rem;
  color: var(--color-text-sub);
  line-height: 1.75;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--color-rule);
}

.pf-focus-list li:first-child {
  border-top: 1px solid var(--color-rule);
}

.pf-focus-list li strong {
  color: var(--color-text);
  font-weight: 500;
}

/* ── Projects ─────────────────────────────────────────────── */

.pf-projects {
  display: flex;
  flex-direction: column;
}

.pf-project {
  padding: 2rem 0;
  border-bottom: 1px solid var(--color-rule);
}

.pf-project:first-child {
  padding-top: 0;
}

.pf-project:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pf-project__header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.pf-project__title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.3;
  margin: 0;
}

.pf-project__domain {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-dim);
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.pf-project__body {
  font-size: 0.9375rem;
  color: var(--color-text-sub);
  line-height: 1.8;
  margin: 0;
  max-width: 680px;
}

/* ── Experience ───────────────────────────────────────────── */

.pf-exp-entries {
  display: flex;
  flex-direction: column;
}

.pf-exp-entry {
  padding: 2rem 0;
  border-bottom: 1px solid var(--color-rule);
}

.pf-exp-entry:first-child {
  padding-top: 0;
}

.pf-exp-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pf-exp-entry__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.625rem;
}

.pf-exp-entry__company {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.pf-exp-entry__role {
  display: block;
  font-size: 0.875rem;
  color: var(--color-text-sub);
  margin-top: 0.125rem;
}

.pf-exp-entry__date {
  font-size: 0.8125rem;
  color: var(--color-text-dim);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 0.125rem;
}

.pf-exp-entry__body {
  font-size: 0.9375rem;
  color: var(--color-text-sub);
  line-height: 1.8;
  margin: 0;
  max-width: 640px;
}

.pf-certs {
  font-size: 0.8125rem;
  color: var(--color-text-dim);
  margin: 2rem 0 0;
  line-height: 1.6;
}

/* ── How I Work ───────────────────────────────────────────── */

.pf-work-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 3rem;
}

.pf-work-item {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.pf-work-item__num {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-dim);
  letter-spacing: 0.05em;
}

.pf-work-item__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  line-height: 1.4;
}

.pf-work-item__desc {
  font-size: 0.9rem;
  color: var(--color-text-sub);
  line-height: 1.75;
  margin: 0;
}

/* ── Contact ──────────────────────────────────────────────── */

.pf-contact__body {
  font-size: 1.0625rem;
  color: var(--color-text-sub);
  line-height: 1.75;
  max-width: 560px;
  margin: 0 0 1.5rem;
}

.pf-contact__links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* ── Footer ───────────────────────────────────────────────── */

.pf-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0;
}

.pf-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pf-footer__name {
  font-size: 0.8125rem;
  color: var(--color-text-dim);
}

.pf-footer__links {
  display: flex;
  gap: 1.25rem;
}

.pf-footer__links a {
  font-size: 0.8125rem;
  color: var(--color-text-dim);
  text-decoration: none;
  transition: color 0.1s;
}

.pf-footer__links a:hover {
  color: var(--color-text-sub);
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
  .pf-nav__links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 1rem 1.5rem 1.5rem;
    align-items: stretch;
  }

  .pf-nav__links.is-open {
    display: flex;
  }

  .pf-nav__links li a {
    padding: 0.625rem 0;
    font-size: 1rem;
  }

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

  .pf-landing__logo {
    width: 96px;
    height: 96px;
  }

  .pf-section {
    padding: 3rem 0;
  }

  .pf-work-items {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .pf-exp-entry__header {
    flex-direction: column;
    gap: 0.125rem;
  }

  .pf-exp-entry__date {
    white-space: normal;
  }

  .pf-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .pf-container {
    padding: 0 1.25rem;
  }

  .pf-nav__inner {
    padding: 0 1.25rem;
  }

  .pf-landing__role {
    max-width: 320px;
  }

  .pf-landing__links {
    gap: 1.25rem;
  }

  .pf-project__header {
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* ── Accessibility & Motion ───────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .pf-landing__logo {
    animation: none;
  }

  .pf-landing__scroll {
    animation: none;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
