/* ==========================================================================
   petersinkevich.com — Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,500;0,8..60,600;1,8..60,400&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  --black: #08080a;
  --surface: #111114;
  --surface-raised: #1a1a1f;
  --border: #2a2a30;
  --border-hover: rgba(200, 164, 78, 0.3);
  --text-primary: #e8e6e1;
  --text-secondary: #8a8a95;
  --text-muted: #5a5a65;
  --white: #ffffff;
  --accent: #c8a44e;
  --accent-dim: rgba(200, 164, 78, 0.15);
  --accent-glow: rgba(200, 164, 78, 0.08);

  --font-display: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-body: 'Source Serif 4', 'Georgia', serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-display);
  background: var(--black);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

ul, ol {
  list-style: none;
}

/* ---------- Selection ---------- */
::selection {
  background: var(--accent);
  color: var(--black);
}

/* ---------- Noise Overlay ---------- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* ---------- Skip Link ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: var(--black);
  padding: 0.5rem 1rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 4px;
  z-index: 200;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
  opacity: 1;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.5rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8, 8, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.nav.scrolled {
  border-bottom-color: var(--border);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.nav-logo:hover {
  opacity: 1;
}

.nav-logo .dot {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  text-decoration: none;
  position: relative;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--white);
  opacity: 1;
}

.nav-links a.active {
  color: var(--white);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
}

/* Focus styles */
.nav-links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

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

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---------- Section Utilities ---------- */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 3rem;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 2rem;
}

/* ---------- Section Divider ---------- */
.divider {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 3rem;
}

.divider-line {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border) 20%, var(--border) 80%, transparent);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 3rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-location {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2rem;
}

.hero-location::before {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--accent);
}

.hero-heading {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--white);
  max-width: 900px;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.hero-heading em {
  font-style: normal;
  color: var(--accent);
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 560px;
  margin-bottom: 3rem;
}

.hero-meta {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
}

.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.hero-meta-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero-meta-value {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 1.5rem;
}

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

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.stat-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Work / Project Cards ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  transition: all 0.4s var(--ease-out);
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.project-card:hover::before {
  opacity: 1;
}

.project-type {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.75rem;
}

.project-desc {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ---------- Story CTA ---------- */
.story-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-top: 3rem;
  padding: 3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.4s var(--ease-out);
}

.story-cta:hover {
  border-color: var(--accent);
  opacity: 1;
}

.story-cta-content {}

.story-cta-heading {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.story-cta-text {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.story-cta-arrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
  transition: gap 0.4s var(--ease-out);
}

.story-cta:hover .story-cta-arrow {
  gap: 1.25rem;
}

/* ---------- Contact ---------- */
.contact-content {
  max-width: 560px;
}

.contact-content > p {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.contact-block {
  margin-top: 1.5rem;
}

.contact-block:first-of-type {
  margin-top: 2rem;
}

.contact-label {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.25rem;
}

.contact-link {
  font-size: 1.05rem;
  color: var(--accent);
}

.contact-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---------- Footer ---------- */
.footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--white);
  opacity: 1;
}

.footer-links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ==========================================================================
   Story Page
   ========================================================================== */

.story-hero {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 8rem 3rem 4rem;
}

.story-hero-tag {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2rem;
}

.story-hero-tag::before {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--accent);
}

.story-hero-heading {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.1;
  max-width: 700px;
  margin-bottom: 1.5rem;
}

.story-hero-byline {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Story body */
.story-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 4rem 3rem 8rem;
}

.story-body p {
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.9;
  color: var(--text-primary);
  margin-bottom: 1.75rem;
}

.story-body p em {
  font-style: italic;
  color: var(--white);
}

.story-body p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
  float: left;
  line-height: 1;
  margin-right: 0.5rem;
  margin-top: 0.1rem;
  color: var(--accent);
}

/* Pull quote */
.pull-quote {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.5;
  padding: 2rem 0 2rem 2rem;
  border-left: 2px solid var(--accent);
  margin: 3rem 0;
}

/* Closing line */
.closing {
  font-family: var(--font-display) !important;
  font-size: 1.6rem !important;
  font-weight: 700 !important;
  color: var(--accent) !important;
  margin-top: 3rem !important;
  letter-spacing: -0.01em;
  line-height: 1.3 !important;
}

/* Back-to-home CTA */
.back-cta {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 3rem 4rem;
}

.back-cta a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: 3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.4s var(--ease-out);
}

.back-cta a:hover {
  border-color: var(--accent);
  opacity: 1;
}

.back-cta-heading {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.back-cta-text {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.back-cta-arrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
  transition: gap 0.4s var(--ease-out);
}

.back-cta a:hover .back-cta-arrow {
  gap: 1.25rem;
}

/* ==========================================================================
   404 Page
   ========================================================================== */

.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 8rem 3rem 4rem;
}

.error-code {
  font-family: var(--font-display);
  font-size: clamp(5rem, 15vw, 12rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.error-message {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
}

.error-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  transition: gap 0.3s var(--ease-out);
}

.error-link:hover {
  gap: 1.25rem;
  opacity: 1;
}

.error-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ==========================================================================
   Animations
   ========================================================================== */

/* Hero staggered fade-up (CSS-only, on load) */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-location,
.story-hero-tag {
  animation: fadeUp 0.8s var(--ease-out) 0s both;
}

.hero-heading,
.story-hero-heading {
  animation: fadeUp 0.8s var(--ease-out) 0.1s both;
}

.hero-subtitle,
.story-hero-byline {
  animation: fadeUp 0.8s var(--ease-out) 0.2s both;
}

.hero-meta {
  animation: fadeUp 0.8s var(--ease-out) 0.35s both;
}

/* Scroll-triggered animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Responsive — Tablet (< 900px)
   ========================================================================== */

@media (max-width: 900px) {
  .nav {
    padding: 1.25rem 1.5rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(8, 8, 10, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
  }

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

  .nav-links a {
    padding: 1rem 1.5rem;
    width: 100%;
  }

  .nav-links a.active::after {
    bottom: 0.75rem;
    left: 1.5rem;
    right: auto;
    width: 16px;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    padding: 7rem 1.5rem 3rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .hero-meta {
    flex-direction: column;
    gap: 1.25rem;
  }

  .section {
    padding: 4rem 1.5rem;
  }

  .divider {
    padding: 0 1.5rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .story-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
    padding: 3rem 1.5rem;
  }

  .story-hero {
    padding: 7rem 1.5rem 3rem;
  }

  .story-body {
    padding: 3rem 1.5rem 6rem;
  }

  .back-cta {
    padding: 0 1.5rem 4rem;
  }

  .back-cta a {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Responsive — Small Mobile (< 600px)
   ========================================================================== */

@media (max-width: 600px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .story-cta,
  .back-cta a {
    padding: 2rem;
  }

  .project-card {
    padding: 2rem;
  }

  .pull-quote {
    font-size: 1.25rem;
    padding: 1.5rem 0 1.5rem 1.5rem;
  }
}
