/* ============================================
   Mike Fortier Jr. — Portfolio
   Shared Styles
   ============================================ */

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

/* Variables */
:root {
  --primary: #2C2520;
  --body: #4A3F38;
  --muted: #8C7A6B;
  --accent: #C4643A;
  --bg: #F5F0EB;
  --card-bg: #EDE7E0;
  --border: rgba(140, 122, 107, 0.2);
  --border-light: rgba(140, 122, 107, 0.15);
  --font-display: 'Fraunces', serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --col-width: 740px;
  --wide-width: 960px;
}

/* Base */
html { scroll-behavior: smooth; }

/* Site Header */
.site-header {
  width: 100%;
}

.site-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
}

.site-header-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-header-name:hover {
  color: var(--accent);
}

.site-header-links {
  display: flex;
  gap: 24px;
}

.site-header-links a {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-header-links a:hover {
  color: var(--accent);
}

body {
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Pin Fraunces optical size to prevent variable axis glitchiness at mid-sizes */
.hero-name,
.hero-headline,
.section-header,
.project-title,
.cs-title,
.cs-subtitle,
.prose-section-header,
.principle-number,
.principle-title,
.tone-header,
.tier-label,
.tier-header,
.footer-email,
.project-nav-title {
  font-optical-sizing: none;
}

/* Layout */
.container {
  max-width: var(--col-width);
  margin: 0 auto;
  padding: 0 24px;
}

.container-wide {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 24px;
}

.container-full {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}


/* ============================================
   Typography
   ============================================ */

.section-header {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.prose p {
  margin-bottom: 20px;
  color: var(--body);
  font-size: 16px;
  line-height: 1.7;
}

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


/* ============================================
   Hero (Home)
   ============================================ */

.hero {
  padding: 80px 0 100px;
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 64px;
  font-variation-settings: 'opsz' 72;
  color: var(--primary);
  line-height: 1.05;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.hero-role {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-headline {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 18px;
  color: var(--body);
  line-height: 1.6;
  max-width: 620px;
}


/* ============================================
   Project Cards (Home) — Unified System
   ============================================ */

.work-section {
  padding: 0;
}

/* Shared card styles */
.project-card {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 40px;
  cursor: pointer;
  text-decoration: none;
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  min-height: 420px;
}

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

/* All cards: text left, image right */
.project-card { flex-direction: row-reverse; }

.project-card-surface {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  min-height: 420px;
}

.project-card-text {
  flex: 0 0 380px;
  padding: 40px 48px;
}

.project-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  color: var(--primary);
  margin-bottom: 12px;
  transition: color 0.2s ease;
}

.project-description {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}

/* Browser frame for CDN */
.browser-frame {
  width: 100%;
  max-width: 560px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #FFF;
}

.browser-chrome {
  background: #F0F0F0;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.browser-dots {
  display: flex;
  gap: 4px;
}

.browser-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #D4D4D4;
}

.browser-address {
  flex: 1;
  background: #E8E8E8;
  border-radius: 3px;
  padding: 3px 8px;
  font-family: var(--font-body);
  font-size: 9px;
  color: #999;
}

.browser-viewport {
  max-height: 380px;
  overflow: hidden;
}

.browser-viewport img {
  width: 100%;
  height: auto;
  display: block;
}

/* Phone frame for Game */
.phone-frame-card {
  width: 200px;
  height: 420px;
  border-radius: 32px;
  background: #1C1118;
  border: 12px solid #000;
  box-sizing: content-box;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.phone-frame-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 26px;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255,255,255,0.012) 2px,
    rgba(255,255,255,0.012) 4px
  );
  pointer-events: none;
}

.phone-notch-card {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 20px;
  border-radius: 12px;
  background: #000;
  z-index: 2;
}

.phone-frame-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 26px;
  position: relative;
  z-index: 1;
}

/* Tablet frame for Smart Home — matches Echo Hub frame on case study */
.tablet-frame-card {
  width: 480px;
  max-width: 100%;
  background: #E8E4E0;
  border-radius: 20px;
  padding: 16px;
  border: 1.5px solid #CBC4BD;
}

.tablet-frame-card-screen {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid rgba(0, 0, 0, 0.15);
}

.tablet-frame-card-screen img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}


/* ============================================
   About (Home)
   ============================================ */

.about-section {
  padding: 60px 0 0;
  border-top: 1px solid var(--border);
}

.about-surface {
  padding: 0;
}

.about-surface .section-header {
  margin-bottom: 32px;
}

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

.about-text p {
  margin-bottom: 20px;
  color: var(--body);
  font-size: 16px;
  line-height: 1.7;
}

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


/* ============================================
   Footer
   ============================================ */

.footer {
  padding: 48px 0 80px;
}

.footer-email {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  margin-bottom: 16px;
}

.footer-email a {
  color: var(--primary);
  transition: color 0.2s ease;
}

.footer-email a:hover { color: var(--accent); }

.footer-links {
  margin-bottom: 20px;
}

.footer-links a {
  font-size: 15px;
  color: var(--muted);
  transition: color 0.2s ease;
}

.footer-links a:hover { color: var(--accent); }

.footer-availability {
  font-size: 15px;
  color: var(--muted);
}


/* ============================================
   Case Study — Shared
   ============================================ */

.back-link {
  padding: 32px 0 0;
}

