/* ============================================================
   POLARIS DESIGN HAWAII — Shared Stylesheet
   Used by: index.html  &  portfolio.html
   Fonts: Georgia (serif display) + system-ui (body)
   Colors: white background, #111 ink, #111 nav underline accent
   ============================================================ */

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand palette — Polaris Design Hawaii */
  --white:       #ffffff;
  --bg:          #ffffff;
  --bg-soft:     #fafafa;
  --ink:         #111111;
  --ink-mid:     #444444;
  --ink-muted:   #777777;
  --ink-faint:   #aaaaaa;
  --rule:        #eeeeee;
  --rule-mid:    #dddddd;

  /* Phase indicator dots */
  --phase-before: #b89d7a;
  --phase-during: #7a9a80;
  --phase-after:  #5a85a8;

  /* Typography */
  --font-serif: Georgia, "Times New Roman", serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Spacing */
  --gutter: 6%;
  --gutter-wide: 8%;
  /*--nav-h: 78px; */
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-serif); font-weight: 400; }
p { color: var(--ink-mid); }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ── SHARED NAV ── */
.site-header {
  position: fixed;
  width: 100%;
  padding: 28px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: padding 0.4s ease, border-color 0.4s ease;
}
.site-header.scrolled {
  padding: 18px var(--gutter);
  border-color: var(--rule);
}

.site-logo {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink);
}

.site-nav {
  display: flex;
  gap: 0;
  list-style: none;
}
.site-nav a {
  margin-left: 30px;
  font-size: 0.82rem;
  letter-spacing: 1px;
  color: var(--ink);
  position: relative;
  padding-bottom: 4px;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 0;
  height: 1px;
  background: var(--ink);
  transition: width 0.3s ease;
}
.site-nav a:hover::after,
.site-nav a.active::after { width: 100%; }

/* ── SHARED FOOTER ── */
.site-footer {
  padding: 80px var(--gutter);
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--rule);
}
.site-footer p + p { margin-top: 6px; }
.site-footer a { color: var(--ink); }
.site-footer a:hover { text-decoration: underline; }

/* ── SHARED FADE-IN ── */
.fade {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.fade.visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   HOME PAGE — index.html
   ============================================================ */

/* FULLSCREEN HERO SECTION */
.hero-section {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}
.hero-section img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  transform: scale(1.05);
  transition: transform 6s ease;
}
.hero-section.loaded img { transform: scale(1); }
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}
.hero-body {
  position: absolute;
  bottom: 12%;
  left: var(--gutter);
  color: var(--white);
  max-width: 700px;
}
.hero-body h1 {
  font-size: 4rem;
  line-height: 1.1;
  color: var(--white);
}
.hero-body h2 {
  font-size: 1.1rem;
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--white);
  margin-top: 16px;
}
.hero-body p { color: rgba(255,255,255,0.85); margin-top: 20px; font-size: 1.05rem; }
.hero-body a {
  display: inline-block;
  margin-top: 30px;
  border-bottom: 1px solid var(--white);
  padding-bottom: 4px;
  font-size: 0.82rem;
  letter-spacing: 1px;
  color: var(--white);
}

/* ABOUT */
.about-section {
  padding: 140px var(--gutter-wide);
  max-width: 1000px;
  margin: auto;
}
.about-section h2 { font-size: 2.4rem; margin-bottom: 30px; }

/* SERVICES */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 80px;
  padding: 120px var(--gutter-wide);
}
.services-grid h3 { margin-bottom: 12px; font-size: 1.4rem; }
.services-grid p { font-size: 0.92rem; }

/* PROCESS */
.process-section {
  background: var(--bg-soft);
  padding: 120px var(--gutter-wide);
}
.process-section h2 { font-size: 2.4rem; margin-bottom: 40px; }
.process-steps {
  display: flex;
  gap: 60px;
}
.process-step span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.process-step p { font-size: 0.92rem; }

