/* =========================================
   Scott Nelson Dow — Portfolio
   Clean, restrained design system
========================================= */

:root {
  --ink: #171717;
  --paper: #ffffff;
  --soft: #f6f6f4;
  --muted: #686868;
  --line: #ddddda;
  --accent: #3b5f7a;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

a {
  color: inherit;
}

strong {
  font-weight: 600;
}

.container {
  width: min(92%, var(--max-width));
  margin: 0 auto;
}

.narrow {
  width: min(92%, 780px);
  margin-left: auto;
  margin-right: auto;
}

.mono {
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: .025em;
}


/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
}

.nav {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 1.5rem;
}

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

nav a:hover {
  color: var(--ink);
}


/* Homepage hero */

.editorial-hero {
  padding: 5.5rem 0 4.5rem;
  border-bottom: 1px solid var(--line);
}

.hero-status,
.section-kicker,
.project-year,
.hero-facts span,
.case-meta span,
.flow-kicker {
  font-size: .72rem;
  text-transform: uppercase;
  color: var(--muted);
}

.editorial-title {
  margin: 1.5rem 0 2.25rem;
  max-width: 850px;
  font-size: clamp(3rem, 6vw, 5.3rem);
  line-height: 1.02;
  letter-spacing: -.045em;
  font-weight: 600;
}

.hero-bottom {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 5rem;
  align-items: start;
}