.back-link a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s ease;
}

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

.cs-hero {
  padding: 48px 0 56px;
}

.cs-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 44px;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.cs-subtitle {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 18px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 560px;
}

.prose-section {
  margin-bottom: 64px;
}

.prose-section-header {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  color: var(--primary);
  margin-bottom: 24px;
}

/* Case study images */
.cs-image-wrap {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
}

.cs-image {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.cs-image::before { display: none; }

.cs-image img {
  display: block;
  transform-origin: 0 0;
  max-width: none;
  border-radius: 4px;
}

.cs-hero-image {
  margin-bottom: 80px;
}

/* NDA callout */
.nda-callout {
  border-left: 3px solid var(--accent);
  padding: 24px 0 24px 24px;
  margin: 64px 0;
}

.nda-callout p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  font-style: italic;
}

/* Project navigation */
.project-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 48px 0 80px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.project-nav-item { text-decoration: none; }

.project-nav-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
  display: block;
}

.project-nav-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--primary);
  transition: color 0.2s ease;
}

.project-nav-item:hover .project-nav-title { color: var(--accent); }

.project-nav-next { text-align: right; }


/* ============================================
   CDN Case Study — Principles
   ============================================ */

.principle {
  margin-bottom: 72px;
  padding-bottom: 72px;
  border-bottom: 1px solid var(--border-light);
}

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

.principle-number {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.principle-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 20px;
}

.principle-text p {
  color: var(--body);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 20px;
}

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


/* ============================================
   Game Case Study
   ============================================ */

.phone-showcase {
  display: flex;
  justify-content: center;
  gap: 40px;
  align-items: flex-start;
  padding: 60px 0;
}

.phone-showcase .phone-frame {
  width: 260px;
  min-width: 260px;
  height: 520px;
  border-radius: 32px;
}

.phone-showcase .phone-frame img {
  border-radius: 29px;
}

.screenshot-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 56px;
}

.screenshot-slot {
  height: 280px;
  border-radius: 8px;
  background: #1C1118;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.screenshot-slot::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255,255,255,0.01) 2px,
    rgba(255,255,255,0.01) 4px
  );
  pointer-events: none;
}

.screenshot-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  position: relative;
  z-index: 1;
}

.tone-section { margin-bottom: 56px; }

.tone-header {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  color: var(--primary);
  margin-bottom: 20px;
}

.tone-text p {
  color: var(--body);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 20px;
}

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


/* ============================================
   Smart Home Case Study — Tiers
   ============================================ */

.tier-section { margin-bottom: 56px; }

.tier-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.tier-header {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  color: var(--primary);
  margin-bottom: 20px;
}

.tier-text p {
  color: var(--body);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 20px;
}

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

.tier-image {
  width: 100%;
  height: 340px;
  border-radius: 8px;
  background: #1B2028;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.tier-image::before {
  content: '';
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(70, 140, 200, 0.05);
  top: 30%;
  left: 30%;
  filter: blur(30px);
}

.tier-image-alt { background: #171F2A; }

.tier-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  position: relative;
  z-index: 1;
}

.tier-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 56px 0;
}

.tablet-frame-lg {
  width: 100%;
  max-width: 680px;
  height: 420px;
  border-radius: 18px;
  background: #1B2028;
  border: 3px solid #252d38;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.tablet-frame-lg::before {
  content: '';
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(70, 140, 200, 0.06);
  top: 25%;
  left: 20%;
  filter: blur(35px);
}

.tablet-frame-lg::after {
  content: '';
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(196, 100, 58, 0.06);
  bottom: 20%;
  right: 15%;
  filter: blur(30px);
}

.tablet-frame-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 15px;
  position: relative;
  z-index: 1;
}


/* ============================================
   Animation
   ============================================ */

.fade-in {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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


/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .hero { padding: 60px 0 60px; }
  .hero-name { font-size: 42px; }
  .hero-headline { font-size: 16px; }
  .site-header-inner { padding: 20px 16px; }
  .site-header-links { gap: 16px; }
  .site-header-links a { font-size: 12px; }
  .project-card { flex-direction: column !important; min-height: auto; }
  .project-card-surface { min-height: 240px; padding: 32px 24px; }
  .project-card-text { flex: none; width: 100%; padding: 24px 28px 28px; }
  .browser-viewport { max-height: 260px; }
  .phone-frame-card { width: 140px; height: 290px; border-radius: 26px; border-width: 5px; }
  .phone-frame-card img { border-radius: 22px; }
  .phone-notch-card { width: 56px; height: 16px; border-radius: 10px; top: 8px; }
  .tablet-frame-card { 
    width: 100%; 
    max-width: 100%;
    padding: 10px;
    border-radius: 16px;
  }
  .container-full { padding: 0 16px; }
  .about-content { flex-direction: column; gap: 32px; }
  .container-wide { max-width: 100%; }
  .cs-title { font-size: 32px; }
  .cs-image-wrap { padding: 12px; }
  .principle-title { font-size: 22px; }
  .phone-showcase { flex-direction: column; align-items: center; gap: 24px; }
  .phone-showcase .phone-frame { width: 220px; min-width: 220px; height: 440px; }
  .tablet-frame-lg { height: 280px; }
  .project-nav { flex-direction: column; gap: 32px; align-items: flex-start; }
  .project-nav-next { text-align: left; }
}
