/* Apple x Notion Portfolio — Hybrid Design System */

:root {
  --primary: #5645d4;
  --primary-pressed: #4534b3;
  --primary-on-dark: #7c6be8;
  --link-blue: #0075de;
  --ink: #1a1a1a;
  --charcoal: #37352f;
  --slate: #5d5b54;
  --steel: #787671;
  --stone: #a4a097;
  --muted: #bbb8b1;
  --canvas: #ffffff;
  --surface: #f6f5f4;
  --surface-soft: #fafaf9;
  --hairline: #e5e3df;
  --hairline-soft: #ede9e4;
  --hairline-strong: #c8c4be;

  --tint-peach: #ffe8d4;
  --tint-rose: #fde0ec;
  --tint-mint: #d9f3e1;
  --tint-lavender: #e6e0f5;
  --tint-sky: #dcecfa;
  --tint-yellow: #fef7d6;
  --tint-cream: #f8f5e8;
  --tint-gray: #f0eeec;

  --tag-purple-bg: #e6e0f5;
  --tag-purple-fg: #391c57;
  --tag-orange-bg: #ffe8d4;
  --tag-orange-fg: #793400;
  --tag-green-bg: #d9f3e1;
  --tag-green-fg: #1aae39;
  --tag-blue-bg: #dcecfa;
  --tag-blue-fg: #005bab;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-xxl: 20px;
  --r-full: 9999px;

  --sidebar-w: 220px;
  --section-pad: 96px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--charcoal);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

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

/* ============ Layout ============ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ============ Sidebar ============ */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--canvas);
  border-right: 1px solid var(--hairline);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  margin-bottom: 12px;
}
.sidebar-user:hover { background: var(--surface); }
.sidebar-avatar {
  width: 22px; height: 22px;
  border-radius: var(--r-sm);
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--charcoal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-caret {
  margin-left: auto;
  color: var(--steel);
  font-size: 11px;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 10px 4px;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 1px; margin: 0 0 16px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--charcoal);
  cursor: pointer;
  transition: background 0.12s ease;
}
.nav-item:hover { background: var(--surface); }
.nav-item.active {
  background: var(--hairline-soft);
  font-weight: 500;
}
.nav-icon {
  width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* ============ Main ============ */
.main {
  background: var(--canvas);
  min-width: 0;
}

/* ===== Apple-style Section System ===== */
.section {
  padding: var(--section-pad) 0;
}
.section-light { background: var(--canvas); }
.section-surface { background: var(--surface); }
.section-dark {
  background: #1d1d1f;
  color: var(--on-dark);
}

.section-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ===== Apple Full-bleed Hero ===== */
.hero-wrap {
  position: relative;
  background: linear-gradient(135deg, var(--tint-lavender) 0%, var(--tint-sky) 50%, var(--tint-mint) 100%);
  overflow: hidden;
}
.hero-wrap-peach {
  background: linear-gradient(135deg, var(--tint-peach) 0%, var(--tint-yellow) 50%, var(--tint-cream) 100%);
}
.hero-wrap-rose {
  background: linear-gradient(135deg, var(--tint-rose) 0%, var(--tint-lavender) 50%, var(--tint-sky) 100%);
}
.hero-wrap-mint {
  background: linear-gradient(135deg, var(--tint-mint) 0%, var(--tint-sky) 50%, var(--tint-lavender) 100%);
}

/* Decorative dots (Apple hero flair) */
.hero-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle 3px, rgba(255,255,255,.4) 1px, transparent 1px),
    radial-gradient(circle 2px, rgba(255,255,255,.25) 1px, transparent 1px);
  background-size: 60px 60px, 40px 40px;
  background-position: 0 0, 30px 30px;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1060px;
  margin: 0 auto;
  padding: 80px 40px 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-icon {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 12px;
  user-select: none;
}

.hero-title {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.5px;
  color: var(--charcoal);
  margin-bottom: 8px;
}

.hero-sub {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--slate);
  max-width: 640px;
  margin-bottom: 20px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-bottom: 8px;
}
.hero-meta .meta-row {
  font-size: 14px;
  color: var(--steel);
}
.hero-meta .meta-key {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 6px;
}
.hero-meta .meta-val { color: var(--charcoal); font-weight: 500; }

/* ===== Section titles ===== */
.sec-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.3px;
  color: var(--charcoal);
  margin-bottom: 4px;
}
.sec-lead {
  font-size: 17px;
  color: var(--slate);
  margin-bottom: 32px;
  line-height: 1.5;
}

/* ===== Apple Product Card ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  border-radius: var(--r-lg);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
  cursor: pointer;
}
.card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
  border-color: var(--hairline-strong);
}

.card-media {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  background: var(--tint-gray);
  position: relative;
  overflow: hidden;
}
.card-media.lavender { background: var(--tint-lavender); }
.card-media.peach { background: var(--tint-peach); }
.card-media.rose { background: var(--tint-rose); }
.card-media.mint { background: var(--tint-mint); }
.card-media.sky { background: var(--tint-sky); }
.card-media.yellow { background: var(--tint-yellow); }

.card-body {
  padding: 20px;
}
.card-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--charcoal);
  margin-bottom: 6px;
}
.card-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--slate);
}
.card-tags {
  margin-top: 10px;
}

/* ===== Apple-style Large Feature Card ===== */
.feature-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
  border-radius: var(--r-xl);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  padding: 0;
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}
.feature-card:hover {
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
}