/* CONTACT */
.contact-section {
  padding: 140px var(--gutter-wide);
  max-width: 1000px;
  margin: auto;
}
.contact-section h2 { font-size: 2.4rem; margin-bottom: 30px; }
.contact-section p { font-size: 0.95rem; }
.contact-section p + p { margin-top: 8px; }
.contact-section a:hover { text-decoration: underline; }

/* ============================================================
   PORTFOLIO PAGE — portfolio.html
   ============================================================ */

/* PORTFOLIO HERO */
.port-hero {
  margin-top: var(--nav-h);
  height: 100vh;
  min-height: 560px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  background: var(--ink);
}
.port-hero-mosaic {
  display: grid;
  grid-template-rows: 60% 40%;
  overflow: hidden;
}
.port-hero-mosaic-top {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.72);
}
.port-hero-mosaic-bot {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.port-hero-mosaic-bot img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.62);
}
.port-hero-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 5rem 5rem 5rem 4.5rem;
  background: var(--ink);
}
.port-hero-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(251, 251, 251, 251);
  margin-bottom: 2rem;
}
.port-hero-h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 5vw, 4.4rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 1.4rem;
}
.port-hero-rule {
  width: 36px; height: 1px;
  background: rgba(255,255,255,0.3);
  margin-bottom: 1.4rem;
}
.port-hero-sub {
  font-size: 0.88rem;
  line-height: 1.8;
  color: rgba(251,251,251,251);
  max-width: 300px;
  margin-bottom: 3rem;
}
.port-hero-scroll {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}
.port-hero-scroll-line {
  width: 40px; height: 1px;
  background: rgba(255,255,255,0.2);
}

/* PAGE WRAP */
.port-page-wrap { background: var(--bg); }

/* PROJECT CHAPTER */
.chapter {
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.chapter-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 2rem;
  padding: 3.5rem var(--gutter) 2rem;
  border-bottom: 1px solid var(--rule);
}
.chapter-num {
  font-family: var(--font-serif);
  font-size: 5rem;
  line-height: 1;
  font-weight: 400;
  color: var(--rule-mid);
  letter-spacing: -0.04em;
  user-select: none;
}
.chapter-tag {
  font-size: 0.67rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
}
.chapter-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
}
.chapter-title em { font-style: italic; }
.chapter-subtitle {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}
.chapter-stats {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.chapter-stat {
  font-size: 0.67rem;
  letter-spacing: 1px;
  color: var(--ink-faint);
  white-space: nowrap;
  text-transform: uppercase;
}

/* PHASE TABS */
.phase-nav {
  display: flex;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--rule);
  background: var(--bg-soft);
}
.phase-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.9rem 1.4rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
  position: relative;
  bottom: -1px;   /* sits on the border-bottom of .phase-nav */
}
.phase-btn:hover { color: var(--ink); }
.phase-btn.active { color: var(--ink); border-bottom-color: var(--ink); }

.phase-pip {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: box-shadow 0.2s;
}
.phase-btn[data-phase="before"] .phase-pip { background: var(--phase-before); }
.phase-btn[data-phase="during"] .phase-pip { background: var(--phase-during); }
.phase-btn[data-phase="after"]  .phase-pip { background: var(--phase-after); }
.phase-btn.active .phase-pip {
  box-shadow: 0 0 0 2px var(--bg-soft), 0 0 0 3.5px currentColor;
}
.phase-count {
  font-size: 0.62rem;
  color: inherit;
  opacity: 0.5;
}

/* GALLERY STAGE */
.gallery-stage {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  min-height: 400px;
}
.phase-panel {
  display: none;
  animation: panelIn 0.4s ease both;
}
.phase-panel.visible { display: block; }

@keyframes panelIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Photo layouts */
.layout-single { width: 100%; overflow: hidden; }
.layout-single img { width: 100%; max-height: 640px; object-fit: cover; }

.layout-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.layout-duo img { width: 100%; height: 500px; object-fit: cover; }

