/* Project profile: a formal documentation sheet with an Egyptian data-stream signature. */
.profile-screen {
  max-width: var(--content-max);
  padding-block: var(--s-6) var(--s-8);
}

.profile-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  margin-block-end: var(--s-6);
  border: 1px solid var(--ink);
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--ink), var(--teal-800));
  box-shadow: var(--shadow-2);
}

.profile-hero-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  inline-size: 100%;
  block-size: 100%;
  color: var(--cyan-400);
  opacity: 0.16;
}

.profile-hero-art path,
.profile-hero-art circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
}

.profile-hero-art circle {
  fill: currentColor;
  stroke: none;
}

.profile-hero-content {
  padding: clamp(var(--s-5), 5vw, var(--s-8));
  text-align: center;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin: 0 0 var(--s-5);
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--gold-200);
  border-radius: var(--r-pill);
  background: var(--surface-gold);
  color: var(--ink);
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
}

.profile-badge img {
  inline-size: 1.6rem;
  block-size: auto;
}

.profile-mark {
  display: block;
  inline-size: 3.5rem;
  block-size: 3.5rem;
  margin: 0 auto var(--s-4);
}

.profile-hero h1 {
  max-width: 22ch;
  margin: 0 auto;
  color: var(--ink-inverse);
  font-size: clamp(2rem, 1.2rem + 3vw, 3.5rem);
  line-height: var(--lh-head);
}