.editorial-intro {
  margin: 0;
  max-width: 700px;
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1.5;
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.hero-facts span {
  display: block;
  margin-bottom: .5rem;
}

.hero-facts p {
  margin: 0;
  color: var(--ink);
  font-size: .88rem;
  line-height: 1.45;
}


/* Shared section structure */

.editorial-section,
.section {
  padding: 6.5rem 0;
  border-bottom: 1px solid var(--line);
}

.section-heading-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.section-kicker {
  margin: 0;
  color: var(--accent);
}

.section-note {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
}

.editorial-section-title,
.section h2 {
  margin: 0 0 1.5rem;
  max-width: 820px;
  font-size: clamp(2.15rem, 4vw, 3.7rem);
  line-height: 1.08;
  letter-spacing: -.035em;
  font-weight: 600;
}

.large-copy {
  font-size: 1.3rem;
  line-height: 1.55;
  color: var(--ink) !important;
}


/* Work */

.work-section {
  background: var(--soft);
}

.project-row {
  display: grid;
  grid-template-columns: 52px 1fr 42px;
  gap: 1.5rem;
  padding: 2.75rem 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
}

.project-row:last-child {
  border-bottom: 1px solid var(--line);
}

.project-number {
  padding-top: .25rem;
  color: var(--muted);
  font-size: .78rem;
}

.project-year {
  margin: 0 0 .75rem;
}

.project-row h2 {
  margin: 0;
  max-width: 850px;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -.035em;
  font-weight: 600;
}

.project-subtitle,
.case-study-subtitle {
  margin: .6rem 0 0;
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 600;
}

.project-description {
  max-width: 760px;
  margin: 1.15rem 0 0;
  color: var(--muted);
  font-size: .98rem;
}

.project-arrow {
  align-self: center;
  justify-self: end;
  color: var(--muted);
  font-size: 1.5rem;
}


/* About */

.editorial-split {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 5rem;
}

.about-copy {
  max-width: 720px;
}

.about-copy p {
  color: var(--muted);
}

.about-copy .large-copy {
  margin-top: 0;
}


/* Scroll-driven principles */

.principles-scroll {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.principles-scroll-layout {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 6rem;
  align-items: start;
}

.principles-sticky {
  position: sticky;
  top: 118px;
  padding: 6.5rem 0;
}

.principles-sticky h2 {
  margin: 1.15rem 0 1.5rem;
  max-width: 430px;
  font-size: clamp(2.15rem, 3.5vw, 3.3rem);
  line-height: 1.08;
  letter-spacing: -.035em;
  font-weight: 600;
}

.principles-progress {
  margin: 2rem 0 0;
  color: var(--muted);
  font-size: .78rem;
}

.principles-sequence {
  border-left: 1px solid var(--line);
}

.principle-panel {
  min-height: 78vh;
  padding: 18vh 0 14vh 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: .24;
  transform: translateY(18px);
  transition: opacity .32s ease, transform .32s ease;
}

.principle-panel + .principle-panel {
  border-top: 1px solid var(--line);
}

.principle-panel.is-active {
  opacity: 1;
  transform: translateY(0);
}

.principle-index {
  margin-bottom: 1.2rem;
  color: var(--accent);
  font-size: .76rem;
}

.principle-panel h3 {
  margin: 0 0 1rem;
  max-width: 650px;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.13;
  letter-spacing: -.03em;
  font-weight: 600;
}

.principle-panel p {
  margin: 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.65;
}

/* Experience */

.experience-editorial {
  background: var(--soft);
}

.timeline {
  border-top: 1px solid var(--line);
}

.timeline-row {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--line);
}

.timeline-row h3 {
  margin: 0 0 .2rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.timeline-row p {
  margin: 0;
  color: var(--muted);
}

.timeline-row span {
  color: var(--muted);
  font-size: .7rem;
}


/* Contact */

.contact-editorial {
  padding: 7rem 0;
  background: var(--ink);
  color: #ffffff;
}

.contact-editorial .section-kicker {
  color: #b9c7d1;
}

.contact-editorial h2 {
  margin: 1.5rem 0 0;
  max-width: 820px;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -.04em;
  font-weight: 600;
}

.contact-lead {
  margin: 1.25rem 0 2.5rem;
  color: #b9b9b9;
  font-size: 1.1rem;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.contact-actions a {
  color: #ffffff;
  text-decoration: none;
  border-bottom: 1px solid #777;
  padding-bottom: .2rem;
}

.contact-actions a:hover {
  border-color: #ffffff;
}


/* Footer */

.editorial-footer,
footer {
  padding: 1.6rem 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: .82rem;
}

.footer-content p {
  margin: 0;
}


/* Case studies */

.case-hero {
  padding: 6.5rem 0 5rem;
  background: var(--soft);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.case-hero-grid {
  display: grid;
  grid-template-columns: 1.4fr .6fr;
  gap: 5rem;
  align-items: end;
}

.eyebrow,
.section-label {
  margin: 0 0 1rem;
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.case-title {
  margin: 0;
  max-width: 900px;
  color: var(--ink);
  font-size: clamp(2.7rem, 5vw, 4.8rem);
  line-height: 1.03;
  letter-spacing: -.04em;
  font-weight: 600;
}

.case-subtitle {
  margin: .9rem 0 0;
  color: var(--accent);
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 600;
}

.hero-copy {
  max-width: 760px;
  margin: 1.7rem 0 0;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.55;
}

.case-meta {
  padding-left: 1.75rem;
  border-left: 1px solid var(--line);
}

.case-meta div {
  margin-bottom: 1.4rem;
}

.case-meta span {
  display: block;
  margin-bottom: .25rem;
}

.case-meta strong {
  display: block;
  color: var(--ink);
  font-size: .95rem;
  line-height: 1.45;
  font-weight: 600;
}

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

.section p {
  color: var(--muted);
}

.section p strong {
  color: var(--ink);
}

.two-column {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 5rem;
}

.flow-diagram {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 1fr auto 1.15fr auto 1fr auto 1fr;
  gap: .9rem;
  align-items: stretch;
}

.flow-box {
  min-height: 170px;
  padding: 1.35rem;
  background: var(--paper);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.flow-box-accent {
  border-color: var(--accent);
}

.flow-box strong {
  font-size: 1rem;
  font-weight: 600;
}

.flow-box p {
  margin-bottom: 0;
  font-size: .88rem;
}

.flow-kicker {
  margin-bottom: .45rem;
  color: var(--accent);
}

.flow-arrow {
  align-self: center;
  color: var(--muted);
  font-size: 1.4rem;
}

.case-quote {
  margin: 2.5rem 0 0;
  padding: 0 0 0 1.25rem;
  border-left: 3px solid var(--accent);
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.5;
}

.role-grid,
.principles-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
}

.role-card,
.principles-grid > div {
  min-height: 190px;
  padding: 1.75rem 1.75rem 1.75rem 0;
  background: transparent;
  border-bottom: 1px solid var(--line);
}

.role-card:nth-child(odd),
.principles-grid > div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.role-card:nth-child(even),
.principles-grid > div:nth-child(even) {
  padding-left: 1.75rem;
}

.role-card h3,
.principles-grid h3 {
  margin: 0 0 .75rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.logic-example {
  margin-top: 2rem;
  padding: 1.4rem;
  background: var(--soft);
  border: 1px solid var(--line);
}

.logic-example span,
.logic-example strong {
  display: block;
}

.logic-example span {
  margin-bottom: .2rem;
  color: var(--muted);
}

.logic-example strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.ops-flow {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.ops-step {
  min-height: 210px;
  padding: 1.35rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ops-step span {
  display: block;
  margin-bottom: 2rem;
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: .7rem;
}

.ops-step strong {
  display: block;
  margin-bottom: .5rem;
  font-size: 1rem;
}

.ops-step p {
  margin-bottom: 0;
  font-size: .88rem;
}

.button {
  display: inline-block;
  padding: .75rem 1.05rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.button:hover {
  background: var(--ink);
  color: #ffffff;
}

.case-back {
  margin-top: 2.5rem;
}


/* Responsive */

@media (max-width: 960px) {
  .hero-bottom,
  .editorial-split,
  .case-hero-grid,
  .two-column {
    grid-template-columns: 1fr;
    gap: 2.75rem;
  }

  .hero-facts {
    max-width: 700px;
  }

  .case-meta {
    padding-left: 0;
    padding-top: 1.75rem;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .flow-diagram {
    grid-template-columns: 1fr;
  }

  .flow-arrow {
    transform: rotate(90deg);
    justify-self: center;
  }

  .ops-flow {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .nav {
    min-height: auto;
    padding: 1rem 0;
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    gap: 1rem;
    overflow-x: auto;
  }

  .editorial-hero {
    padding: 4rem 0 3.5rem;
  }

  .editorial-title {
    font-size: 3rem;
  }

  .hero-facts {
    grid-template-columns: 1fr;
  }

  .editorial-section,
  .section {
    padding: 4.5rem 0;
  }

  .section-heading-row {
    grid-template-columns: 1fr;
    gap: .65rem;
  }

  .project-row {
    grid-template-columns: 36px 1fr;
    gap: 1rem;
    padding: 2.3rem 0;
  }

  .project-arrow {
    display: none;
  }

  .principle-row {
    grid-template-columns: 36px 1fr;
  }

  .principle-row p {
    grid-column: 2;
  }

  .role-grid,
  .principles-grid {
    grid-template-columns: 1fr;
  }

  .role-card:nth-child(odd),
  .principles-grid > div:nth-child(odd) {
    border-right: 0;
  }

  .role-card:nth-child(even),
  .principles-grid > div:nth-child(even) {
    padding-left: 0;
  }

  .ops-flow {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: column;
  }
}


@media (max-width: 900px) {
  .principles-scroll-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .principles-sticky {
    position: relative;
    top: auto;
    padding: 4.5rem 0 2rem;
    background: var(--paper);
    z-index: 2;
  }

  .principles-sticky h2 {
    max-width: 650px;
  }

  .principles-progress {
    display: none;
  }

  .principles-sequence {
    border-left: 0;
  }

  .principle-panel {
    min-height: auto;
    padding: 3rem 0;
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .principle-panel {
    transition: none;
    transform: none;
  }
}



/* About me */

.about-me-section {
  background: var(--paper);
}

.about-me-layout {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 3rem;
  align-items: center;
}

.about-me-photo-wrap {
  max-width: 140px;
}

.about-me-photo {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.about-me-copy {
  max-width: 720px;
}

.about-me-copy .large-copy {
  margin-top: 0;
}

@media (max-width: 860px) {
  .about-me-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-me-photo-wrap {
    max-width: 180px;
  }
}


/* =========================================
   Accessibility hardening
========================================= */

/* Keyboard users can bypass repeated navigation. */
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1000;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: #ffffff;
  border: 2px solid #ffffff;
  text-decoration: none;
  font-weight: 600;
  transform: translateY(-180%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Clear, consistent focus indication for keyboard navigation. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

/* Make the focus ring especially clear on the dark contact area. */
.contact-editorial a:focus-visible {
  outline-color: #ffffff;
}

/* Avoid scroll animation when the user has requested reduced motion. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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