:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-strong: #eef4f8;
  --ink: #13202f;
  --muted: #66758a;
  --line: #d7e1ea;
  --gold: #f6c45c;
  --accent: #176b87;
  --accent-strong: #0d4f67;
  --shadow: 0 18px 50px rgba(30, 45, 62, 0.13);
  --radius: 8px;
  font-family: Inter, Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(23, 107, 135, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(222, 103, 77, 0.11), transparent 34%),
    var(--bg);
}

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

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

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  padding: 12px 16px;
  border: 1px solid rgba(215, 225, 234, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(36, 51, 68, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand > span:last-child {
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: var(--radius);
  color: var(--gold);
  background: #13202f;
  box-shadow:
    inset 0 0 0 1px rgba(246, 196, 92, 0.38),
    0 10px 22px rgba(19, 32, 47, 0.14);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: clamp(1rem, 2vw, 1.12rem);
  line-height: 1.1;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.topnav a,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
}

.external-link [data-open-label] {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.external-link-arrow {
  flex: 0 0 auto;
  line-height: 1;
  transform: translateY(-1px);
}

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

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--ink);
  background: var(--surface-strong);
  outline: none;
}

.topnav-action,
.button.primary {
  color: #fff !important;
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(23, 107, 135, 0.22);
}

.topnav a.topnav-action:hover,
.topnav a.topnav-action:focus-visible,
.button.primary:hover,
.button.primary:focus-visible {
  color: #fff !important;
  border-color: color-mix(in srgb, var(--accent) 74%, #fff);
  background: color-mix(in srgb, var(--accent) 88%, #13202f);
  box-shadow: 0 14px 28px color-mix(in srgb, var(--accent) 26%, rgba(23, 107, 135, 0.18));
  outline: none;
}

.topnav a.topnav-action:focus-visible,
.button.primary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 34%, #ffffff);
  outline-offset: 2px;
}

.button.secondary {
  color: var(--accent-strong);
  border-color: var(--line);
  background: #fff;
}

.dashboard {
  display: grid;
  gap: 20px;
  padding: 20px 0 0;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  align-items: center;
  gap: 32px;
  padding: 30px 4px 18px;
}

.intro-copy {
  min-width: 0;
}

.intro-portrait {
  position: relative;
  width: min(100%, 420px);
  margin: 0 0 0 auto;
  aspect-ratio: 1;
  border-radius: 50%;
}

.intro-portrait::before {
  content: "";
  position: absolute;
  inset: 12px -10px -10px 12px;
  z-index: 0;
  border: 1px solid color-mix(in srgb, var(--gold) 56%, #fff);
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(246, 196, 92, 0.34), rgba(23, 107, 135, 0.1));
}

.intro-portrait img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  box-shadow: 0 22px 54px rgba(30, 45, 62, 0.18);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 16px;
  font-size: clamp(2.35rem, 5vw, 4.6rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.14;
  letter-spacing: 0;
}

.lead {
  max-width: 700px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.28rem);
  line-height: 1.55;
}

.intro-secondary {
  max-width: 640px;
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(0.98rem, 1.7vw, 1.08rem);
  font-weight: 800;
  line-height: 1.55;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.project-panel,
.preview-panel {
  min-width: 0;
}

.project-panel {
  position: sticky;
  top: 102px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  height: calc(100vh - 122px);
  height: calc(100dvh - 122px);
  max-height: calc(100vh - 122px);
  min-height: 0;
}

.panel-heading {
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
}

.panel-heading .eyebrow {
  margin-bottom: 0;
}

.project-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.project-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  width: 100%;
  min-height: 136px;
  padding: 16px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: none;
  cursor: pointer;
}

.project-card-body {
  display: grid;
  gap: 8px;
  min-width: 0;
  pointer-events: none;
}

.project-card:hover,
.project-card:focus-visible {
  border-color: color-mix(in srgb, var(--card-accent) 58%, var(--line));
  box-shadow: 0 12px 28px rgba(36, 51, 68, 0.1);
  outline: none;
}

.project-card.is-active {
  border-color: color-mix(in srgb, var(--card-accent) 76%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--card-accent) 14%, #fff), #fff 44%);
}

.project-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--card-accent);
  font-weight: 900;
}

.project-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.18;
}

.project-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}

.project-meta span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 30px;
  padding: 0 11px;
  color: color-mix(in srgb, var(--card-accent) 72%, #13202f);
  border: 1px solid color-mix(in srgb, var(--card-accent) 46%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--card-accent) 14%, #fff);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-toolbar [data-active-category] {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 30px;
  margin: 0 0 10px;
  padding: 0 11px;
  color: color-mix(in srgb, var(--accent) 72%, #13202f);
  border: 1px solid color-mix(in srgb, var(--accent) 46%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, #fff);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-toolbar [data-active-title],
.browser-bar [data-browser-title],
.panel-heading {
  cursor: default;
  user-select: none;
}

.preview-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.browser-frame {
  background: #17202d;
}

.preview-viewport {
  position: relative;
  background: #fff;
}

.browser-bar {
  display: grid;
  grid-template-columns: 10px 10px 10px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  color: #9fb0c2;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.browser-bar span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #f87171;
}

.browser-bar span:nth-child(2) {
  background: #fbbf24;
}

.browser-bar span:nth-child(3) {
  background: #34d399;
}

.browser-bar div {
  min-width: 0;
  padding-left: 8px;
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

iframe {
  display: block;
  width: 100%;
  height: min(760px, calc(100vh - 228px));
  min-height: 560px;
  border: 0;
  background: #fff;
}

.preview-lock {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(19, 32, 47, 0.52);
  backdrop-filter: blur(7px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.preview-lock[hidden] {
  display: none;
}

.preview-lock.is-active {
  opacity: 1;
  pointer-events: auto;
}

.preview-lock-action {
  min-height: 52px;
  max-width: min(100%, 360px);
  padding: 0 20px;
  box-shadow: 0 18px 38px rgba(8, 18, 31, 0.28);
}

@media (max-width: 1080px) {
  .intro,
  .workspace {
    grid-template-columns: 1fr;
  }

  .intro-portrait {
    width: min(100%, 360px);
    margin: 0;
  }

  .project-panel {
    position: static;
    height: auto;
    max-height: none;
  }

  .project-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    padding-right: 0;
  }

  iframe {
    height: 680px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
  }

  .topbar,
  .preview-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .preview-toolbar {
    display: none;
  }

  .topnav,
  .preview-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .topnav a,
  .button {
    flex: 1 1 auto;
  }

  .topnav-action [data-open-label] {
    max-width: 100%;
  }

  .intro {
    padding-top: 22px;
    gap: 22px;
  }

  .intro-portrait {
    width: min(100%, 320px);
  }

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

  .project-list .preview-panel {
    grid-column: 1 / -1;
  }

  .preview-panel {
    margin: 2px 0 8px;
  }

  .project-card {
    min-height: 132px;
  }

  iframe {
    min-height: 560px;
    height: 70vh;
  }

  .preview-lock {
    padding: 18px;
  }
}

@media (max-width: 460px) {
  .brand small,
  .topnav a:not(.topnav-action) {
    display: none;
  }

  h1 {
    font-size: clamp(2.1rem, 13vw, 3.1rem);
  }

  .intro-portrait {
    width: 100%;
  }

  .project-card {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .project-icon {
    width: 38px;
    height: 38px;
  }
}
