:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #626866;
  --line: #d9ded9;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --soft: #eef4f1;
  --sage: #607d6f;
  --blue: #456f8c;
  --gold: #b88a3b;
  --coral: #b86b59;
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(30, 39, 34, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.55;
}

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

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

button,
input,
select,
textarea {
  font: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 14px clamp(20px, 4vw, 56px);
  background: rgba(251, 250, 246, 0.92);
  border-bottom: 1px solid rgba(217, 222, 217, 0.8);
  backdrop-filter: blur(18px);
}

.brand {
  font-size: 1.05rem;
  font-weight: 850;
}

.nav {
  display: flex;
  gap: clamp(14px, 2vw, 28px);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.nav a:hover {
  color: var(--ink);
}

.hero {
  position: relative;
  min-height: 620px;
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(20, 25, 22, 0.78), rgba(20, 25, 22, 0.34) 48%, rgba(20, 25, 22, 0.06)),
    linear-gradient(0deg, rgba(20, 25, 22, 0.54), rgba(20, 25, 22, 0) 52%);
}

.hero-content {
  position: relative;
  width: min(850px, 100%);
  padding: 0 clamp(20px, 5vw, 72px) clamp(56px, 10vh, 104px);
  color: var(--white);
}

.eyebrow,
.tag {
  margin: 0 0 10px;
  color: var(--sage);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f0d28e;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 22px;
  font-size: clamp(2.65rem, 7vw, 5.75rem);
  line-height: 0.99;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.7rem, 3vw, 2.8rem);
  line-height: 1.06;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.08rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.hero-content p:last-child {
  max-width: 620px;
  margin-bottom: 0;
  font-size: clamp(1.02rem, 2vw, 1.26rem);
}

 .inline-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(42px, 7vw, 86px) 0;
}

.inline-editor-toolbar {
  position: sticky;
  top: 64px;
  z-index: 18;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(251, 250, 246, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.inline-editor-toolbar h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2.5vw, 2.2rem);
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.inline-actions button,
.inline-actions select {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 0 12px;
  font-weight: 850;
  cursor: pointer;
}

.inline-actions button:hover,
.inline-actions select:hover {
  border-color: var(--blue);
  background: var(--soft);
}

#save-page-button {
  background: var(--ink);
  color: var(--white);
}

.section-inline-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
  display: none;
  grid-template-columns: repeat(5, auto);
  gap: 6px;
  padding: 6px;
  background: rgba(251, 250, 246, 0.94);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(30, 39, 34, 0.12);
}

.section-inline-controls button {
  min-height: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 0 8px;
  font-size: 0.76rem;
  font-weight: 850;
  cursor: pointer;
}

.section-inline-controls button:hover {
  border-color: var(--blue);
  background: var(--soft);
}

.is-editing .section-inline-controls {
  display: grid;
}

.is-editing .preview-section,
.is-editing .student-cover {
  outline: 1px dashed rgba(69, 111, 140, 0.42);
  outline-offset: -6px;
}

.is-editing [contenteditable="true"] {
  border-radius: 3px;
  box-shadow: inset 0 -2px 0 rgba(69, 111, 140, 0.35);
  cursor: text;
}

.is-editing [contenteditable="true"]:focus {
  outline: 2px solid rgba(69, 111, 140, 0.45);
  outline-offset: 2px;
  background: rgba(255, 255, 255, 0.42);
}

.custom-section {
  background: var(--panel);
}

.custom-section-quote {
  background: var(--ink);
  color: var(--white);
}

.custom-section-quote .tag {
  color: #f0d28e;
}

.custom-section-quote blockquote,
.custom-section-quote p {
  color: var(--white);
}

