:root {
  --background: #212121;
  --panel: #212121;

  --foreground: #e6e6e6;
  --muted-foreground: #bdbdbd;

  --border: rgba(255, 255, 255, 0.12);
  --chip: rgba(255, 255, 255, 0.08);
  --chip-foreground: #dcdcdc;
  --accent: #7c5cff;

  --window-bar: rgba(0, 0, 0, 0.22);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.38);

  --terminal-bg: #111111;
  --terminal-border: rgba(255, 255, 255, 0.08);
  --terminal-green: #22c55e;
  --badge-bg: rgba(34, 197, 94, 0.12);
  --badge-border: rgba(34, 197, 94, 0.3);
  --badge-fg: #22c55e;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    "Apple Color Emoji",
    "Segoe UI Emoji";
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--foreground);
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.layout {
  width: min(1120px, 100%);
  margin: 0;
  display: grid;
  grid-template-columns: 2fr 3fr;
  min-height: 0;
  gap: 20px;
  padding: 24px 18px;
  align-items: start;
}

.layout.one-column {
  width: min(820px, 100%);
  grid-template-columns: 1fr;
  margin: 0 auto;
}

.layout.one-column .stack {
  width: 100%;
}

.layout.one-column .skills {
  grid-template-columns: 1fr 1fr;
}

.layout.one-column .term-name {
  font-size: clamp(32px, 5vw, 42px);
}

.layout.one-column .terminal {
  padding: 18px 18px 22px 18px;
}

.left {
  display: flex;
  align-items: flex-start;
}

.right {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}

.right-inner {
  width: min(760px, 100%);
}

.stack {
  display: grid;
  gap: 20px;
}

.window {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.terminal-window {
  background: var(--terminal-bg);
  border-color: var(--terminal-border);
}

.window-bar {
  height: 34px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--terminal-border);
  display: flex;
  align-items: center;
  padding: 0 12px;
}

.window-dots {
  display: inline-flex;
  gap: 8px;
}

.window-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.window-dots .dot.red {
  background: #ff5f57;
}

.window-dots .dot.yellow {
  background: #febc2e;
}

.window-dots .dot.green {
  background: #28c840;
}

.window-body {
  background: var(--panel);
}

.terminal-window .window-body {
  background: var(--terminal-bg);
}

.terminal {
  padding: 18px 18px 20px 18px;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
}

.prompt {
  color: var(--terminal-green);
  font-size: clamp(13px, 1.5vw, 15px);
  line-height: 1.6;
  margin: 0 0 10px 0;
}

.term-header {
  margin-bottom: 14px;
}

.term-name {
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial;
  font-weight: 700;
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: -0.02em;
  margin: 2px 0 6px 0;
}

.term-role {
  color: rgba(230, 230, 230, 0.75);
  font-size: clamp(14px, 2vw, 16px);
  margin: 0;
  font-weight: normal;
}

.term-header p {
  font-size: clamp(15px, 2vw, 17px);
  line-height: 1.6;
  margin-top: 14px;
}

.chips-green {
  margin-top: 6px;
  gap: 10px;
}

.chip-green {
  background: var(--badge-bg);
  border-color: var(--badge-border);
  color: var(--badge-fg);
  font-weight: 600;
}

.term-kv {
  display: grid;
  gap: 10px;
  margin: 2px 0 14px 0;
}

.kv {
  display: grid;
  gap: 4px;
}

.kv-k {
  color: rgba(34, 197, 94, 0.85);
  font-size: clamp(13px, 1.5vw, 14px);
  margin: 0;
}

.kv-v {
  color: rgba(230, 230, 230, 0.82);
  font-size: clamp(14px, 2vw, 16px);
  margin: 0;
}

.link {
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
  text-decoration-color: rgba(34, 197, 94, 0.55);
  text-underline-offset: 3px;
}

.social-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  background: rgba(34, 197, 94, 0.08);
  color: rgba(230, 230, 230, 0.9);
  font-size: clamp(14px, 2vw, 16px);
}

.btn:hover {
  border-color: rgba(34, 197, 94, 0.32);
  background: rgba(34, 197, 94, 0.11);
}

.profile {
  width: 100%;
  padding: 56px 28px;
  text-align: center;
}

