:root {
  color-scheme: dark;
  --bg: #050506;
  --terminal: #09090c;
  --terminal-alt: #0e0d12;
  --surface: #0b0a0f;
  --surface-hover: #111018;
  --line: #29292d;
  --line-strong: #4a4a50;
  --text: #f4f4f5;
  --text-soft: #ceced2;
  --muted: #94949b;
  --muted-dark: #68686f;
  --accent: #f4f4f5;
  --accent-dim: rgba(255, 255, 255, 0.055);
  --success: #6fd28f;
  --blue: #55aaff;
  --yellow: #e7c96b;
  --mono: "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", Menlo,
    monospace;
  --page-pad: clamp(0.65rem, 2vw, 1.5rem);
}

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

html,
body {
  width: 100%;
  height: 100%;
  min-width: 320px;
  margin: 0;
  overflow: hidden;
}

body {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding:
    max(var(--page-pad), env(safe-area-inset-top))
    max(var(--page-pad), env(safe-area-inset-right))
    max(var(--page-pad), env(safe-area-inset-bottom))
    max(var(--page-pad), env(safe-area-inset-left));
  place-items: center;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--bg);
  background-size: 32px 32px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a,
button {
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--accent);
  color: var(--terminal);
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10000;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--text);
  background: var(--terminal);
  color: var(--text);
  font-size: 0.72rem;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 100ms linear;
}

.skip-link:focus {
  transform: translateY(0);
}

.terminal {
  display: grid;
  width: min(1120px, 100%);
  height: min(820px, calc(100vh - var(--page-pad) - var(--page-pad)));
  height: min(820px, calc(100dvh - var(--page-pad) - var(--page-pad)));
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: rgba(9, 9, 12, 0.985);
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.58);
  animation: terminal-enter 180ms ease-out both;
}

@keyframes terminal-enter {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
}

.terminal__chrome {
  min-width: 0;
  border-bottom: 1px solid var(--line);
  background: var(--terminal-alt);
}

.terminal__titlebar {
  display: flex;
  min-width: 0;
  min-height: 2.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.66rem;
}

