/* Include padding and borders within an element's width */
* {
  box-sizing: border-box;
}

/* The whole page */
body {
  margin: 0;
  background: #fff6f7;
  color: #322936;
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

/* The main content area */
main {
  width: min(800px, calc(100% - 32px));
  margin: 48px auto;
  padding: clamp(24px, 5vw, 48px);
  background: #fffdfe;
  border: 1px solid #e1d0db;
  border-radius: 16px;
}

/* Your handwritten greeting */
h1 {
  margin: 0 0 24px;
  font-family: "Caveat", cursive;
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 600;
  line-height: 1.15;
}

/* Space between paragraphs */
p {
  margin: 0 0 18px;
}

/* Your GitHub link, styled as a button */
main > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 12px;
  padding: 12px 20px;
  background: #7c3e65;
  color: #ffffff;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}

/* Feedback when someone hovers over the link */
main > a:hover {
  background: #63304f;
}

/* A visible outline for keyboard navigation */
a:focus-visible {
  outline: 3px solid #7c3e65;
  outline-offset: 4px;
}
/* Navigation links arranged across the page */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e1d0db;
}

.site-nav a {
  padding: 10px 0;
  color: #7c3e65;
  font-weight: 700;
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* Space and a dividing line between sections */
section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid #e1d0db;
}

h2 {
  margin: 0 0 16px;
  font-size: 26px;
  line-height: 1.3;
}

/* Links within sections */
section a {
  color: #7c3e65;
  text-underline-offset: 4px;
}

/* Arrange navigation links across the page */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e1d0db;
}

/* Navigation link appearance */
.site-nav a {
  padding: 10px 0;
  color: #7c3e65;
  font-weight: 700;
  text-decoration: none;
}

/* Show which link the pointer is over */
.site-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* Separate the main sections with space and a fine line */
main > section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid #e1d0db;
}

/* Section headings */
h2 {
  margin: 0 0 16px;
  font-size: 26px;
  line-height: 1.3;
}

/* Links within sections */
section a {
  color: #7c3e65;
  text-underline-offset: 4px;
}

/* Handwritten titles for the two blog categories */
#blog strong {
  font-family: "Caveat", cursive;
  font-size: 28px;
  font-weight: 600;
  color: #7c3e65;
}

/* Group the skill choices without a default fieldset border */
.skills-fieldset {
  min-width: 0;
  margin: 24px 0 0;
  padding: 0;
  border: 0;
}

.skills-fieldset legend {
  margin-bottom: 16px;
  font-weight: 700;
}

/* Display two columns of cards */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* Individual skill cards */
.skill-card {
  padding: 20px;
  background: #fffdfе;
  border: 1px solid #e1d0db;
  border-radius: 12px;
}

/* Keep the checkbox beside its label */
.skill-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 700;
  cursor: pointer;
}

.skill-choice input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: #7c3e65;
}

/* Expandable evidence */
.skill-card details {
  margin-top: 12px;
}

.skill-card summary {
  padding: 10px 0;
  color: #7c3e65;
  cursor: pointer;
}

.skill-card details p {
  margin: 12px 0 0;
  color: #6b5d6d;
}

/* Visible keyboard focus */
.skill-grid :focus-visible {
  outline: 3px solid #7c3e65;
  outline-offset: 4px;
}

/* Stack cards on smaller screens */
@media (max-width: 600px) {
  .skill-grid {
    grid-template-columns: 1fr;
  }
}

/* Keep hidden content out of the layout */
[hidden] {
  display: none !important;
}

/* Highlight selected cards */
.skill-card.is-selected {
  border-color: #7c3e65;
  background: #f5e8f0;
}

/* Selection instructions */
#skill-count {
  margin-top: 20px;
  color: #6b5d6d;
}

/* Arrange the build and reset buttons */
.builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
}

/* Main builder button */
.builder-button {
  min-height: 44px;
  padding: 12px 20px;
  border: 1px solid #7c3e65;
  border-radius: 8px;
  background: #7c3e65;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* Secondary reset button */
.builder-button.secondary {
  background: transparent;
  color: #7c3e65;
}

/* Indicate unavailable actions */
.builder-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Keyboard focus */
.builder-button:focus-visible,
.scientist-result:focus-visible {
  outline: 3px solid #7c3e65;
  outline-offset: 4px;
}

/* Revealed scientist profile */
.scientist-result {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid #e1d0db;
  border-radius: 12px;
  background: #f5e8f0;
}

.scientist-result h3 {
  margin: 0 0 12px;
  font-family: "Caveat", cursive;
  font-size: 36px;
  line-height: 1.2;
}

#selected-skills {
  margin: 16px 0;
  padding-left: 22px;
}


/* Centre the photograph and greeting */
.scientist-result {
  text-align: center;
}

/* Circular portrait */
.scientist-photo {
  display: block;
  width: 180px;
  height: 180px;
  max-width: 100%;
  margin: 0 auto 20px;
  object-fit: cover;
  border: 2px solid #e1d0db;
  border-radius: 50%;
}

/* Gently reveal the profile */
.scientist-result:not([hidden]) {
  animation: scientist-appear 0.3s ease-out;
}

@keyframes scientist-appear {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Respect visitors who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .scientist-result:not([hidden]) {
    animation: none;
  }
}