.avatar {
  width: 160px;
  height: 160px;
  margin: 0 auto 18px auto;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid var(--border);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-text h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.profile-text h2 {
  margin: 8px 0 0 0;
  font-size: 18px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.profile-text p {
  margin: 0;
  font-size: 14px;
  color: var(--muted-foreground);
  line-height: 1.6;
}

.rule {
  height: 1px;
  background: var(--terminal-border);
  margin: 10px 0 0 0;
}

.rule.short {
  width: 64px;
  margin: 16px auto 14px auto;
}

.contact {
  margin-top: 28px;
  display: grid;
  gap: 12px;
  color: var(--muted-foreground);
}

.row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
}

.row a {
  color: var(--muted-foreground);
}

.row a:hover {
  color: var(--foreground);
}

.icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.social {
  margin-top: 4px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.social a {
  padding: 8px;
  color: var(--muted-foreground);
  border-radius: 10px;
}

.social a:hover {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.04);
}

.block {
  padding: 14px 0;
}

.block-title {
  display: grid;
  gap: 8px;
}

.block-title h3 {
  margin: 0;
  font-size: clamp(18px, 2.5vw, 22px);
  letter-spacing: -0.01em;
}

.term-title {
  margin-bottom: 12px;
}

.skills {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 22px;
}

.skill-group {
  margin-bottom: 10px;
}

.skill-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted-foreground);
}

.skill-head h4 {
  margin: 0;
  font-size: clamp(14px, 2vw, 16px);
  font-weight: 600;
}

.mini-icon {
  width: 16px;
  height: 16px;
}

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

.chip {
  padding: 6px 12px;
  font-size: clamp(13px, 1.5vw, 15px);
  border-radius: 999px;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-fg);
  font-weight: 600;
}

.timeline {
  margin-top: 18px;
  display: grid;
  gap: 18px;
}

.timeline-item {
  position: relative;
  padding-left: 18px;
  border-left: 2px solid var(--terminal-border);
}

.timeline-dot {
  position: absolute;
  left: -6px;
  top: 10px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--terminal-border);
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}

.timeline-top h5 {
  margin: 0;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 600;
}

.period {
  font-size: clamp(14px, 1.5vw, 15px);
  color: var(--muted-foreground);
}

.company {
  margin-top: 6px;
  margin-bottom: 0;
  font-size: clamp(15px, 2vw, 17px);
  font-weight: 600;
  color: var(--muted-foreground);
}

.timeline-content p:not(.company) {
  margin: 8px 0 0 0;
  font-size: clamp(15px, 2vw, 17px);
  line-height: 1.6;
  color: var(--muted-foreground);
  position: relative;
  padding-left: 16px;
}

.timeline-content p:not(.company)::before {
  content: "-";
  position: absolute;
  left: 0;
  color: rgba(230, 230, 230, 0.75);
}

.more-content {
  display: grid;
  grid-template-rows: 0fr;
  transition:
    grid-template-rows 0.4s ease-out,
    opacity 0.4s ease-out;
  opacity: 0;
}

.more-content.expanded {
  grid-template-rows: 1fr;
  opacity: 1;
}

.more-content-inner {
  overflow: hidden;
}

.fade-out {
  height: 50px;
  margin-top: -30px;
  background: linear-gradient(
    to bottom,
    rgba(17, 17, 17, 0),
    var(--terminal-bg)
  );
  position: relative;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.read-more-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 8px;
  position: relative;
  z-index: 2;
}

.read-more-btn {
  background: none;
  border: 1px solid rgba(34, 197, 94, 0.22);
  color: var(--terminal-green);
  font-family: inherit;
  font-size: clamp(13px, 1.5vw, 15px);
  cursor: pointer;
  padding: 6px 14px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.read-more-btn:hover {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.4);
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 16px 12px 22px 12px;
    gap: 16px;
  }

  .layout.one-column {
    width: 100%;
  }

  .left {
    align-items: flex-start;
  }

  .right {
    justify-content: flex-start;
  }

  .right-inner {
    width: 100%;
  }

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

  .layout.one-column .skills {
    grid-template-columns: 1fr;
  }

  .avatar {
    width: 124px;
    height: 124px;
  }

  .profile {
    padding: 52px 22px;
  }
}