.feature-text {
  padding: 48px 0 48px 48px;
}
.feature-text h3 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.2px;
  margin-bottom: 8px;
}
.feature-text p {
  font-size: 16px;
  color: var(--slate);
  line-height: 1.6;
}
.feature-text .tag-row { margin-top: 12px; }

.feature-media {
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  background: var(--tint-gray);
}
.feature-media.lavender { background: var(--tint-lavender); }
.feature-media.peach { background: var(--tint-peach); }
.feature-media.mint { background: var(--tint-mint); }
.feature-media.rose { background: var(--tint-rose); }
.feature-media.sky { background: var(--tint-sky); }

/* ===== Notion-style Blocks (kept) ===== */
.callout {
  display: flex;
  gap: 12px;
  padding: 16px 18px 16px 14px;
  background: var(--tint-gray);
  border-radius: var(--r-sm);
  margin: 16px 0;
  align-items: flex-start;
}
.callout-icon { font-size: 18px; line-height: 1.5; flex-shrink: 0; }
.callout-body { flex: 1; font-size: 15px; line-height: 1.6; }
.callout-purple { background: var(--tint-lavender); }
.callout-mint { background: var(--tint-mint); }
.callout-yellow { background: var(--tint-yellow); }
.callout-peach { background: var(--tint-peach); }

details.toggle {
  margin: 6px 0;
  padding: 4px 0;
  border-bottom: 1px solid var(--hairline-soft);
}
details.toggle > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  font-weight: 500;
  font-size: 16px;
}
details.toggle > summary::-webkit-details-marker { display: none; }
details.toggle > summary::before {
  content: "▸";
  color: var(--steel);
  font-size: 11px;
  transition: transform 0.15s ease;
  display: inline-block;
}
details.toggle[open] > summary::before { transform: rotate(90deg); }
.toggle-body { padding: 4px 4px 16px 22px; color: var(--slate); font-size: 15px; line-height: 1.6; }
.toggle-body p { margin: 6px 0; }
.toggle-body ul { margin-left: 18px; }

.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-xs);
  margin-right: 4px;
}
.tag-purple { background: var(--tag-purple-bg); color: var(--tag-purple-fg); }
.tag-orange { background: var(--tag-orange-bg); color: var(--tag-orange-fg); }
.tag-green { background: var(--tag-green-bg); color: var(--tag-green-fg); }
.tag-blue { background: var(--tag-blue-bg); color: var(--tag-blue-fg); }

/* ===== Notion Table ===== */
.table-wrap {
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin: 16px 0;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.tbl th {
  text-align: left;
  background: var(--surface-soft);
  color: var(--steel);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
}
.tbl td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline-soft);
  color: var(--charcoal);
}
.tbl tr:last-child td { border-bottom: none; }

/* ===== Buttons (Notion rectangle × Apple pill) ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-pressed); transform: translateY(-1px); }

.btn-secondary {
  background: transparent;
  color: var(--charcoal);
  border: 1px solid var(--hairline-strong);
}
.btn-secondary:hover { background: var(--surface); }

.btn-on-dark {
  background: #fff;
  color: var(--ink);
}
.btn-on-dark:hover { background: rgba(255,255,255,.9); }

.btn-ghost {
  background: transparent;
  color: var(--link-blue);
  border: none;
  padding: 8px 12px;
}
.btn-group { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ===== Dark section overrides ===== */
.section-dark .sec-title { color: #fff; }
.section-dark .sec-lead { color: #a4a097; }
.section-dark .callout { background: rgba(255,255,255,.06); color: #f5f5f7; }
.section-dark .callout .callout-body { color: #e5e5e7; }

/* ===== Link ===== */
.link {
  color: var(--link-blue);
  border-bottom: 1px solid rgba(0,117,222,.3);
}
.link:hover { border-bottom-color: var(--link-blue); }

/* ===== Form ===== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--steel);
  margin-bottom: 6px;
}
.form-input, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 15px;
  color: var(--charcoal);
  background: var(--canvas);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(86,69,212,.12);
}
.form-textarea { min-height: 120px; resize: vertical; }

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--hairline);
  padding: 32px 40px;
}
.footer-inner {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--steel);
}
.footer-links { display: flex; gap: 24px; }
.footer-links a:hover { color: var(--charcoal); }

/* ===== Mobile ===== */
.mobile-toggle {
  display: none;
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    width: 80%;
    max-width: 300px;
    z-index: 100;
    transition: transform 0.2s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,.08);
  }
  .sidebar.open { transform: translateX(0); }

  .hero-content { padding: 60px 24px 32px; }
  .hero-title { font-size: 32px; }
  .hero-sub { font-size: 17px; }
  .hero-icon { font-size: 56px; }

  .section-inner { padding: 0 24px; }
  .sec-title { font-size: 24px; }

  .card-grid { grid-template-columns: 1fr; }
  .feature-card { grid-template-columns: 1fr; gap: 0; }
  .feature-text { padding: 32px; }
  .feature-media { height: 200px; }

  .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; gap: 16px; }

  .mobile-toggle {
    display: flex;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 101;
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
  }
}