/* Container for the clickable DNA message */
/* Outer DNA card */
.dna-message {
  margin-top: 24px;
  padding: 0;
  border: 1px solid #967b8b;
  border-radius: 9px;
  background: #fffdfe;
  overflow: hidden;
}

/* Clickable header */
.dna-message summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  list-style: none;
  color: #7c3e65;
  cursor: pointer;
}

.dna-message summary::-webkit-details-marker {
  display: none;
}

.dna-summary-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.dna-eyebrow {
  color: #6b5d6d;
  font-size: 14px;
  letter-spacing: 0.6px;
}

.dna-message code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 14px;
  color: #322936;
  overflow-wrap: anywhere;
}

/* Prominent decode control */
.dna-decode {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 7px;
  background: #7c3e65;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

.dna-message summary:hover .dna-decode {
  background: #63304f;
}

/* Switch the label according to the open state */
.dna-close-label {
  display: none;
}

.dna-message[open] .dna-open-label {
  display: none;
}

.dna-message[open] .dna-close-label {
  display: inline;
}

/* Revealed content */
.dna-reveal {
  margin: 0;
  padding: 24px 18px;
  border-top: 1px solid #e1d0db;
}

.dna-rna {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #6b5d6d;
  font-size: 14px;
}

.dna-arrow {
  margin: 16px 0;
  text-align: center;
  color: #7c3e65;
  font-size: 24px;
}

/* Six amino-acid tiles */
.dna-tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dna-tiles li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 16px 4px;
  border-radius: 5px;
  background: #f5e8f0;
}

.dna-tiles span {
  font-size: 14px;
  text-align: center;
  overflow-wrap: anywhere;
}

.dna-tiles code,
.dna-tiles small {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 14px;
  color: #6b5d6d;
}

.dna-tiles strong {
  color: #7c3e65;
  font-size: 32px;
  line-height: 1.2;
}

/* Decoded word and short tagline */
.dna-message .dna-word {
  margin: 24px 0 8px;
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 4px;
  text-align: center;
  color: #7c3e65;
}

.dna-tagline {
  margin: 0;
  color: #6b5d6d;
  font-size: 14px;
  text-align: center;
}

/* Keyboard focus */
.dna-message summary:focus-visible {
  outline: 3px solid #7c3e65;
  outline-offset: -4px;
}

/* Keep the tiles readable on smaller screens */
@media (max-width: 640px) {
  .dna-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .dna-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* Align the DNA header with the decoded content */
.dna-message summary {
  position: relative;
  display: block;
  padding: 20px;
}

.dna-summary-copy {
  align-items: flex-start;
  gap: 14px;
}

/* Make the heading more prominent */
.dna-summary-copy > .dna-eyebrow {
  padding-right: 40px;
  color: #7c3e65;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
}

/* Position the decorative DNA icon independently */
.dna-symbol {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 24px;
  line-height: 1;
}

/* Keep the sequence within the available width */
.dna-summary-copy > code {
  max-width: 100%;
}

/* Match the header and content padding */
.dna-reveal {
  padding: 20px;
}

/* Keep the decode control comfortable on narrow screens */
.dna-decode {
  max-width: 100%;
  justify-content: center;
  text-align: center;
}


/* Two blog categories on the homepage */
.blog-categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.blog-category {
  display: block;
  padding: 20px;
  border: 1px solid #e1d0db;
  border-radius: 12px;
  color: #322936;
  text-decoration: none;
}

.blog-category:hover {
  border-color: #7c3e65;
  background: #f5e8f0;
}

/* Handwritten category titles */
.blog-category h3 {
  margin: 0 0 8px;
  font-family: "Caveat", cursive;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  color: #7c3e65;
}

.blog-category p {
  margin: 0 0 16px;
  color: #6b5d6d;
}

.blog-category span {
  color: #7c3e65;
  font-size: 14px;
  font-weight: 700;
}

/* Navigation back from the blog pages */
.blog-back {
  margin-bottom: 24px;
}

.blog-back a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #7c3e65;
  font-weight: 700;
  text-decoration: none;
}

.blog-back a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.blog-empty {
  color: #6b5d6d;
}

/* Stack the categories on smaller screens */
@media (max-width: 600px) {
  .blog-categories {
    grid-template-columns: 1fr;
  }
}

/* Shared list styling for projects and published work */
.portfolio-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 1rem;
}

/* Compact cards */
.portfolio-entry {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid #dbcbd8;
  border-radius: 12px;
  background: #fff;
}

/* Decorative DNA or paper marker */
.portfolio-icon {
  flex-shrink: 0;
  font-size: 1.5rem;
  line-height: 1.4;
}

.portfolio-content {
  flex: 1;
  min-width: 0;
}

.portfolio-title {
  margin: 0;
  font-family: inherit;
  font-size: 1.05rem;
  line-height: 1.5;
}

.portfolio-entry p {
  margin: 0.45rem 0;
}

.portfolio-meta {
  color: #655c6b;
  font-size: 0.9rem;
}

/* Clickable titles and source links */
.portfolio-entry a {
  color: var(--accent, #7a3e68);
  overflow-wrap: anywhere;
  text-underline-offset: 3px;
}

.portfolio-title a {
  text-decoration: none;
}

.portfolio-title a:hover {
  text-decoration: underline;
}

.portfolio-entry a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}