/* ============================================================
   Apple Books PM Portfolio - Shared Styles
   ============================================================ */

:root {
  --white:          #FFFFFF;
  --surface:        #F5F5F7;
  --apple-blue:     #0071E3;
  --apple-orange:   #FF6B35;
  --text-primary:   #1D1D1F;
  --text-secondary: #6E6E73;
  --border:         #E5E5EA;
  --badge-wip:      #FF9500;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  background: #FFFFFF;
  color: #1D1D1F;
  min-height: 100vh;
}

/* ============================================================
   SPLIT-SCREEN GATE
   ============================================================ */

#gate {
  position: fixed;
  inset: 0;
  background: #FFFFFF;
  z-index: 1000;
  /* display controlled by JS */
}

.gate-split {
  display: flex;
  height: 100vh;
  width: 100%;
}

/* Left panel - 50% */
.gate-left {
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 64px 72px;
  background: #FFFFFF;
}

.gate-left-inner {
  max-width: 460px;
  width: 100%;
}

.gate-name {
  font-family: -apple-system, "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: clamp(52px, 8vw, 96px);
  font-weight: 800;
  color: #1D1D1F;
  letter-spacing: -0.03em;
  line-height: 1.0;
  margin-bottom: 16px;
}

.gate-subtitle {
  font-size: 16px;
  color: #6E6E73;
  font-weight: 400;
  margin-bottom: 20px;
}

.gate-tagline {
  font-size: 18px;
  font-weight: 400;
  color: #1D1D1F;
  line-height: 1.55;
  margin-bottom: 36px;
  max-width: 400px;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gate-input {
  width: 100%;
  height: 52px;
  padding: 0 18px;
  border: 1px solid #D2D2D7;
  border-radius: 14px;
  font-size: 16px;
  font-family: inherit;
  color: #1D1D1F;
  background: #FFFFFF;
  outline: none;
  transition: border-color 0.2s ease;
}

.gate-input:focus {
  border-color: #1D1D1F;
}

.gate-btn {
  width: 100%;
  height: 52px;
  background: #FF6B35;
  color: #FFFFFF;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.gate-btn:hover {
  opacity: 0.88;
}

.gate-error {
  font-size: 13px;
  color: #FF3B30;
  min-height: 16px;
}

.gate-legal {
  font-size: 12px;
  color: #8E8E93;
  margin-top: 16px;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-6px); }
  80%       { transform: translateX(6px); }
}

.gate-input.shake {
  animation: shake 0.4s ease;
  border-color: #FF3B30;
}

/* Right panel - 50%, single hero image */
.gate-right {
  width: 50%;
  background: #F5F5F7;
  overflow: hidden;
  display: flex;
}

.gate-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Mobile: stack, hide image */
@media (max-width: 768px) {
  .gate-split {
    flex-direction: column;
  }
  .gate-left {
    width: 100%;
    padding: 48px 28px 40px;
  }
  .gate-right {
    display: none;
  }
}

/* ============================================================
   PORTFOLIO WRAPPER
   ============================================================ */

#portfolio {
  /* no padding - grid goes edge to edge */
}

/* ============================================================
   PORTFOLIO TOP NAV
   ============================================================ */

.portfolio-nav {
  width: 100%;
  height: 56px;
  background: #FFFFFF;
  border-bottom: 1px solid #E5E5EA;
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo-img {
  height: 28px;
  width: auto;
  display: block;
}

.nav-brand {
  font-family: -apple-system, "SF Pro Display", "Helvetica Neue", sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #1D1D1F;
  letter-spacing: -0.02em;
}

/* ============================================================
   TILE GRID - full width, square tiles, no gap
   ============================================================ */

.grid-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 48px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: #E5E5EA; /* acts as the 1px border between tiles */
  width: 100%;
}

/* Each tile has a 1px right + bottom border via gap background trick.
   Add top/left border on the entire grid container. */
.grid {
  border-top: 1px solid #E5E5EA;
  border-left: 1px solid #E5E5EA;
}

.tile {
  position: relative;
  aspect-ratio: 1;
  padding: 32px;
  background: #FFFFFF;
  border-right: 1px solid #E5E5EA;
  border-bottom: 1px solid #E5E5EA;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: background 0.15s ease;
  /* no border-radius, no box-shadow */
}