.terminal__window-title,
.terminal__session {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.terminal__window-title {
  overflow: hidden;
  white-space: nowrap;
}

.terminal__location {
  overflow: hidden;
  text-overflow: ellipsis;
}

.terminal__mark {
  width: 0.55rem;
  height: 0.55rem;
  flex: 0 0 auto;
  margin-right: 0.3rem;
  background: var(--blue);
}

.terminal__host {
  flex: 0 0 auto;
  color: var(--text);
}

.terminal__session {
  flex: 0 0 auto;
  color: #a9cbb6;
  text-transform: uppercase;
}

.terminal__session > span {
  width: 0.42rem;
  height: 0.42rem;
  background: var(--success);
}

.terminal__tabs {
  display: grid;
  min-height: 2.55rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.terminal__tabs button {
  position: relative;
  display: inline-flex;
  min-width: 0;
  min-height: 2.75rem;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.63rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition:
    background-color 90ms linear,
    color 90ms linear;
}

.terminal__tabs button:last-child {
  border-right: 0;
}

.terminal__tabs button:hover,
.terminal__tabs button[aria-selected="true"] {
  background: var(--terminal);
  color: var(--text);
}

.terminal__tabs button[aria-selected="true"] {
  box-shadow: inset 0 -1px 0 var(--text);
}

.terminal__tabs button[aria-selected="true"]::after {
  color: var(--text);
  content: "*";
}

.terminal__tabs button > span {
  color: var(--blue);
}

.terminal__screen {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.terminal-panel {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(0.65rem, 1.8vh, 1rem);
  padding:
    clamp(0.9rem, 3vh, 2rem)
    clamp(0.9rem, 3vw, 2.6rem);
  overflow: hidden;
}

.terminal-panel.is-active {
  display: grid;
  animation: panel-in 110ms ease-out both;
}

@keyframes panel-in {
  from {
    opacity: 0.72;
    transform: translateX(2px);
  }
}

.command-line {
  display: flex;
  min-width: 0;
  min-height: 1.25rem;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.34rem;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: clamp(0.62rem, 1.3vw, 0.72rem);
  line-height: 1.3;
  white-space: nowrap;
}

.command-line__user {
  flex: 0 0 auto;
  color: var(--blue);
}

.command-line__path {
  min-width: 0;
  overflow: hidden;
  color: var(--yellow);
  text-overflow: ellipsis;
}

.command-line [data-panel-command] {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.block-caret {
  display: inline-block;
  width: 0.44rem;
  height: 0.82rem;
  flex: 0 0 auto;
  background: var(--text);
  vertical-align: -0.1rem;
  animation: blink 820ms steps(1, end) infinite;
}

.command-line .block-caret {
  visibility: hidden;
  animation: none;
}

.command-line.is-typing .block-caret {
  visibility: visible;
  animation: blink 520ms steps(1, end) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.profile-layout {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(0, 1.45fr) minmax(15rem, 0.62fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5.5rem);
}

.profile-output {
  min-width: 0;
  padding-left: clamp(0.9rem, 2vw, 1.4rem);
  border-left: 1px solid var(--line-strong);
}

.output-label {
  margin: 0 0 clamp(0.55rem, 1.5vh, 0.9rem);
  color: var(--muted-dark);
  font-size: 0.58rem;
  text-transform: uppercase;
}

.profile-output h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(2.4rem, min(7vw, 8vh), 5.6rem);
  font-weight: 750;
  letter-spacing: -0.085em;
  line-height: 0.92;
}

.profile-role {
  margin: clamp(0.65rem, 1.8vh, 1rem) 0 0;
  color: var(--text);
  font-size: clamp(0.61rem, 1.35vw, 0.75rem);
  letter-spacing: 0.06em;
  line-height: 1.55;
}

.profile-summary {
  max-width: 46rem;
  margin: clamp(0.65rem, 1.7vh, 1rem) 0 0;
  color: var(--text-soft);
  font-size: clamp(0.7rem, 1.35vw, 0.84rem);
  line-height: 1.7;
}

.availability {
  margin: clamp(0.55rem, 1.5vh, 0.9rem) 0 0;
  color: #a4c2ae;
  font-size: clamp(0.55rem, 1.15vw, 0.64rem);
}

.availability span {
  margin-right: 0.35rem;
  color: var(--success);
}

.terminal-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: clamp(0.75rem, 2vh, 1.2rem);
}

.terminal-button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.58rem 0.75rem;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-soft);
  font-size: 0.64rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition:
    background-color 90ms linear,
    border-color 90ms linear,
    color 90ms linear,
    transform 90ms linear;
}

.terminal-button:hover {
  border-color: var(--text);
  background: var(--accent-dim);
  color: var(--text);
  transform: translateX(2px);
}

.terminal-button--primary {
  border-color: var(--text);
  background: var(--text);
  color: var(--terminal);
}

.terminal-button--primary:hover {
  background: #fff;
  color: var(--terminal);
}

.system-info {
  min-width: 0;
  color: var(--muted);
  font-size: 0.62rem;
}

.system-info__top,
.system-info__bottom {
  margin: 0;
  overflow: hidden;
  color: var(--line-strong);
  white-space: nowrap;
}

.system-info dl {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-right: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.system-info dl div {
  display: grid;
  grid-template-columns: 5.2rem minmax(0, 1fr);
  gap: 0.6rem;
  padding: clamp(0.28rem, 0.8vh, 0.4rem) 0;
}

.system-info dt,
.system-info dd {
  margin: 0;
}

.system-info dt {
  color: var(--muted-dark);
}

.system-info dt::after {
  float: right;
  content: ":";
}

.system-info dd {
  color: var(--text-soft);
}

.panel-content {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(0.55rem, 1.5vh, 0.9rem);
}

.panel-heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.panel-heading h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(0.9rem, 2.1vw, 1.2rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-heading p {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted-dark);
  font-size: 0.57rem;
}

.link-grid {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.link-row {
  display: grid;
  min-width: 0;
  min-height: 2.75rem;
  grid-template-columns: 1.7rem minmax(6.5rem, 0.75fr) minmax(0, 1fr) 0.8rem;
  align-items: center;
  gap: 0.65rem;
  padding: clamp(0.5rem, 1.5vh, 0.8rem);
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: clamp(0.58rem, 1.15vw, 0.68rem);
  text-decoration: none;
  transition:
    background-color 90ms linear,
    color 90ms linear;
}

.link-row:hover {
  background: var(--accent-dim);
  color: var(--text);
}

.link-row--primary {
  box-shadow: inset 2px 0 0 var(--text);
}

.link-row__index {
  color: var(--yellow);
}

.link-row__name,
.link-row__description {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-row__name {
  color: var(--text);
  font-weight: 650;
}

.link-row__name.ps-script {
  color: var(--blue);
}

.link-row__description {
  color: var(--muted);
}

.link-row__arrow {
  color: var(--muted-dark);
  transition:
    color 90ms linear,
    transform 90ms linear;
}

.link-row:hover .link-row__arrow {
  color: var(--blue);
  transform: translateX(2px);
}

.project-grid {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.project-entry {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: clamp(0.85rem, 2.5vh, 1.35rem);
  border-right: 1px solid var(--line);
}

.project-entry:last-child {
  border-right: 0;
}

.project-entry header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: clamp(0.7rem, 2vh, 1.15rem);
}

.project-entry header p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--muted-dark);
  font-size: 0.53rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-entry header p span {
  color: var(--yellow);
}

.project-entry header .project-state {
  flex: 0 0 auto;
  color: var(--success);
}

.project-entry h3 {
  margin: 0;
  color: var(--text);
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  font-weight: 650;
  letter-spacing: -0.035em;
}

.project-subtitle {
  margin: 0.18rem 0 0;
  color: var(--blue);
  font-size: 0.59rem;
}

.project-summary {
  display: -webkit-box;
  margin: clamp(0.55rem, 1.5vh, 0.85rem) 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: clamp(0.61rem, 1.15vw, 0.7rem);
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.project-tools {
  margin: clamp(0.5rem, 1.4vh, 0.75rem) 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.56rem;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-tools span {
  margin-right: 0.45rem;
  color: var(--blue);
}

.project-link {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  align-self: flex-start;
  margin-top: auto;
  padding-top: clamp(0.5rem, 1.5vh, 0.8rem);
  color: var(--text);
  font-size: 0.59rem;
  text-decoration: underline;
  text-decoration-color: var(--blue);
  text-underline-offset: 0.2rem;
}

.project-link:hover {
  color: var(--blue);
}

#panel-contact {
  grid-template-rows: auto minmax(0, 1fr);
}

.contact-output {
  display: flex;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 1rem;
  text-align: center;
}

.contact-output__status {
  margin: 0 0 0.65rem;
  color: var(--success);
  font-size: 0.58rem;
}

.contact-output h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.5rem, min(4.5vw, 6vh), 3rem);
  font-weight: 680;
  letter-spacing: -0.055em;
}

.contact-output > p:not(.contact-output__status) {
  max-width: 34rem;
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: clamp(0.68rem, 1.4vw, 0.8rem);
}

.contact-output .terminal-actions {
  justify-content: center;
}

.terminal__footer {
  display: flex;
  min-width: 0;
  min-height: 2.7rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.75rem;
  border-top: 1px solid var(--line);
  background: var(--terminal-alt);
  color: var(--muted-dark);
  font-size: 0.58rem;
}

.terminal__footer p {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.36rem;
  margin: 0;
  white-space: nowrap;
}

.terminal__status span {
  color: var(--success);
}

.terminal__footer p:last-child > span:first-child {
  color: var(--blue);
}

.terminal__footer .block-caret {
  width: 0.36rem;
  height: 0.66rem;
}

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  display: none;
  width: 0.4rem;
  height: 0.7rem;
  border: 1px solid var(--text);
  background: var(--text);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-2rem, -2rem, 0) translate(-50%, -50%);
  transition:
    width 80ms linear,
    height 80ms linear,
    background-color 80ms linear,
    opacity 80ms linear;
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  body.has-custom-cursor,
  body.has-custom-cursor a,
  body.has-custom-cursor button {
    cursor: none;
  }

  body.has-custom-cursor .custom-cursor {
    display: block;
  }

  .custom-cursor.is-visible {
    opacity: 0.88;
  }

  .custom-cursor.is-hovering {
    width: 0.82rem;
    height: 0.82rem;
    border-color: var(--blue);
    background: rgba(85, 170, 255, 0.2);
  }
}

