/* ============================================================
   CHARLIE HARLOW PORTFOLIO — STYLESHEET
   Sage & cream minimalist design
   ============================================================ */

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

:root {
  --cream:       #F8F5EE;
  --cream-dark:  #F0EBE0;
  --sage:        #7D9B76;
  --sage-light:  #EAF0E7;
  --sage-mid:    #B8CCAD;
  --sage-dark:   #5C7A55;
  --dark:        #1C1C1C;
  --mid:         #5A5A5A;
  --light:       #9A9A9A;
  --white:       #FFFFFF;
  --max-w:       1160px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--cream);
  color: var(--dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 22px 48px;
  background: rgba(248, 245, 238, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.3s, padding 0.3s;
  border-bottom: 1px solid transparent;
}

#nav.scrolled {
  border-bottom-color: rgba(125, 155, 118, 0.25);
  padding: 16px 48px;
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  color: var(--dark);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 40px;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--mid);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--sage-dark);
}

.nav-cta {
  padding: 10px 22px !important;
  background: var(--sage) !important;
  color: var(--white) !important;
  transition: background 0.2s !important;
}

.nav-cta:hover {
  background: var(--sage-dark) !important;
  color: var(--white) !important;
}

/* ============================================================
   HERO
   ============================================================ */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 48px 80px;
  position: relative;
  background: radial-gradient(ellipse at 65% 50%, #F0E8D5 0%, var(--cream) 65%);
}

.hero-content {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.hero-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sage);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 20px;
}

.hero-text h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(4.5rem, 8vw, 7.5rem);
  font-weight: 500;
  line-height: 1.0;
  color: var(--dark);
  margin-bottom: 32px;
  letter-spacing: -0.01em;
}

.hero-tagline {
  font-size: 1.2rem;
  line-height: 1.75;
  color: var(--mid);
  font-style: italic;
  border-left: 3px solid var(--sage);
  padding-left: 20px;
  margin-bottom: 20px;
  max-width: 520px;
}

.hero-sub {
  font-size: 0.9rem;
  color: var(--light);
  margin-bottom: 40px;
  padding-left: 23px;
}

.hero-cta {
  display: inline-block;
  padding: 15px 38px;
  background: var(--dark);
  color: var(--white);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.25s;
}

.hero-cta:hover {
  background: var(--sage-dark);
}

.hero-image {
  display: flex;
  justify-content: center;
}

.hero-image img {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: top center;
  filter: grayscale(18%) brightness(1.02);
  box-shadow: 0 0 0 6px var(--cream), 0 0 0 8px var(--sage-mid);
}

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0.4;
}

.hero-scroll span {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: var(--sage);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(0.6); }
}

/* ============================================================
   SHARED SECTION STYLES
   ============================================================ */
.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

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

.section-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--dark);
}

.section-sub {
  color: var(--light);
  font-size: 0.95rem;
}

/* ============================================================
   WORK / PROJECT GRID
   ============================================================ */
#work {
  padding: 100px 48px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* Standard tile */
.project-tile {
  cursor: pointer;
  background: var(--white);
  overflow: hidden;
  border: 1px solid var(--sage-light);
  border-top: 3px solid transparent;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.35s ease,
              border-top-color 0.3s ease;
  outline: none;
}

.project-tile:hover,
.project-tile:focus {
  transform: translateY(-6px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
  border-top-color: var(--sage);
}

.tile-image {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-tile:hover .tile-image img {
  transform: scale(1.05);
}

.tile-overlay {
  position: absolute;
  inset: 0;
  background: rgba(248, 245, 238, 0.15);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 16px 20px;
  opacity: 0;
  transition: opacity 0.3s;
}

.project-tile:hover .tile-overlay,
.project-tile:focus .tile-overlay {
  opacity: 1;
}

.tile-overlay span {
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: rgba(92, 122, 85, 0.9);
  padding: 6px 14px;
}

.tile-info {
  padding: 22px 24px 26px;
}

.tile-brand {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--sage);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
}

.tile-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--dark);
  line-height: 1.45;
  margin-bottom: 10px;
}

.tile-metric {
  font-size: 0.78rem;
  color: var(--light);
}

/* Tile 4 — spans 2 columns */
.project-tile:nth-child(4) {
  grid-column: span 2;
}

/* Tile 5 — spans 1 column, standard layout */
.tile-wide {
  grid-column: span 1;
}

.tile-wide .tile-image {
  height: 220px;
}

.tile-wide .tile-image img {
  object-fit: contain;
  background: var(--cream-dark);
  padding: 20px;
}

.tile-info-wide {
  padding: 22px 24px 26px;
}

/* ============================================================
   RECOMMENDATIONS
   ============================================================ */
