.editor {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: minmax(0, 1fr);
  height: calc(100vh - var(--statusbar-height));
  transition: grid-template-columns 0.25s ease;
}

.editor.sidebar-collapsed {
  grid-template-columns: 0 1fr;
}

.sidebar {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-x: hidden;
  overflow-y: auto;
  user-select: none;
}

.editor.sidebar-collapsed .sidebar {
  border-right: 0;
}

.topbar {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: var(--tabbar-height);
  flex: 0 0 auto;
  background-color: var(--bg-tab-inactive);
  color: var(--text-dim);
  border: none;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.sidebar-toggle:hover {
  color: var(--text-bright);
  background-color: #333333;
}

.sidebar__header {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 10px 16px 6px;
}

.sidebar__project {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sidebar__project .chevron {
  color: var(--text-dim);
  font-size: 10px;
}

.file-tree {
  padding: 4px 0;
}

.file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 24px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  border-left: 2px solid transparent;
}

.file:hover {
  background-color: var(--bg-hover);
}

.file.active {
  background-color: #37373d;
  border-left-color: var(--accent-cyan);
}

.file__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: 700;
  flex: 0 0 auto;
  font-family: var(--font-mono);
}

.icon-tsx  { color: var(--icon-tsx); }
.icon-html { color: var(--icon-html); }
.icon-js   { color: var(--icon-js); }
.icon-json { color: var(--icon-json); }
.icon-ts   { color: var(--icon-ts); }
.icon-css  { color: var(--icon-css); }
.icon-md   { color: var(--icon-md); }

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.tabbar {
  display: flex;
  height: var(--tabbar-height);
  background-color: var(--bg-tab-inactive);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1 1 auto;
  min-width: 0;
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 100%;
  font-size: 13px;
  color: var(--text-dim);
  background-color: var(--bg-tab-inactive);
  border-right: 1px solid var(--border-tab);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--text-bright);
  background-color: var(--bg-tab-active);
}

.tab.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background-color: var(--accent-cyan);
}

.tab__close {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1;
  border-radius: 0;
  padding: 0 3px;
}

.tab__close:hover {
  background-color: #ffffff22;
  color: var(--text-bright);
}

.content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 40px clamp(24px, 6vw, 80px);
  background-color: var(--bg-main);
}

.statusbar {
  height: var(--statusbar-height);
  background-color: var(--bg-statusbar);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 12px;
  user-select: none;
}

.statusbar__left,
.statusbar__right {
  display: flex;
  align-items: center;
  height: 100%;
}

.statusbar__item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  height: 100%;
  white-space: nowrap;
}

.statusbar__left .statusbar__item:hover,
.statusbar__right .statusbar__item:hover {
  background-color: #ffffff2b;
}

.statusbar__icon {
  font-size: 13px;
}

.statusbar__name {
  font-weight: 500;
}

.home__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 10vw, 6rem);
  line-height: 0.95;
  margin: 12px 0 20px;
}
.home__name-line { display: block; }
.home__name-line--white   { color: var(--text-bright); }
.home__name-line--magenta { color: var(--accent-magenta); }

.home__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.home__typewriter {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--accent-cyan);
  min-height: 1.6em;
  margin-bottom: 20px;
}
.home__typewriter-text { color: var(--accent-cyan); }
.home__cursor {
  display: inline-block;
  color: var(--accent-magenta);
  font-weight: 700;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

.home__bio {
  max-width: 64ch;
  color: var(--text);
  margin-bottom: 28px;
}

.home__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

.home__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background-color: var(--border);
  border: 1px solid var(--border);
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 32px;
  max-width: 720px;
}
.home__stat {
  background-color: var(--bg-sidebar);
  padding: 18px 16px;
  text-align: center;
}
.home__stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--accent-cyan);
  line-height: 1;
}
.home__stat-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-top: 8px;
}

.home__socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

@media (max-width: 620px) {
  .home__stats { grid-template-columns: repeat(2, 1fr); }
}

.about__subtitle {
  margin: 6px 0 24px;
}

.about__bio {
  max-width: 70ch;
  margin-bottom: 36px;
}
.about__bio p {
  color: var(--text);
  line-height: 1.7;
}

.about__heading {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent-cyan);
  margin: 8px 0 16px;
}

.about__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 36px;
  max-width: 860px;
}
.about__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 0;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.about__item:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}
.about__item-icon {
  font-size: 1.2rem;
  line-height: 1.4;
  flex: 0 0 auto;
}