.tile:hover {
  background: #F5F5F7;
}

.tile-num {
  font-size: 13px;
  color: #6E6E73;
  font-weight: 400;
  font-family: -apple-system, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  line-height: 1;
  flex-shrink: 0;
}

/* Name wrapper fills remaining height and centers vertically */
.tile-name-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  padding-right: 16px; /* avoid overlap with arrow */
}

.tile-name {
  font-size: 22px;
  font-weight: 700;
  color: #1D1D1F;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* Orange arrow - absolute bottom right */
.tile-arrow {
  position: absolute;
  bottom: 24px;
  right: 24px;
  color: #FF6B35;
  font-size: 20px;
  line-height: 1;
}

/* WIP badge - absolute top right */
.badge-wip {
  position: absolute;
  top: 28px;
  right: 28px;
  background: #FFF3E8;
  color: #FF6B35;
  font-size: 11px;
  font-weight: 500;
  border-radius: 4px;
  padding: 2px 8px;
  line-height: 1.5;
}

/* Responsive columns */
@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tile-name {
    font-size: 17px;
  }
}

/* ============================================================
   ASSIGNMENT PAGE - STICKY NAV
   ============================================================ */

.assignment-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid #E5E5EA;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #0071E3;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.nav-back:hover { opacity: 0.7; }

.nav-title {
  font-size: 15px;
  font-weight: 600;
  color: #1D1D1F;
  text-align: center;
  letter-spacing: -0.2px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-num {
  font-size: 13px;
  color: #6E6E73;
  font-family: "SF Mono", ui-monospace, monospace;
  white-space: nowrap;
}

/* ============================================================
   ASSIGNMENT PAGE - LAYOUT
   ============================================================ */

.assignment-body {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.assignment-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid #E5E5EA;
}

.assignment-header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: #1D1D1F;
  margin-bottom: 10px;
  line-height: 1.2;
}

.assignment-header .desc {
  font-size: 17px;
  color: #6E6E73;
  margin-bottom: 18px;
  line-height: 1.5;
}

.assignment-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.meta-item {
  font-size: 13px;
  color: #6E6E73;
}

.meta-divider {
  width: 1px;
  height: 14px;
  background: #E5E5EA;
}

/* ============================================================
   ASSIGNMENT CONTENT
   ============================================================ */

.content h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1D1D1F;
  letter-spacing: -0.3px;
  margin: 36px 0 14px;
}

.content h3 {
  font-size: 17px;
  font-weight: 600;
  color: #1D1D1F;
  margin: 24px 0 10px;
}

.content p {
  font-size: 16px;
  line-height: 1.7;
  color: #1D1D1F;
  margin-bottom: 16px;
}

.content ul, .content ol {
  padding-left: 22px;
  margin-bottom: 16px;
}

.content li {
  font-size: 16px;
  line-height: 1.7;
  color: #1D1D1F;
  margin-bottom: 6px;
}

.section-divider {
  height: 1px;
  background: #E5E5EA;
  margin: 36px 0;
}

.img-note {
  font-size: 13px;
  color: #6E6E73;
  margin-top: 10px;
  font-style: italic;
}

/* ============================================================
   STORY CARDS (JTBD)
   ============================================================ */

.story-card {
  background: #FFFFFF;
  border: 1px solid #E5E5EA;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.story-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.story-feature-label {
  font-size: 12px;
  font-weight: 600;
  color: #1D1D1F;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.story-text {
  font-size: 16px;
  line-height: 1.7;
  color: #1D1D1F;
}

/* ============================================================
   LETTER CARD
   ============================================================ */

.letter-card {
  background: #FFFFFF;
  border: 1px solid #E5E5EA;
  border-radius: 12px;
  padding: 40px;
  max-width: 680px;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.letter-placeholder {
  font-size: 15px;
  color: #6E6E73;
  line-height: 1.7;
  text-align: center;
  padding: 24px 0;
}

/* ============================================================
   TABLES
   ============================================================ */

.table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 10px;
  border: 1px solid #E5E5EA;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table thead tr {
  background: #0071E3;
  color: #FFFFFF;
}

table thead th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
}

table tbody tr:nth-child(even) {
  background: rgba(0,0,0,0.02);
}

table tbody tr:hover {
  background: rgba(0,113,227,0.04);
}