.dropzone {
  display: grid;
  gap: 6px;
  min-height: 132px;
  align-content: center;
  padding: 18px;
  border: 2px dashed #bfc8c1;
  background: #fffdf8;
  color: var(--muted);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

.dropzone strong {
  color: var(--ink);
  font-size: 1rem;
}

.dropzone span {
  font-size: 0.88rem;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-dragging {
  border-color: var(--blue);
  background: var(--soft);
  color: var(--ink);
  outline: none;
}

.upload-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.upload-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.upload-actions button:hover {
  border-color: var(--blue);
  background: var(--soft);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}


.portfolio-page {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.student-cover {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
  padding: clamp(28px, 5vw, 56px);
  background:
    linear-gradient(135deg, rgba(238, 244, 241, 0.96), rgba(255, 253, 248, 0.96)),
    url("assets/portfolio-hero.png");
  background-size: cover;
  background-position: center;
}

.student-cover h2 {
  max-width: 720px;
  margin-bottom: 6px;
  font-size: clamp(2rem, 4vw, 4rem);
}

#preview-level {
  color: var(--blue);
  font-weight: 850;
}

#preview-line {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.portrait-slot {
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fffdf8;
  border: 1px solid var(--line);
}

.portrait-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-slot span {
  color: var(--muted);
  font-weight: 850;
}

.preview-section {
  position: relative;
  padding: clamp(24px, 4vw, 42px) clamp(28px, 5vw, 56px);
  border-top: 1px solid var(--line);
}

.preview-section p {
  color: var(--muted);
}

.section-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-title-row h3,
.section-title-row p {
  margin-bottom: 0;
}

.section-title-row p {
  color: var(--blue);
  font-size: 0.92rem;
  font-weight: 850;
}

.highlight-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.highlight-pill {
  padding: 8px 12px;
  background: var(--soft);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 780;
}

.growth-timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.growth-timeline article {
  min-height: 150px;
  padding: 20px;
  background: var(--panel);
}

.growth-timeline time {
  display: block;
  margin-bottom: 30px;
  color: var(--coral);
  font-size: 0.86rem;
  font-weight: 900;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.skills-grid article,
.certificate-summary article {
  display: grid;
  gap: 6px;
  min-height: 110px;
  align-content: start;
  padding: 18px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.skills-grid span,
.certificate-summary span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 760;
}

.skills-grid strong,
.certificate-summary strong {
  color: var(--ink);
  line-height: 1.25;
}

.featured-story {
  display: grid;
  gap: 20px;
  background: #fffaf0;
}

.story-points,
.process-grid,
.certificate-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.certificate-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.story-points article,
.process-grid article {
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.story-points span,
.process-grid span {
  display: block;
  margin-bottom: 14px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.media-item,
.media-placeholder {
  min-height: 160px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #f6f0df;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 780;
  text-align: center;
}

.media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-item.pdf-item {
  padding: 18px;
  background: var(--soft);
}

.process-section {
  background: #f8f7f0;
}

.notes-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  padding: 0;
  background: var(--line);
}

.notes-section article {
  padding: clamp(24px, 4vw, 42px) clamp(28px, 5vw, 56px);
  background: var(--panel);
}

blockquote {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  line-height: 1.45;
}

.child-voice {
  background: var(--ink);
  color: var(--white);
}

.child-voice .tag {
  color: #f0d28e;
}

.child-voice blockquote {
  max-width: 760px;
  color: var(--white);
  font-size: clamp(1.45rem, 3vw, 2.4rem);
  line-height: 1.15;
}

.reading-section,
.contribution-section {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(280px, 1.18fr);
  gap: clamp(20px, 4vw, 54px);
  align-items: start;
}

.contribution-section ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.readiness-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.readiness-item {
  min-height: 58px;
  display: flex;
  align-items: center;
  padding: 12px 14px;
  background: #fff7f2;
  border: 1px solid #efd6cc;
  color: var(--coral);
  font-size: 0.9rem;
  font-weight: 850;
}

.readiness-item.is-ready {
  background: var(--soft);
  border-color: #c9d8ce;
  color: var(--sage);
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding: 0;
  border-top: 1px solid var(--line);
}

.story-grid article {
  min-height: 180px;
  padding: 26px;
  background: var(--panel);
}

.story-grid span {
  display: block;
  margin-bottom: 36px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.ideas-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: clamp(24px, 5vw, 80px);
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(50px, 8vw, 96px) 0;
  border-top: 1px solid var(--line);
}

.idea-card {
  padding: clamp(24px, 4vw, 38px);
  background: var(--ink);
  color: var(--white);
}

.idea-card .tag {
  color: #f0d28e;
}

.idea-card p:last-child {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.78);
}

.site-footer {
  padding: 26px clamp(20px, 4vw, 56px);
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

@media print {
  .app-header,
  .hero,
  .inline-editor-toolbar,
  .ideas-section,
  .site-footer {
    display: none;
  }

  body {
    background: #fff;
  }

  .inline-shell {
    display: block;
    width: 100%;
    padding: 0;
  }

  .portfolio-page {
    border: 0;
    box-shadow: none;
  }
}

@media (max-width: 980px) {
  .app-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    min-height: 640px;
  }

  .ideas-section {
    grid-template-columns: 1fr;
  }

  .inline-editor-toolbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .inline-actions {
    justify-content: stretch;
  }

  .inline-actions button,
  .inline-actions select {
    flex: 1 1 150px;
  }

  .student-cover,
  .field-row {
    grid-template-columns: 1fr;
  }

  .portrait-slot {
    width: min(220px, 100%);
  }

  .media-grid,
  .story-grid,
  .growth-timeline,
  .skills-grid,
  .story-points,
  .process-grid,
  .certificate-summary,
  .notes-section,
  .reading-section,
  .contribution-section,
  .readiness-list {
    grid-template-columns: 1fr;
  }

  .section-inline-controls {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 10px;
  }
}
