@font-face { font-family: Inter; src: url("./inter-latin-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url("./inter-latin-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: Inter; src: url("./inter-latin-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  color: #f0f8f5;
  background: #090f11;
  font-synthesis: none;
  --surface: #111a1e;
  --layer: #152329;
  --edge: #253a40;
  --muted: #a1b5b9;
  --accent: #9cf1d4;
  --danger: #ffc2b8;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
h1, h2, h3, p, ul { margin: 0; }
h1, h2, h3 { line-height: 1.12; }
p { line-height: 1.55; }
.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 10;
  transform: translateY(-160%);
  padding: .65rem .95rem;
  background: var(--accent);
  color: #0b2019;
}
.skip-link:focus { transform: none; }

.topbar { border-bottom: 1px solid #26363a; background: #0b1316; }
.topbar-inner, .workspace { max-width: 78rem; margin-inline: auto; }
.topbar-inner {
  min-height: 4.2rem;
  padding: .75rem clamp(1rem, 4vw, 2rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .65rem 1.4rem;
  flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; letter-spacing: -.03em; text-decoration: none; }
.brand img { border-radius: 8px; }
.brand-muted { color: var(--muted); font-weight: 400; padding-left: .2rem; letter-spacing: 0; }
.account { display: flex; gap: .45rem 1rem; align-items: center; flex-wrap: wrap; font-size: .84rem; min-width: 0; color: var(--muted); }
.account button { border: 0; padding: .3rem 0; cursor: pointer; background: transparent; color: var(--muted); }
.account a, .account button { text-decoration: none; }
.account a:hover, .account button:hover { color: var(--accent); }
.account .studio-link { color: var(--accent); font-weight: 600; }
.session-email { max-width: 22rem; overflow-wrap: anywhere; }

.workspace { padding: clamp(1rem, 3vw, 2.25rem) clamp(1rem, 4vw, 2rem) 3.75rem; }
.welcome {
  position: relative;
  isolation: isolate;
  padding: clamp(1.35rem, 5.4vw, 4.15rem);
  border-radius: 1.35rem;
  overflow: hidden;
  background: #0d1d21;
  border: 1px solid #2a4648;
}
.welcome::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, #0d1d21 17%, #0d1d21ef 45%, #0d1d2160 74%, #0d1d2133),
    url("./workspace.webp") right 43% / cover no-repeat;
}
.welcome-label { color: var(--accent); font-weight: 700; font-size: .79rem; letter-spacing: .085em; text-transform: uppercase; }
.welcome h1 { margin-top: .56rem; letter-spacing: -.075em; font-size: clamp(2.1rem, 5.8vw, 4.1rem); }
.welcome p:last-child { color: #c3dbd8; max-width: 34rem; margin-top: .9rem; }
.workspace:has(.workspace-layout:not([hidden])) .welcome { padding-block: clamp(1.35rem, 3.1vw, 2.6rem); }
.workspace:has(.workspace-layout:not([hidden])) .welcome h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); }
.account-status { margin-top: 1rem; color: var(--muted); }
.account-status[data-error="true"], .message[data-error="true"] { color: var(--danger); }
.sign-in { margin-top: 1rem; max-width: 34rem; padding: clamp(1.25rem, 4vw, 2.1rem); }
.sign-in p { color: var(--muted); margin-block: .55rem 1rem; }
.sign-in .message { margin: .6rem 0 0; }

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 23rem) minmax(0, 1fr);
  gap: 1.15rem;
  align-items: start;
  margin-top: 1.15rem;
}
.panel { min-width: 0; border: 1px solid var(--edge); border-radius: 1rem; background: var(--surface); }
.project-index { padding: 1rem; }
.index-heading, .section-heading, .configuration, .project-heading { display: flex; gap: .75rem 1rem; align-items: start; justify-content: space-between; flex-wrap: wrap; }
.index-heading { align-items: center; padding: .2rem .15rem .9rem; }
.index-heading h2, .section-heading h2 { font-size: 1.13rem; letter-spacing: -.035em; }
.index-heading p, .section-heading p, .configuration p, .project-meta { margin-top: .35rem; color: var(--muted); font-size: .83rem; }
.project-list, .member-list { padding: 0; list-style: none; }
.project-list { display: grid; gap: .4rem; max-height: 36rem; overflow: auto; padding: .15rem; }
.project-list .list-empty { padding: .6rem .35rem .25rem; color: var(--muted); font-size: .84rem; }
.project-item {
  display: grid;
  grid-template-columns: 2.1rem minmax(0,1fr);
  align-items: center;
  width: 100%;
  gap: .7rem;
  padding: .6rem;
  border: 1px solid transparent;
  border-radius: .7rem;
  text-align: left;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.project-item:hover, .project-item[aria-current="page"] { border-color: #365652; background: #172b2b; }
.project-glyph { display: grid; place-items: center; width: 2.05rem; aspect-ratio: 1; border-radius: .5rem; background: #20413d; color: var(--accent); font-size: .79rem; font-weight: 700; }
.project-name, .project-context { display: block; overflow-wrap: anywhere; }
.project-name { margin-bottom: .25rem; font-size: .9rem; font-weight: 600; }
.project-context { color: var(--muted); font-size: .73rem; }

.overview-panel {
  min-height: 20rem;
  display: grid;
  grid-template-columns: auto minmax(0,25rem);
  justify-content: center;
  align-content: center;
  align-items: center;
  gap: 1.65rem;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background: radial-gradient(ellipse at 7% -10%, #19332f 0%, transparent 60%), var(--surface);
}
.overview-panel h2 { font-size: clamp(1.25rem, 3.5vw, 1.7rem); letter-spacing: -.045em; }
.overview-panel p { color: var(--muted); margin-block: .55rem 1rem; }
.overview-decoration { width: 4.3rem; height: 4.3rem; position: relative; }
.overview-decoration i { position: absolute; border: 1px solid #6ca99b; background: #172a2c; width: 3.3rem; height: 2.75rem; top: .35rem; left: .2rem; border-radius: .55rem; transform: rotate(-12deg); }
.overview-decoration i:nth-child(2) { transform: translate(.36rem, .33rem) rotate(-1deg); background: #234047; }
.overview-decoration i:nth-child(3) { transform: translate(.63rem, .67rem) rotate(10deg); background: #142c30; }
.overview-decoration i:nth-child(3)::after { content: ""; display: block; width: 1.65rem; height: .75rem; border-block: 2px solid #80dac4; margin: .85rem .72rem; }
.project-detail { min-width: 0; display: grid; gap: 1rem; }
.project-heading, .draft-panel, .members-panel { padding: clamp(1rem, 2.9vw, 1.55rem); }
.project-heading { background: linear-gradient(120deg, #16312e, #111a1e 72%); }
.project-heading > div { min-width: 0; }
.project-heading h2 { margin-top: .3rem; font-size: clamp(1.55rem, 3.6vw, 2.35rem); letter-spacing: -.055em; overflow-wrap: anywhere; }
.project-template { color: var(--accent); font-weight: 600; font-size: .8rem; }
.project-links, .configuration-actions, .draft-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.project-meta { margin-top: .55rem; }
.revision { color: #b6e2d8; font-size: .76rem; white-space: nowrap; border: 1px solid #32524c; background: #172a2b; padding: .3rem .5rem; border-radius: .36rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 2.55rem;
  padding: .52rem .8rem;
  border: 1px solid transparent;
  border-radius: .57rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: 600;
  font-size: .83rem;
  text-align: center;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.button.compact { min-height: 2.26rem; padding: .43rem .61rem; font-size: .8rem; }
.button.primary { background: var(--accent); color: #10241e; border-color: #abcfc3; }
.button.primary:hover { background: #c4f8e7; }
.button.quiet { background: #152429; border-color: #365156; color: #e5f4f1; }
.button.quiet:hover { border-color: #77b9ae; color: var(--accent); }
.button:disabled { cursor: default; opacity: .55; }
.close-button { min-height: 2rem; padding: .1rem .6rem; color: var(--muted); font-size: 1.25rem; }
.close-button:hover { color: var(--accent); }

#draft-form, #create-form { display: grid; gap: .65rem; margin-top: 1rem; }
label { font-size: .86rem; font-weight: 600; }
input, select, textarea { width: 100%; min-width: 0; padding: .65rem .75rem; color: inherit; border: 1px solid #365058; border-radius: .55rem; background: #0c1518; outline-offset: 2px; }
textarea { resize: vertical; min-height: 8rem; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: #96adb3; opacity: 1; }
.configuration { border: 1px solid #263c42; border-radius: .7rem; background: #101d21; padding: .8rem; }
.configuration h3 { font-size: .91rem; }
.configuration details { flex: 1 0 100%; min-width: 0; }
.configuration summary { cursor: pointer; color: var(--accent); font-size: .8rem; }
.configuration pre { max-height: 16rem; max-width: 100%; overflow: auto; padding: .65rem; border-radius: .45rem; background: #0b1417; font-size: .76rem; }
.message { color: var(--accent); font-size: .8rem; overflow-wrap: anywhere; }
.message:empty { display: none; }
.member-list { display: grid; gap: .4rem; margin-block: .85rem .95rem; }
.member-list li { display: flex; justify-content: space-between; gap: .5rem; padding: .65rem; border-radius: .45rem; background: #172529; font-size: .82rem; overflow-wrap: anywhere; }
.member-list li span:last-child { color: var(--muted); }
.member-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .55rem; align-items: end; }
.member-form input { margin-top: .4rem; }
.members-panel .message { margin-top: .6rem; }

dialog { width: min(28rem, calc(100% - 2rem)); max-width: 100%; padding: 1.25rem; border: 1px solid #446359; border-radius: 1rem; color: inherit; background: #132026; }
dialog::backdrop { background: #050c0ed9; }
#create-form button { justify-self: start; margin-top: .35rem; }

@media (max-width: 53rem) {
  .workspace-layout { grid-template-columns: minmax(0,1fr); }
  .project-list { grid-template-columns: repeat(auto-fit, minmax(min(12rem,100%),1fr)); max-height: 17rem; }
}
@media (max-width: 35rem) {
  .welcome::before { opacity: .54; }
  .overview-panel { min-height: 13rem; grid-template-columns: minmax(0,1fr); gap: .7rem; }
  .overview-decoration { transform-origin: left bottom; transform: scale(.75); height: 3.5rem; }
  .member-form { grid-template-columns: minmax(0,1fr); }
  .member-form .button { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; }
}
