/* ============================================================
   Brian Okum — Portfolio Stylesheet
   
   CSS class mapping from InDesign mockup:
     class1 → .name            (Brian Okum heading)
     class2 → .title           (Technical Writer subtitle)
     class3 → .section-heading (Section titles like VISUAL COMMUNICATION)
     class4 → .section-body-text, .footer-text  (Body text, Aptos font)
   ============================================================ */

/* ---------- RESET & BASE ---------- */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Aptos', 'Calibri', 'Segoe UI', sans-serif;
  color: #ffffe6;
  background-color: #0e1b2e;
  line-height: 1.6;
}

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

a {
  color: inherit;
  text-decoration: none;
}


/* ---------- STICKY HEADER ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #0e1b2e;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 24px 48px 16px;
}

.header-left {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

.header-left:hover {
  opacity: 0.78;
}

.header-left:focus-visible {
  outline: 1.5px solid #ffffe6;
  outline-offset: 4px;
}

/* class1 — Name */
.name {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* class2 — Subtitle */
.title {
  font-size: 1.05rem;
  font-weight: 400;
  margin-top: 2px;
  color: #a8b8c8;
}

/* Navigation */
.header-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-link {
  font-size: 1rem;
  font-weight: 400;
  padding: 4px 12px;
  transition: border-color 0.2s ease;
  border: 1.5px solid transparent;
}

.nav-link:hover {
  border-color: #6a8aa8;
}

/* Active page indicator — outlined box */
.nav-link.active {
  border: 1.5px solid #ffffe6;
}

/* Horizontal rule under header */
.header-rule {
  position: sticky;
  top: 88px; /* adjust based on header height */
  z-index: 99;
  height: 3px;
  background-color: #ffffe6;
  margin: 0 48px;
}


/* ---------- PORTFOLIO SECTIONS ---------- */

.portfolio-content {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 48px 80px;
}

.portfolio-section {
  padding: 64px 0;
}

.portfolio-section + .portfolio-section {
  border-top: none;
}

/* class3 — Section headings */
.section-heading {
  font-size: clamp(1.8rem, 1.35rem + 1.35vw, 2.7rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  word-spacing: 0.1em;
  margin-bottom: 32px;
  text-align: center;
}

/* Section body: two-column layout */
.section-body {
  display: flex;
  gap: 80px;
  align-items: center;
}

.section-body.layout-img-left {
  flex-direction: row;
}

.section-body.layout-img-right {
  flex-direction: row-reverse;
}

/* Media column (carousel or static image) — narrower than before to leave more breathing room */
.section-media {
  flex: 0 0 50%;
  max-width: 50%;
}

/* Text column */
.section-text {
  flex: 1;
  min-width: 0;
}

/* class4 — Body text */
.section-body-text {
  font-size: clamp(1.2rem, 1.05rem + 0.4vw, 1.5rem);
  font-weight: 300;
  line-height: 1.4;
  color: #ffffff;
}

/* Vertical gap between stacked paragraphs within a section */
.section-body-text + .section-body-text {
  margin-top: 0.5em;
}


/* ---------- IMAGE CAROUSEL ---------- */

.carousel {
  position: relative;
  width: 100%;
  background-color: #0e1b2e;
}

/* The aspect-ratio box now lives on the track, so the dots can sit below
   the image in normal flow rather than overlaying it. */
.carousel-track {
  position: relative;
  width: 100%;
  aspect-ratio: 6 / 5;
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-slide.active {
  opacity: 1;
}

.carousel-slide a {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.carousel-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Pagination dots — flow below the carousel image */
.carousel-dots {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.carousel-dot {
  /* Hit area — invisible, generous click target */
  width: 34px;
  height: 34px;
  border-radius: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  outline: none;
}

/* Visible dot — drawn as a pseudo-element */
.carousel-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 230, 0.3);
  transition: background-color 0.2s ease;
}

.carousel-dot:hover::after {
  background-color: rgba(255, 255, 230, 0.5);
}

.carousel-dot.active::after {
  background-color: rgba(255, 255, 230, 0.8);
}


/* ---------- STATIC IMAGE ---------- */

.static-image {
  width: 100%;
  aspect-ratio: 6 / 5;
  background-color: #0e1b2e;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.static-image a {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.static-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}


/* ---------- CONTACT PAGE ---------- */

.contact-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 48px 80px;
}

.contact-intro {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #d4d8c4;
  margin-bottom: 40px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row-half {
  display: flex;
  gap: 20px;
}

.form-row-half .form-group {
  flex: 1;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: #a8b8c8;
}

.required {
  color: #c00;
}

.optional {
  color: #8a9bb0;
  font-weight: 400;
  font-size: 0.9em;
}

.form-group input,
.form-group textarea {
  font-family: 'Inter', 'Aptos', 'Calibri', 'Segoe UI', sans-serif;
  font-size: 0.95rem;
  padding: 10px 12px;
  border: 1px solid #2e4f6e;
  border-radius: 2px;
  background-color: #1a3050;
  color: #ffffe6;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #a8c0d4;
}

.form-group textarea {
  resize: vertical;
}

.form-submit {
  font-family: 'Inter', 'Aptos', 'Calibri', 'Segoe UI', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 12px 32px;
  background-color: #ffffe6;
  color: #0e1b2e;
  border: none;
  cursor: pointer;
  align-self: flex-start;
  transition: background-color 0.2s ease;
}

.form-submit:hover {
  background-color: #d4d8c4;
}


/* ---------- ABOUT PAGE ---------- */

.about-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 64px 48px 80px;
}

.about-placeholder {
  font-size: 1rem;
  color: #6a8aa8;
  font-style: italic;
}


/* ---------- FOOTER ---------- */

.site-footer {
  text-align: center;
  padding: 40px 48px;
}

/* class4 — Footer text */
.footer-text {
  font-size: 0.85rem;
  color: #5a7a94;
}


/* ---------- HOME / CAD LANDING ---------- */

.home-content {
  /* CAD-landing local variables. The CAD stage now uses transparent PNGs so
     the dark site background shows through. Ink is cream to match body text. */
  --cad-bg: transparent;
  --cad-ink: #ffffe6;
  --cad-ink-dim: #a8b8c8;
  --cad-accent: #d96526;
  --cad-fade-fast: 150ms ease;
  --cad-fade-med:  200ms ease;

  max-width: 1920px;
  margin: 0 auto;
  padding: 32px 48px 80px;
}

.home-intro {
  font-size: clamp(1rem, 0.9rem + 0.35vw, 1.2rem);
  font-weight: 300;
  line-height: 1.55;
  color: #d4d8c4;
  text-align: center;
  max-width: 720px;
  margin: 0 auto 28px;
}

/* ---- CAD stage (the layered-PNG canvas with SVG callouts on top) ---- */
.cad-stage {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  /* Visible canvas is 5076 × 1500 (SVG viewBox). PNG source is 5076 × 1928 and
     gets visually cropped on the bottom via object-fit:cover below. */
  aspect-ratio: 5076 / 1500;
  background-color: var(--cad-bg);
}

.cad-stage img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* COVER fills container; the natural PNG height (1928) exceeds the container
     height (1500 at same width), so the bottom of the image is cropped.
     object-position: top keeps the top aligned with the SVG viewBox. */
  object-fit: cover;
  object-position: top;
  user-select: none; pointer-events: none;
  opacity: 0;
  transition: opacity var(--cad-fade-fast);
}
.cad-stage img.layer-default { opacity: 1; }

.cad-stage[data-state="about"]        img.layer-about,
.cad-stage[data-state="portfolio"]    img.layer-portfolio,
.cad-stage[data-state="contact"]      img.layer-contact,
.cad-stage[data-state="visualcomms"]  img.layer-visualcomms,
.cad-stage[data-state="userenable"]   img.layer-userenable,
.cad-stage[data-state="qualcomp"]     img.layer-qualcomp,
.cad-stage[data-state="singsource"]   img.layer-singsource,
.cad-stage[data-state="procdev"]      img.layer-procdev { opacity: 1; }
.cad-stage:not([data-state="default"]) img.layer-default { opacity: 0; }

/* ---- SVG callout overlay ---- */
.cad-overlay {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  overflow: visible;
}

.hotzone { fill: rgba(0,0,0,0); cursor: pointer; }

.callout text {
  font-family: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
  fill: var(--cad-ink);
  transition: fill var(--cad-fade-fast), opacity var(--cad-fade-med);
  pointer-events: auto;
}
.callout .label-num  { font-size: 40px; font-weight: 600; letter-spacing: 0.06em; }
.callout .label-name { font-size: 48px; letter-spacing: 0.04em; }
.callout .label-desc { font-size: 30px; fill: var(--cad-ink-dim); letter-spacing: 0.02em; }
.callout .leader {
  stroke: var(--cad-ink); stroke-width: 3; fill: none;
  transition: stroke var(--cad-fade-fast), opacity var(--cad-fade-med);
  pointer-events: none;
}
.callout .leader-hit {
  stroke: rgba(0,0,0,0); stroke-width: 12; fill: none;
  pointer-events: stroke;
}
.callout .dot {
  fill: var(--cad-ink);
  transition: fill var(--cad-fade-fast);
  pointer-events: auto;
}

.main-callout { transition: opacity var(--cad-fade-med); }
.sub-callout  { opacity: 0; pointer-events: none; transition: opacity var(--cad-fade-med); }

.cad-stage[data-group="portfolio"] .sub-callout { opacity: 1; pointer-events: auto; }
.cad-stage[data-group="portfolio"] .main-callout:not(.callout-portfolio) { opacity: 0.30; }
.cad-stage[data-state="about"]   .main-callout:not(.callout-about)   { opacity: 0.30; }
.cad-stage[data-state="contact"] .main-callout:not(.callout-contact) { opacity: 0.30; }

.cad-stage[data-state="about"]        .callout-about        text,
.cad-stage[data-state="contact"]      .callout-contact      text,
.cad-stage[data-state="portfolio"]    .callout-portfolio    text,
.cad-stage[data-state="visualcomms"]  .callout-visualcomms  text,
.cad-stage[data-state="userenable"]   .callout-userenable   text,
.cad-stage[data-state="qualcomp"]     .callout-qualcomp     text,
.cad-stage[data-state="singsource"]   .callout-singsource   text,
.cad-stage[data-state="procdev"]      .callout-procdev      text { fill: var(--cad-accent); }

.cad-stage[data-state="about"]        .callout-about        .leader,
.cad-stage[data-state="contact"]      .callout-contact      .leader,
.cad-stage[data-state="portfolio"]    .callout-portfolio    .leader,
.cad-stage[data-state="visualcomms"]  .callout-visualcomms  .leader,
.cad-stage[data-state="userenable"]   .callout-userenable   .leader,
.cad-stage[data-state="qualcomp"]     .callout-qualcomp     .leader,
.cad-stage[data-state="singsource"]   .callout-singsource   .leader,
.cad-stage[data-state="procdev"]      .callout-procdev      .leader { stroke: var(--cad-accent); }

.cad-stage[data-state="about"]        .callout-about        .dot,
.cad-stage[data-state="contact"]      .callout-contact      .dot,
.cad-stage[data-state="portfolio"]    .callout-portfolio    .dot,
.cad-stage[data-state="visualcomms"]  .callout-visualcomms  .dot,
.cad-stage[data-state="userenable"]   .callout-userenable   .dot,
.cad-stage[data-state="qualcomp"]     .callout-qualcomp     .dot,
.cad-stage[data-state="singsource"]   .callout-singsource   .dot,
.cad-stage[data-state="procdev"]      .callout-procdev      .dot { fill: var(--cad-accent); }


/* ---------- HOME MOBILE NAV (fallback for landing on small screens) ---------- */

/* Hidden on desktop — CAD stage handles navigation there. */
.home-mobile-nav { display: none; }


/* ---------- RESPONSIVE ---------- */

@media (max-width: 768px) {

  /* --- Header --- */
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 20px 10px;
    gap: 8px;
  }

  .name {
    font-size: 1.7rem;
  }

  .title {
    font-size: 0.95rem;
  }

  .header-nav {
    gap: 4px;
    width: 100%;
    justify-content: flex-start;
  }

  /* Bigger tap targets, no border boxes squeezed against the screen edge */
  .nav-link {
    font-size: 0.95rem;
    padding: 8px 10px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }

  .header-rule {
    margin: 0 20px;
    top: 96px;
  }

  /* --- Portfolio page --- */
  .portfolio-content {
    padding: 0 20px 48px;
  }

  .portfolio-section {
    padding: 32px 0;
  }

  .section-heading {
    margin-bottom: 20px;
    text-align: left;
  }

  .section-body {
    flex-direction: column !important;
    gap: 20px;
  }

  .section-media {
    flex: none;
    max-width: 100%;
    width: 100%;
  }

  .section-body-text {
    font-size: 1.05rem;
    line-height: 1.5;
  }

  /* Slightly squarer carousel/static aspect on phones — keeps wide spreads legible */
  .carousel-track,
  .static-image {
    aspect-ratio: 4 / 3;
  }

  /* --- Contact page --- */
  .form-row-half {
    flex-direction: column;
    gap: 16px;
  }

  .contact-content {
    padding: 28px 20px 48px;
  }

  .contact-intro {
    font-size: 1rem;
  }

  .form-group input,
  .form-group textarea {
    font-size: 1rem;          /* >=16px prevents iOS auto-zoom on focus */
    padding: 12px 12px;
  }

  .form-submit {
    width: 100%;
    padding: 14px 24px;
    align-self: stretch;
    font-size: 1rem;
  }

  /* --- About page --- */
  .about-content {
    padding: 32px 20px 48px;
  }

  /* --- Landing page (CAD) — mobile fallback --- */
  .home-content {
    padding: 24px 20px 48px;
  }

  .home-intro,
  .cad-stage {
    display: none;             /* CAD stage is desktop-only by design */
  }

  .home-mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 420px;
    margin: 24px auto 0;
  }

  .home-mobile-link {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 14px;
    align-items: baseline;
    padding: 16px 18px;
    border: 1px solid #2e4f6e;
    background-color: #142544;
    transition: border-color 0.2s ease, background-color 0.2s ease;
  }

  .home-mobile-link:hover,
  .home-mobile-link:focus {
    border-color: #ffffe6;
    background-color: #18305a;
    outline: none;
  }

  .home-mobile-num {
    grid-row: 1 / 3;
    align-self: center;
    font-family: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
    font-size: 1.5rem;
    font-weight: 600;
    color: #d96526;
    letter-spacing: 0.04em;
  }

  .home-mobile-label {
    grid-column: 2;
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #ffffe6;
  }

  .home-mobile-desc {
    grid-column: 2;
    font-size: 0.85rem;
    color: #a8b8c8;
    letter-spacing: 0.02em;
  }
}