.layout-trio { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; }
.layout-trio img:first-child { grid-row: 1 / 3; width: 100%; height: 520px; object-fit: cover; }
.layout-trio img:not(:first-child) { width: 100%; height: 259px; object-fit: cover; }

.layout-quad { display: grid; grid-template-rows: auto auto; gap: 2px; }
.layout-quad-top img { width: 100%; max-height: 420px; object-fit: cover; }
.layout-quad-bot { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2px; }
.layout-quad-bot img { width: 100%; height: 220px; object-fit: cover; }

.layout-masonry { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.layout-masonry img { width: 100%; height: 280px; object-fit: cover; }
.layout-masonry img:first-child { grid-column: 1 / 3; height: 400px; }

/* zoom cursor */
.gallery-stage img { cursor: zoom-in; transition: filter 0.25s; }
.gallery-stage img:hover { filter: brightness(1.07); }

/* PHASE CAPTION */
.phase-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.9rem var(--gutter);
  background: var(--bg-soft);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.phase-caption-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}
.phase-caption-pip { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.phase-caption-text { font-size: 0.8rem; color: var(--ink-muted); max-width: 560px; line-height: 1.6; }

/* LIGHTBOX */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s;
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 1.2rem; right: 1.2rem;
  background: none;
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.1); }
.lightbox-nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  width: 46px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  transition: background 0.2s;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.14); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-caption {
  position: absolute;
  bottom: 3.2rem; left: 50%; transform: translateX(-50%);
  font-size: 0.75rem; color: rgba(255,255,255,0.5);
  letter-spacing: 0.04em; text-align: center;
  max-width: 600px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lightbox-counter {
  position: absolute;
  bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  font-size: 0.62rem; color: rgba(255,255,255,0.35);
  letter-spacing: 2px;
}

/* PORTFOLIO FOOTER */
.port-footer {
  background: #ffffff;
  color: #000000;
  padding: 4rem var(--gutter);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  align-items: end;
}
.port-footer-brand {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: 0.6rem;
}
.port-footer-info { font-size: 0.78rem; line-height: 2; }
.port-footer-info a { color: #000000; }
.port-footer-info a:hover { text-decoration: underline}
.port-footer-tagline {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-style: italic;
  color: rgba(255,255,255,0.2);
  line-height: 1.6;
  text-align: center;
}
.port-footer-copy { text-align: right; font-size: 0.68rem; letter-spacing: 0.04em; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  :root { }

  /* Nav */
  .site-header { padding: 18px var(--gutter); }
  .site-nav a { margin-left: 18px; font-size: 0.76rem; }

  /* Home hero */
  .hero-body h1 { font-size: 2.4rem; }
  .process-steps { flex-direction: column; gap: 2.5rem; }

  /* Portfolio hero */
  .port-hero { grid-template-columns: 1fr; height: auto; }
  .port-hero-mosaic { height: 52vw; min-height: 220px; }
  .port-hero-content { padding: 3rem 1.5rem 4rem; }

  /* Chapter */
  .chapter-header { grid-template-columns: auto 1fr; padding: 2rem 1.2rem 1.5rem; }
  .chapter-num { font-size: 3.5rem; }
  .chapter-stats { display: none; }
  .phase-nav { padding: 0 1.2rem; }
  .phase-caption { padding: 0.8rem 1.2rem; flex-direction: column; align-items: flex-start; gap: 0.5rem; }

  /* Layouts collapse to single column */
  .layout-duo,
  .layout-trio,
  .layout-masonry { grid-template-columns: 1fr; }
  .layout-duo img { height: 260px; }
  .layout-trio img:first-child { height: 260px; grid-row: auto; }
  .layout-trio img:not(:first-child) { height: 200px; }
  .layout-masonry img { height: 240px; }
  .layout-masonry img:first-child { grid-column: auto; height: 240px; }
  .layout-quad-bot { grid-template-columns: 1fr 1fr; }

  /* Portfolio footer */
  .port-footer { grid-template-columns: 1fr; }
  .port-footer-tagline, .port-footer-copy { text-align: left; }
}
