:root {
  --bg: #090b0a;
  --panel: #101311;
  --panel-2: #151915;
  --ink: #eceee8;
  --text: #c8cdc4;
  --muted: #7c867d;
  --line: #273029;
  --line-2: #394239;
  --green: #77f0a0;
  --spotify: #1ed760;
  --green-dim: #23452d;
  --amber: #d8b56c;
  --blue: #8fb8ff;
  --max: 1080px;
  --mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}

body {
  min-height: 100svh;
  margin: 0;
  background:
    linear-gradient(rgba(119, 240, 160, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(119, 240, 160, 0.018) 1px, transparent 1px),
    radial-gradient(circle at 18% 0%, rgba(119, 240, 160, 0.08), transparent 28rem),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration-color: rgba(119, 240, 160, 0.38);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

a:focus-visible,
button:focus-visible {
  outline: 1px solid var(--green);
  outline-offset: 3px;
}

button {
  font: inherit;
}

.shell {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 16px;
  height: 16px;
  color: var(--green);
  flex: none;
}

.quick-links {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.78rem;
}

.quick-links a {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 10px;
  text-decoration: none;
}

.quick-links a:first-child {
  background: var(--spotify);
  color: #061108;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: 34px;
  align-items: end;
  padding: 48px 0 30px;
}

.hero-main {
  max-width: 760px;
}

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

h1 {
  max-width: 740px;
  margin-bottom: 16px;
  font-family: var(--sans);
  font-size: clamp(2.25rem, 6vw, 5rem);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 0.94;
}

.intro {
  max-width: 690px;
  margin-bottom: 18px;
  color: var(--text);
  font-size: 0.98rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cta-row a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(16, 19, 17, 0.72);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.cta-row a:hover {
  border-color: var(--green);
  color: var(--green);
}

.cta-row .primary {
  border-color: var(--spotify);
  background: var(--spotify);
  color: #061108;
}

.portrait {
  width: 168px;
  aspect-ratio: 1;
  margin: 0;
  padding: 8px;
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      from 2deg,
      var(--green) 0deg 6deg,
      var(--line-2) 6deg 11deg
    );
  filter: drop-shadow(0 0 18px rgba(119, 240, 160, 0.08));
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 2px solid var(--bg);
  border-radius: 50%;
  filter: grayscale(0.2) contrast(1.05);
}

.status-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: rgba(16, 19, 17, 0.72);
}

.status-grid div {
  min-height: 86px;
  padding: 14px;
  border-right: 1px solid var(--line);
}

.status-grid div:last-child {
  border-right: 0;
}

.status-grid span,
.line-card span,
.timeline span {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
}

.status-grid p {
  margin-bottom: 0;
  color: var(--text);
  font-size: 0.8rem;
}

.tabs-card {
  margin: 0 0 28px;
  border: 1px solid var(--line);
  background: rgba(10, 12, 11, 0.86);
}

.tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.tab {
  min-height: 42px;
  flex: 0 0 auto;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 0 15px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 800;
}

.tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.025);
}

.tab.active {
  background: rgba(30, 215, 96, 0.12);
  color: var(--spotify);
}

.tab-panel {
  padding: 24px;
}

.panel-header {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 28px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.24rem;
  line-height: 1.12;
}

.panel-header p {
  max-width: 610px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.dense-grid {
  display: grid;
  gap: 12px;
}

.dense-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.line-card,
.resume-grid article,
.archive-list article,
.paper-list article {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 2px;
  padding: 16px;
}

h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.35;
}

.line-card p,
.resume-grid p,
.archive-list p,
.paper-list p,
.project-row p,
.timeline p {
  margin-bottom: 0;
  color: var(--text);
  font-size: 0.82rem;
}

.project-list {
  display: grid;
  gap: 12px;
}

.project-row {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 12px;
}

.project-image {
  min-height: 110px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #161a18;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-image.contain img {
  object-fit: contain;
}

.project-image.cabee {
  background: #39d85d;
}

.project-image.lumi {
  background: #f4f0e7;
}

.row-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.row-title a {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.tags li {
  border: 1px solid var(--line-2);
  border-radius: 3px;
  padding: 3px 7px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.paper-list,
.archive-list,
.resume-grid,
.education-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.education-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.school-card {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 16px;
  background: var(--panel);
}

.school-logo {
  height: 74px;
  display: grid;
  align-items: center;
  justify-items: start;
  border: 1px solid rgba(236, 238, 232, 0.08);
  border-bottom: 1px solid var(--line);
  border-radius: 2px;
  padding-bottom: 14px;
  padding-left: 12px;
  background: #f6f6f0;
}

.school-logo img {
  max-width: 162px;
  max-height: 54px;
  object-fit: contain;
}

.school-logo.near-east img {
  width: 54px;
  height: 54px;
}

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

.timeline {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.timeline article {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  padding: 14px;
  background: var(--panel);
}

.timeline h3 {
  margin-bottom: 5px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.gallery-item {
  aspect-ratio: 1;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

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

.resume-actions {
  margin-top: 16px;
}

.resume-frame {
  height: min(68svh, 720px);
  min-height: 430px;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
}

.resume-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.footer {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
}

@media (max-width: 880px) {
  .hero,
  .panel-header,
  .dense-grid.two {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 20px;
    padding-top: 36px;
  }

  .portrait {
    width: 132px;
    grid-row: 1;
  }

  .status-grid,
  .paper-list,
  .archive-list,
  .resume-grid,
  .education-list {
    grid-template-columns: 1fr;
  }

  .status-grid div,
  .status-grid div:last-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .status-grid div:last-child {
    border-bottom: 0;
  }

  .tab-panel {
    padding: 18px;
  }

  .panel-header {
    gap: 6px;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, var(--max));
  }

  .topbar {
    min-height: 70px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }

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

  h1 {
    font-size: clamp(2rem, 13vw, 3.65rem);
  }

  .intro {
    font-size: 0.9rem;
  }

  .cta-row a {
    flex: 1 1 auto;
  }

  .tabs {
    margin: 0 -1px;
  }

  .tab {
    min-height: 40px;
    padding: 0 11px;
  }

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

  .project-image {
    min-height: 154px;
  }

  .row-title {
    display: block;
  }

  .row-title a {
    display: inline-block;
    margin-bottom: 8px;
  }

  .timeline article {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer {
    min-height: 64px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
  }
}