.profile-title-en {
  max-width: 54ch;
  margin: var(--s-3) auto var(--s-7);
  color: var(--cyan-200);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.profile-identity {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-block: 1px solid var(--cyan-400);
  text-align: start;
}

.profile-identity-item {
  display: contents;
}

.profile-identity dt,
.profile-identity dd {
  min-inline-size: 0;
  margin: 0;
  padding: var(--s-3) var(--s-4);
  border-block-end: 1px solid var(--cyan-400);
}

.profile-identity dt:nth-last-of-type(-n + 2),
.profile-identity dd:nth-last-of-type(-n + 2) {
  border-block-end: 0;
}

.profile-identity dt {
  color: var(--cyan-200);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
}

.profile-identity dd {
  color: var(--ink-inverse);
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
}

.profile-section {
  margin-block-end: var(--s-5);
  padding: clamp(var(--s-4), 3vw, var(--s-6));
}

.profile-section-heading {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: 0 0 var(--s-5);
  color: var(--ink);
  font-size: var(--fs-h2);
  line-height: var(--lh-head);
}

.profile-section-number {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  inline-size: 2.1rem;
  block-size: 2.1rem;
  border-radius: 50%;
  background: var(--gold-400);
  color: var(--ink);
  font-size: var(--fs-small);
}

.profile-table-wrap {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.profile-table {
  inline-size: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.profile-table th,
.profile-table td {
  padding: var(--s-3) var(--s-4);
  border-block-end: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
}

.profile-table th {
  background: var(--surface-tint);
  color: var(--teal-700);
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
}

.profile-table td {
  color: var(--ink-2);
  font-size: var(--fs-small);
}

.profile-table tr:last-child td {
  border-block-end: 0;
}

.profile-languages-table th:first-child,
.profile-tools-table th:first-child,
.profile-languages-table td:first-child,
.profile-tools-table td:first-child {
  inline-size: 17%;
}

.profile-sources-table th:nth-child(2),
.profile-sources-table td:nth-child(2) {
  inline-size: 18%;
}

.profile-note {
  margin: var(--s-4) 0 0;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-sm);
  background: var(--surface-tint);
  color: var(--ink-2);
  font-size: var(--fs-small);
}

.profile-tree,
.profile-features {
  display: grid;
  gap: var(--s-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-tree {
  border-block-start: 1px solid var(--border);
}

.profile-tree-item {
  display: grid;
  grid-template-columns: minmax(10rem, 0.8fr) minmax(0, 2fr);
  gap: var(--s-4);
  align-items: baseline;
  padding-block: var(--s-3);
  border-block-end: 1px solid var(--border);
}

.profile-tree-name {
  color: var(--teal-700);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
}

.profile-tree-description {
  color: var(--ink-2);
  font-size: var(--fs-small);
}

.profile-feature {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s-3);
  align-items: start;
  color: var(--ink-2);
}

.profile-feature svg {
  inline-size: 1.4rem;
  block-size: 1.4rem;
  margin-block-start: 0.35em;
  color: var(--ok);
}

.profile-link-section {
  background: var(--surface-tint);
}

.profile-external-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  max-inline-size: 100%;
  overflow-wrap: anywhere;
  color: var(--teal-700);
  font-weight: var(--fw-bold);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.profile-external-link svg {
  flex: 0 0 auto;
  inline-size: 1.35rem;
  block-size: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-3);
  padding-block-start: var(--s-2);
}

@media (max-width: 900px) {
  .profile-identity {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-identity dt:nth-last-of-type(-n + 2),
  .profile-identity dd:nth-last-of-type(-n + 2) {
    border-block-end: 1px solid var(--cyan-400);
  }

  .profile-identity dt:nth-last-of-type(1),
  .profile-identity dd:nth-last-of-type(1) {
    border-block-end: 0;
  }
}

@media (max-width: 620px) {
  .profile-screen {
    padding-block: var(--s-4) var(--s-7);
  }

  .profile-hero-content {
    padding: var(--s-5) var(--s-4);
  }

  .profile-title-en {
    margin-block-end: var(--s-5);
  }

  .profile-identity {
    grid-template-columns: 1fr;
    gap: var(--s-1);
    border-block-end: 0;
  }

  .profile-identity-item {
    display: grid;
    gap: var(--s-1);
    padding: var(--s-3) 0;
    border-block-end: 1px solid var(--cyan-400);
  }

  .profile-identity-item:last-child {
    border-block-end: 0;
  }

  .profile-identity dt,
  .profile-identity dd,
  .profile-identity dt:nth-last-of-type(-n + 2),
  .profile-identity dd:nth-last-of-type(-n + 2),
  .profile-identity dt:nth-last-of-type(1),
  .profile-identity dd:nth-last-of-type(1) {
    padding: 0;
    border: 0;
  }

  .profile-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .profile-table,
  .profile-table thead,
  .profile-table tbody,
  .profile-table tr,
  .profile-table th,
  .profile-table td {
    display: block;
  }

  .profile-table thead {
    position: absolute;
    overflow: hidden;
    inline-size: 1px;
    block-size: 1px;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .profile-table tbody {
    display: grid;
    gap: var(--s-3);
  }

  .profile-table tr {
    padding: var(--s-3);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
    box-shadow: var(--shadow-1);
  }

  .profile-table td {
    display: grid;
    grid-template-columns: minmax(7rem, 0.7fr) minmax(0, 1.3fr);
    gap: var(--s-3);
    padding: var(--s-2) 0;
    border-block-end: 1px solid var(--border);
  }

  .profile-table td:last-child {
    border-block-end: 0;
  }

  .profile-table td::before {
    content: attr(data-label);
    color: var(--teal-700);
    font-weight: var(--fw-bold);
  }

  .profile-tree-item {
    grid-template-columns: 1fr;
    gap: var(--s-1);
  }
}

@media print {
  body #stage[data-screen="profile"],
  body #stage[data-screen="profile"] * {
    visibility: visible !important;
  }

  .profile-screen {
    max-inline-size: none;
    padding: 0;
  }

  .profile-hero {
    border-color: var(--border-strong);
    background: var(--surface);
    box-shadow: none;
  }

  .profile-hero-art {
    color: var(--teal-700);
    opacity: 0.12;
  }

  .profile-hero h1,
  .profile-identity dd {
    color: var(--ink);
  }

  .profile-title-en,
  .profile-identity dt {
    color: var(--teal-700);
  }

  .profile-section {
    break-inside: avoid;
    box-shadow: none;
  }

  .profile-actions {
    display: none;
  }
}
