:root {
  --bg: #ffffff;
  --paper: #ffffff;
  --soft: #f7f7f5;
  --blue-soft: #e9f3fb;
  --ink: #37352f;
  --muted: #6f6b64;
  --line: #e9e6df;
  --accent: #2368a2;
  --accent-2: #2368a2;
  --mark: #fbf3db;
  --shadow: 0 14px 45px rgba(55, 53, 47, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.58;
}

a {
  color: #63728a;
  text-decoration-color: rgba(99, 114, 138, 0.72);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.page {
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
}

.intro {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: clamp(24px, 5vw, 52px);
  align-items: stretch;
  padding: 64px 0 34px;
}

.portrait {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 230px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--blue-soft);
  color: var(--accent);
  overflow: hidden;
  font-size: 3.8rem;
  font-weight: 850;
}

.portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

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

h1 {
  margin-bottom: 4px;
  font-size: clamp(2.15rem, 4.4vw, 2.85rem);
  line-height: 1.16;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.55rem;
  line-height: 1.25;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title span {
  width: 1.35em;
  flex: none;
  font-size: 1.05em;
  line-height: 1;
}

.role {
  color: var(--muted);
  font-size: 1.08rem;
  font-style: italic;
}

.bio {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 230px;
}

.bio p {
  margin-bottom: 0.45rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-weight: 700;
}

.profile-lines {
  margin-top: 4px;
}

.profile-lines p {
  margin: 0.2rem 0;
}

.profile-lines p:last-child {
  margin-bottom: 0;
}

.terminal-section {
  padding: 6px 0 24px;
}

.terminal {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: none;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.88rem;
}

.terminal-chrome {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #f1f1ef;
}

.terminal-chrome p {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.terminal-chrome button {
  justify-self: end;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 750;
}

.dots {
  display: flex;
  gap: 8px;
}

.dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.red {
  background: #ed675f;
}

.yellow {
  background: #e9ba4b;
}

.green {
  background: #62c76e;
}

.terminal-screen {
  min-height: 170px;
  padding: 14px 16px;
  color: var(--muted);
  font-size: clamp(0.78rem, 1.6vw, 0.95rem);
  line-height: 1.42;
  cursor: text;
}

.terminal-screen:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: -2px;
}

.line {
  margin: 0;
}

.line + .line {
  margin-top: 2px;
}

.space {
  height: 0.65em;
}

.prompt,
.ready {
  color: var(--accent);
  font-weight: 760;
}

.cursor {
  display: inline-block;
  width: 0.62em;
  height: 1.05em;
  margin-left: 0.12em;
  transform: translateY(0.14em);
  background: var(--accent);
  animation: blink 1s steps(2, start) infinite;
}

.terminal-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-top: 1px solid var(--line);
  background: #f7f7f5;
  color: var(--muted);
}

.terminal-bottom button {
  min-height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.82rem;
}

.section {
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.notice {
  padding: 18px 20px;
  border: 1px solid rgba(35, 104, 162, 0.16);
  border-radius: 4px;
  background: var(--blue-soft);
}

.notice p:last-child,
.section p:last-child {
  margin-bottom: 0;
}

.date {
  color: var(--accent-2);
  font-weight: 750;
}

.keywords {
  color: var(--ink);
}

.keywords strong,
.research-line strong {
  color: var(--accent);
  font-weight: 800;
}

.research-line span {
  background: rgba(72, 112, 180, 0.2);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 0 2px;
}

.project-list,
.section ul {
  padding-left: 1.25rem;
}

.contact {
  padding-bottom: 52px;
}

.footer {
  padding: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

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

@media (max-width: 720px) {
  .intro {
    display: block;
  }

  .portrait {
    width: min(240px, 100%);
    aspect-ratio: 1;
    min-height: 0;
    margin-bottom: 22px;
  }

  .bio {
    height: auto;
    min-height: 0;
  }

  .terminal-chrome {
    grid-template-columns: 1fr auto;
  }

  .terminal-chrome p {
    display: none;
  }
}