.experience__subtitle {
  margin: 6px 0 32px;
}

.timeline {
  position: relative;
  max-width: 720px;
  padding-left: 28px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background-color: var(--border);
}

.timeline__entry {
  position: relative;
  margin-bottom: 22px;
}
.timeline__entry:last-child {
  margin-bottom: 0;
}

.timeline__dot {
  position: absolute;
  left: -28px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--bg-statusbar);
  border: 2px solid var(--bg-main);
  box-shadow: 0 0 0 3px #007acc44;
}

.timeline__card {
  transition: border-color 0.2s ease, transform 0.2s ease,
    box-shadow 0.2s ease;
}
.timeline__entry:hover .timeline__card {
  border-color: var(--accent-cyan);
  transform: translateX(4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.timeline__entry:hover .timeline__dot {
  background-color: var(--accent-cyan);
  box-shadow: 0 0 0 4px #4fc3f733;
}

.timeline__period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-green);
  margin-bottom: 6px;
}
.timeline__role {
  color: var(--text-bright);
  margin-bottom: 10px;
}
.timeline__desc {
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 12px;
}
.timeline__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 620px) {
  .about__grid { grid-template-columns: 1fr; }
}

.projects__subtitle {
  margin: 6px 0 28px;
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 920px;
}

.project-card {
  display: flex;
  flex-direction: column;
}
.project-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.project-card__icon {
  font-size: 1.8rem;
  line-height: 1;
}
.project-card__cats {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--accent-magenta);
  margin-bottom: 8px;
}
.project-card__name {
  color: var(--text-bright);
  margin-bottom: 8px;
}
.project-card__desc {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 14px;
  flex: 1 1 auto;
}
.card__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}
.project-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.project-card__link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 5px 10px;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.project-card__link:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  text-decoration: none;
}

.skills__subtitle {
  margin: 6px 0 28px;
}

.skills__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 40px;
  max-width: 920px;
}

.skills__title {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent-cyan);
  margin-bottom: 16px;
}

.skill {
  margin-bottom: 16px;
}
.skill__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.skill__label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
}
.skill__pct {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}
.skill__track {
  height: 8px;
  background-color: #2d2d2d;
  border-radius: 0;
  overflow: hidden;
}
.skill__fill {
  height: 100%;
  border-radius: 0;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.skill__fill--cyan   { background-color: var(--accent-cyan); }
.skill__fill--green  { background-color: var(--accent-green); }
.skill__fill--orange { background-color: #e0913a; }
.skill__fill--purple { background-color: #b48ead; }

@media (max-width: 640px) {
  .projects__grid,
  .skills__grid {
    grid-template-columns: 1fr;
  }
}

.contact__subtitle {
  margin: 6px 0 32px;
}

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 920px;
}

.contact__heading {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent-cyan);
  margin-bottom: 18px;
}

.social-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.social-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--text);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.social-link:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-2px);
  text-decoration: none;
}
.social-link__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  line-height: 1;
  flex: 0 0 auto;
  color: var(--accent-cyan);
}
.social-link:hover .social-link__icon {
  color: var(--accent-cyan);
}
.social-link__icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.social-link--compact {
  padding: 8px 12px;
}
.social-link--compact .social-link__url {
  display: none;
}
.social-link__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.social-link__label {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-bright);
}
.social-link:hover .social-link__label {
  color: var(--accent-cyan);
}
.social-link__url {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contact-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contact-form__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.contact-form__submit svg {
  flex: 0 0 auto;
}
.contact-form__label {
  font-size: 0.82rem;
}
.contact-form__label .req {
  color: var(--accent-magenta);
}
.contact-form input,
.contact-form textarea {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text);
  background-color: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 10px 12px;
  resize: vertical;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #6a6a6a;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px #4fc3f725;
}
.contact-form__submit {
  width: 100%;
  justify-content: center;
  font-weight: 700;
}
.contact-form__status {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  min-height: 1.2em;
  color: var(--text-dim);
}
.contact-form__status.is-success { color: var(--accent-green); }
.contact-form__status.is-error   { color: var(--accent-magenta); }
.contact-form__note {
  font-size: 0.78rem;
  color: var(--text-dim);
}

@media (max-width: 720px) {
  .contact__grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .editor:not(.sidebar-collapsed) {
    grid-template-columns: var(--sidebar-width) 1fr;
  }
}