@media (max-width: 680px) {
  :root {
    --page-pad: 0px;
  }

  body {
    background-size: 28px 28px;
  }

  .terminal {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .terminal__titlebar {
    padding-inline: max(0.65rem, env(safe-area-inset-left));
  }

  .terminal__tabs button {
    justify-content: center;
    padding-inline: 0.35rem;
  }

  .terminal-panel {
    padding:
      clamp(0.7rem, 2.5vh, 1rem)
      max(0.8rem, env(safe-area-inset-left));
  }

  .profile-layout {
    gap: 1.4rem;
  }

  .link-row {
    grid-template-columns: 1.5rem minmax(5.5rem, 0.8fr) minmax(0, 1fr) 0.7rem;
    gap: 0.45rem;
    padding-inline: 0.55rem;
  }

  .project-entry {
    padding-inline: 0.8rem;
  }
}

@media (max-width: 580px) {
  .terminal__session {
    display: none;
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }

  .system-info {
    display: none;
  }

  .profile-output {
    align-self: center;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-entry {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .project-entry:last-child {
    border-bottom: 0;
  }

  .project-entry header {
    margin-bottom: 0.4rem;
  }

  .project-summary {
    margin-top: 0.35rem;
    -webkit-line-clamp: 2;
  }

  .project-tools {
    margin-top: 0.3rem;
  }

  .project-link {
    padding-top: 0.25rem;
  }
}

@media (max-width: 460px) {
  .terminal__titlebar {
    min-height: 2.25rem;
    font-size: 0.58rem;
  }

  .terminal__host + span {
    display: none;
  }

  .terminal__tabs {
    min-height: 2.7rem;
  }

  .terminal__tabs button {
    min-height: 2.75rem;
    gap: 0.25rem;
    font-size: 0.56rem;
  }

  .terminal__tabs button > span {
    display: none;
  }

  .profile-output h1 {
    font-size: clamp(2.25rem, 13vw, 3.3rem);
  }

  .profile-role {
    font-size: 0.57rem;
  }

  .terminal-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .terminal-button {
    min-width: 0;
    padding-inline: 0.45rem;
    font-size: 0.57rem;
  }

  .panel-heading p {
    display: none;
  }

  .link-row {
    grid-template-columns: 1.45rem minmax(0, 1fr) 0.7rem;
  }

  .link-row__description {
    display: none;
  }

  .terminal__status {
    display: none !important;
  }

  .terminal__footer {
    justify-content: flex-end;
  }
}

@media (max-height: 650px) {
  .terminal__titlebar {
    min-height: 2.15rem;
    padding-block: 0.35rem;
  }

  .terminal__tabs,
  .terminal__tabs button {
    min-height: 2.35rem;
  }

  .terminal-panel {
    gap: 0.5rem;
    padding-block: 0.7rem;
  }

  .output-label {
    margin-bottom: 0.4rem;
  }

  .profile-role,
  .profile-summary,
  .availability,
  .terminal-actions {
    margin-top: 0.55rem;
  }

  .system-info dl div {
    padding-block: 0.22rem;
  }

  .panel-content {
    gap: 0.45rem;
  }

  .project-entry {
    padding-block: 0.7rem;
  }

  .project-entry header {
    margin-bottom: 0.4rem;
  }

  .project-summary {
    margin-top: 0.35rem;
    -webkit-line-clamp: 2;
  }

  .project-tools {
    margin-top: 0.3rem;
  }

  .project-link {
    padding-top: 0.25rem;
  }

  .terminal__footer {
    min-height: 2.3rem;
    padding-block: 0.35rem;
  }
}

@media (max-height: 480px) {
  .terminal__session,
  .terminal__status {
    display: none;
  }

  .terminal__titlebar {
    min-height: 1.9rem;
  }

  .terminal__tabs,
  .terminal__tabs button {
    min-height: 2.15rem;
  }

  .terminal__footer {
    min-height: 2rem;
    justify-content: flex-end;
  }

  .profile-output h1 {
    font-size: clamp(2rem, 10vh, 3.1rem);
  }

  .profile-summary {
    line-height: 1.45;
  }

  .project-summary {
    -webkit-line-clamp: 1;
  }

  .project-entry header,
  .project-tools {
    display: none;
  }
}

@media (max-height: 350px) {
  .terminal__titlebar,
  .terminal__footer {
    display: none;
  }

  .terminal-panel {
    overflow-y: auto;
    scrollbar-width: thin;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .custom-cursor,
  .block-caret {
    display: none !important;
  }
}