table tbody td {
  padding: 12px 16px;
  border-top: 1px solid #E5E5EA;
  vertical-align: top;
  line-height: 1.5;
  color: #1D1D1F;
}

table tbody td:first-child {
  font-weight: 600;
}

/* ============================================================
   NORTH STAR CARD
   ============================================================ */

.north-star-card {
  background: #F5F5F7;
  border-left: 4px solid #0071E3;
  border-radius: 12px;
  padding: 32px 36px;
  margin: 28px 0 36px;
}

.ns-label {
  font-size: 11px;
  font-weight: 700;
  color: #0071E3;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}

.ns-metric {
  font-size: 28px;
  font-weight: 700;
  color: #1D1D1F;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  line-height: 1.15;
}

.ns-definition {
  font-size: 15px;
  color: #6E6E73;
  line-height: 1.6;
  margin-bottom: 10px;
}

.ns-why {
  font-size: 14px;
  color: #6E6E73;
  line-height: 1.6;
  font-style: italic;
}

/* ============================================================
   METRIC GRID
   ============================================================ */

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 28px 0;
}

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

.metric-card {
  background: #FFFFFF;
  border: 1px solid #E5E5EA;
  border-radius: 12px;
  padding: 22px;
}

.metric-icon {
  font-size: 26px;
  margin-bottom: 10px;
  display: block;
}

.metric-category {
  font-size: 11px;
  font-weight: 700;
  color: #0071E3;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 6px;
}

.metric-name {
  font-size: 17px;
  font-weight: 600;
  color: #1D1D1F;
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.metric-desc {
  font-size: 13px;
  color: #6E6E73;
  line-height: 1.55;
}

/* ============================================================
   CALLOUT
   ============================================================ */

.callout-amber {
  background: rgba(255,149,0,0.07);
  border-left: 4px solid #FF9500;
  border-radius: 10px;
  padding: 22px 24px;
  margin: 28px 0;
}

.callout-amber h3 {
  font-size: 15px;
  font-weight: 700;
  color: #B86000;
  margin: 0 0 8px;
}

.callout-amber p {
  font-size: 14px;
  color: #1D1D1F;
  line-height: 1.6;
  margin: 0;
}

/* ============================================================
   PLACEHOLDER CARD
   ============================================================ */

.placeholder-card {
  background: #F5F5F7;
  border: 2px dashed #E5E5EA;
  border-radius: 12px;
  padding: 48px 32px;
  text-align: center;
  margin: 24px 0;
}

.placeholder-card p {
  font-size: 16px;
  color: #6E6E73;
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto;
}

/* ============================================================
   SCREEN GRID (PROTOTYPE)
   ============================================================ */

.screen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 24px 0;
}

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

.screen-card {
  background: #FFFFFF;
  border: 1px solid #E5E5EA;
  border-radius: 12px;
  padding: 18px 20px;
}

.screen-card h4 {
  font-size: 15px;
  font-weight: 600;
  color: #1D1D1F;
  margin-bottom: 6px;
}

.screen-card p {
  font-size: 13px;
  color: #6E6E73;
  line-height: 1.5;
  margin: 0;
}

.tool-note {
  font-size: 13px;
  color: #6E6E73;
  margin-top: 16px;
  padding: 12px 16px;
  background: #F5F5F7;
  border-radius: 8px;
  border: 1px solid #E5E5EA;
}

/* ============================================================
   LEGEND BOX
   ============================================================ */

.legend-box {
  background: #FFFFFF;
  border: 1px solid #E5E5EA;
  border-radius: 10px;
  padding: 18px 22px;
  margin: 24px 0;
  font-size: 14px;
  color: #6E6E73;
  line-height: 1.7;
}

/* ============================================================
   SECTION BLOCK
   ============================================================ */

.section-block {
  margin-top: 48px;
  padding-top: 36px;
  border-top: 2px solid #E5E5EA;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  text-align: center;
  font-size: 13px;
  color: #6E6E73;
  padding: 32px 0 0;
  border-top: 1px solid #E5E5EA;
  margin-top: 60px;
}

/* ============================================================
   RESPONSIVE - ASSIGNMENT PAGES
   ============================================================ */

@media (max-width: 600px) {
  .assignment-body {
    padding: 32px 16px 60px;
  }
  .assignment-header h1 {
    font-size: 24px;
  }
}