#recommendations {
  padding: 100px 48px;
  background: var(--white);
}

.rec-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}

.rec-scroll:active { cursor: grabbing; }

.rec-scroll::-webkit-scrollbar { height: 3px; }
.rec-scroll::-webkit-scrollbar-track { background: var(--cream-dark); }
.rec-scroll::-webkit-scrollbar-thumb { background: var(--sage-mid); border-radius: 2px; }

.rec-card {
  flex: 0 0 360px;
  background: var(--cream);
  border-left: 4px solid var(--sage);
  padding: 36px 32px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.rec-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.07);
}

.rec-quote {
  font-size: 0.92rem;
  color: var(--mid);
  line-height: 1.85;
  font-style: italic;
  flex: 1;
}

.rec-author {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--sage-light);
}

.rec-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dark);
}

.rec-role {
  font-size: 0.72rem;
  color: var(--sage-dark);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.rec-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--light);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 20px;
}

/* ============================================================
   ABOUT
   ============================================================ */
#about {
  padding: 100px 48px;
  background: var(--sage-light);
}

.about-inner {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 80px;
  align-items: start;
}

.about-text h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  font-weight: 500;
  margin-bottom: 28px;
}

.about-text p {
  color: var(--mid);
  font-size: 0.97rem;
  line-height: 1.85;
  margin-bottom: 18px;
}

.about-availability {
  color: var(--sage-dark) !important;
  font-weight: 500;
  margin-top: 12px !important;
}

.about-skills h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  margin-bottom: 22px;
  color: var(--dark);
}

.skills-list {
  list-style: none;
}

.skills-list li {
  padding: 13px 0;
  border-bottom: 1px solid var(--sage-mid);
  font-size: 0.88rem;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 12px;
}

.skills-list li:last-child {
  border-bottom: none;
}

.skills-list li::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--sage);
  flex-shrink: 0;
}

/* ============================================================
   CONTACT
   ============================================================ */
#contact {
  padding: 100px 48px;
  background: var(--dark);
  text-align: center;
}

.contact-inner {
  max-width: 600px;
}

#contact h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  font-weight: 500;
  color: var(--white);
  margin-bottom: 16px;
}

#contact p {
  color: var(--light);
  font-size: 0.95rem;
  margin-bottom: 44px;
}

.contact-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-link {
  display: inline-block;
  padding: 15px 38px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.25s;
}

.contact-primary {
  background: var(--sage);
  color: var(--white);
}

.contact-primary:hover {
  background: var(--sage-dark);
}

.contact-secondary {
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--white);
}

.contact-secondary:hover {
  border-color: var(--white);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  padding: 24px 48px;
  background: var(--dark);
  border-top: 1px solid #2a2a2a;
  text-align: center;
}

footer p {
  color: #484848;
  font-size: 0.75rem;
}

/* ============================================================
   MODAL OVERLAY
   ============================================================ */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}

#modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.modal.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.modal-inner {
  background: var(--cream);
  max-width: 880px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 56px 64px 64px;
  scroll-behavior: smooth;
}

/* Scrollbar styling */
.modal-inner::-webkit-scrollbar { width: 4px; }
.modal-inner::-webkit-scrollbar-track { background: var(--cream-dark); }
.modal-inner::-webkit-scrollbar-thumb { background: var(--sage-mid); }

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--light);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  z-index: 10;
  margin: -16px -16px 8px 0;
}

.modal-close:hover {
  color: var(--dark);
}

/* Modal header */
.modal-header {
  margin-bottom: 36px;
  clear: both;
}

.modal-brand {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--sage);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 14px;
}

.modal-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.25;
  color: var(--dark);
  margin-bottom: 16px;
}

.modal-overview {
  font-size: 1rem;
  color: var(--mid);
  line-height: 1.75;
}

/* Metrics bar */
.metrics-bar {
  display: flex;
  flex-wrap: wrap;
  background: var(--sage-light);
  margin-bottom: 48px;
}

.metric {
  flex: 1;
  min-width: 110px;
  padding: 20px 22px;
  border-right: 1px solid rgba(184, 204, 173, 0.6);
  text-align: center;
}

.metric:last-child {
  border-right: none;
}

.metric-value {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.55rem;
  color: var(--sage-dark);
  margin-bottom: 4px;
  line-height: 1.1;
}

.metric-label {
  display: block;
  font-size: 0.65rem;
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.4;
}

/* Modal body sections */
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.modal-section h4 {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--sage);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 14px;
}

.modal-section p {
  font-size: 0.93rem;
  color: var(--mid);
  line-height: 1.8;
}

.modal-section ul {
  list-style: none;
  padding: 0;
}

.modal-section ul li {
  padding: 5px 0 5px 22px;
  position: relative;
  font-size: 0.93rem;
  color: var(--mid);
  line-height: 1.7;
}

.modal-section ul li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--sage);
}

/* Video grid */
.video-grid {
  display: flex;
  gap: 16px;
}

/* Vertical (TikTok) — horizontal scroll row */
.video-grid.vertical {
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.video-grid.vertical::-webkit-scrollbar { height: 3px; }
.video-grid.vertical::-webkit-scrollbar-track { background: var(--cream-dark); }
.video-grid.vertical::-webkit-scrollbar-thumb { background: var(--sage-mid); border-radius: 2px; }

.video-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

/* TikTok / vertical video container
   Renders iframe at TikTok's native 325px then scales to fit container
   — prevents right-edge clipping */
.tiktok-container {
  width: 300px;
  height: 533px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.tiktok-container iframe {
  width: 325px;
  height: 578px;
  transform: scale(0.923);
  transform-origin: top left;
  border: none;
  display: block;
}

/* Wide horizontal YouTube video */
.horizontal-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.youtube-wide {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
}

.creator-credit {
  font-size: 0.72rem;
  color: var(--light);
}

/* Modal images */
.modal-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.modal-images img {
  width: 100%;
  object-fit: cover;
}

.blog-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--sage-dark);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  transition: color 0.2s;
}

.blog-link:hover {
  color: var(--dark);
}

/* Audience comments */
.comments-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment {
  font-size: 0.88rem !important;
  color: var(--mid) !important;
  background: var(--white);
  padding: 10px 16px;
  border-left: 2px solid var(--sage-mid);
}

/* Recommendation */
.recommendation {
  background: var(--sage-light);
  padding: 32px 36px;
  border-left: 4px solid var(--sage);
}

.recommendation blockquote p {
  font-style: italic;
  font-size: 0.95rem !important;
  line-height: 1.85 !important;
  color: var(--dark) !important;
  margin-bottom: 16px;
}

.recommendation blockquote cite {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sage-dark);
  font-style: normal;
  letter-spacing: 0.03em;
}

/* ============================================================
   RESPONSIVE — TABLET (≤ 960px)
   ============================================================ */
@media (max-width: 960px) {
  #nav { padding: 18px 32px; }
  #nav.scrolled { padding: 14px 32px; }

  #hero { padding: 100px 32px 70px; }
  .hero-content {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }
  .hero-image { order: -1; }
  .hero-image img { max-width: 320px; margin: 0 auto; }
  .hero-tagline { margin-left: auto; margin-right: auto; }
  .hero-sub { padding-left: 0; }
  .hero-cta { margin: 0 auto; }

  #work { padding: 80px 32px; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .project-tile:nth-child(4) { grid-column: span 1; }
  .tile-wide { grid-column: span 1; }

  #about { padding: 80px 32px; }
  .about-inner { grid-template-columns: 1fr; gap: 48px; }

  #contact { padding: 80px 32px; }
  footer { padding: 20px 32px; }

  .modal { padding: 20px; }
  .modal-inner { padding: 40px 36px; }
  .video-grid.vertical { grid-template-columns: repeat(2, 1fr); }
  .metrics-bar { flex-wrap: wrap; }
  .metric { min-width: 40%; }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤ 600px)
   ============================================================ */
@media (max-width: 600px) {
  #nav { padding: 16px 20px; }
  #nav.scrolled { padding: 12px 20px; }
  .nav-links { gap: 16px; }
  .nav-links li:first-child { display: none; }

  #hero { padding: 90px 20px 60px; }
  .hero-text h1 { font-size: 3rem; }

  #work { padding: 60px 20px; }
  .project-grid { grid-template-columns: 1fr; }
  .project-tile:nth-child(4) { grid-column: span 1; }
  .tile-wide { grid-column: span 1; }
  .tile-info-wide { padding: 24px !important; }
  .tile-info-wide .tile-title { font-size: 1.1rem; }

  #about { padding: 60px 20px; }
  #contact { padding: 60px 20px; }
  footer { padding: 20px; }

  .modal { padding: 0; align-items: flex-end; }
  .modal-inner {
    max-height: 95vh;
    padding: 32px 20px 40px;
    border-radius: 16px 16px 0 0;
  }

  .video-grid.vertical { grid-template-columns: 1fr; }
  .metric { min-width: 50%; }
  .metrics-bar { flex-wrap: wrap; }

  .recommendation { padding: 24px 20px; }
  .hero-scroll { display: none; }

  /* Recommendations — full-width cards so one shows at a time */
  #recommendations { padding: 60px 0; }
  #recommendations .section-header { padding: 0 24px 32px; }
  .rec-scroll { padding: 0 24px 20px; gap: 16px; }
  .rec-card { flex: 0 0 calc(100vw - 48px); }
}
