:root {
  color-scheme: light;
  --paper: #f4f4f0;
  --paper-soft: #fafaf7;
  --ink: #10110f;
  --muted: rgba(16, 17, 15, .55);
  --line: rgba(16, 17, 15, .14);
  --shadow: 0 28px 90px rgba(14, 17, 15, .13);
  font-family: Inter, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, a { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.public-view {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 45% 48%, rgba(202, 219, 207, .88), transparent 29%),
    radial-gradient(circle at 61% 41%, rgba(216, 193, 223, .76), transparent 32%),
    radial-gradient(circle at 48% 30%, rgba(245, 206, 188, .68), transparent 28%),
    #f4f4ef;
}

.pearl-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: -2; }
.paper-noise {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .28;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.topbar {
  position: relative;
  z-index: 3;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 3vw, 48px);
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

.brand-mark svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.7; }
.brand-mark svg circle { fill: currentColor; stroke: none; }
.brand-mark--small { width: 29px; height: 29px; flex: 0 0 auto; }

.login-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .01em;
}

.login-link span { padding: 0 0 4px; border-bottom: 1px solid currentColor; }
.login-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.3; transition: transform .25s ease; }
.login-link:hover svg, .login-link:focus-visible svg { transform: translate(2px, -2px); }

.hero { position: absolute; inset: 0; display: grid; place-items: center; padding: 92px 24px 70px; }
.hero h1 {
  margin: 0;
  color: #0b0c0a;
  font-size: clamp(72px, 12.25vw, 188px);
  line-height: .9;
  font-weight: 400;
  letter-spacing: -.074em;
  white-space: nowrap;
  transform: translateX(-.025em);
  text-rendering: geometricPrecision;
}

.public-footer {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 8px clamp(24px, 3vw, 48px) max(8px, env(safe-area-inset-bottom));
  color: rgba(16, 17, 15, .42);
  font-size: 10px;
  letter-spacing: .17em;
}

.public-footer__meta--end { justify-self: end; }
.site-registration {
  display: grid;
  justify-items: center;
  gap: 2px;
  color: rgba(16, 17, 15, .57);
  font-size: 11px;
  line-height: 1.42;
  letter-spacing: .015em;
  text-align: center;
}
.site-registration a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color .2s ease;
}
.site-registration a:hover,
.site-registration a:focus-visible { color: var(--ink); text-decoration: underline; outline: none; }

.loading {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(16, 17, 15, .12);
  border-radius: 999px;
  background: rgba(250, 250, 247, .74);
  color: rgba(16, 17, 15, .58);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .07);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
  font-size: 11px;
  white-space: nowrap;
  transition: opacity .3s ease, transform .3s ease;
}
.loading > span:first-child { width: 6px; height: 6px; border-radius: 50%; background: #91a39a; animation: breathe 1.2s ease-in-out infinite; }
.loading.is-done { opacity: 0; transform: translate(-50%, 8px); pointer-events: none; }
@keyframes breathe { 50% { opacity: .25; transform: scale(.75); } }

.workspace-view { min-height: 100svh; display: flex; flex-direction: column; background: var(--paper-soft); }
.workspace-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 clamp(24px, 5vw, 76px);
  border-bottom: 1px solid var(--line);
}
.workspace-brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-size: 14px; font-weight: 500; }
.account { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding-block: 12px; }
.account-copy { display: grid; justify-items: end; gap: 2px; }
.account-copy strong { font-size: 13px; font-weight: 550; }
.account-copy span { color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.logout-button { min-height: 38px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer; font-size: 12px; }
.logout-button:hover { background: var(--ink); color: var(--paper); }
.account-link { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; color: inherit; text-decoration: none; font-size: 12px; }
.account-link:hover, .account-link:focus-visible { background: var(--ink); color: var(--paper); }
.account-link[hidden], .account-help[hidden], .password-notice[hidden] { display: none; }
.account-help { max-width: 760px; margin-top: 22px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.account-help summary { width: fit-content; cursor: pointer; color: var(--ink); }
.account-help p { margin: 12px 0 0; }
.password-notice { margin: 16px 0 0; color: var(--muted); font-size: 12px; }

.workspace-content { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: clamp(70px, 10vh, 118px) 0 80px; flex: 1; }
.eyebrow { margin: 0 0 24px; color: var(--muted); font-size: 10px; letter-spacing: .19em; }
.workspace-content > h1 { margin: 0; font-size: clamp(52px, 7vw, 92px); line-height: .94; font-weight: 400; letter-spacing: -.06em; }
.workspace-intro { margin: 19px 0 0; color: var(--muted); font-size: 14px; }

.app-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: clamp(54px, 8vh, 92px); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.app-card {
  min-height: 224px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .3);
  color: inherit;
  text-decoration: none;
  transition: background .25s ease, color .25s ease;
}
.app-card:hover, .app-card:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
.app-card__top { display: flex; justify-content: space-between; align-items: flex-start; }
.app-card__icon { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; opacity: .84; }
.app-card__icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.35; }
.app-card__arrow { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.2; transition: transform .25s ease; }
.app-card:hover .app-card__arrow { transform: translate(3px, -3px); }
.app-card h2 { margin: 0 0 10px; font-size: clamp(22px, 2.2vw, 31px); font-weight: 450; letter-spacing: -.04em; }
.app-card p { margin: 0; color: currentColor; opacity: .56; font-size: 12px; }

.empty-state { margin-top: 72px; padding: 50px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.empty-state p { margin: 0 0 8px; font-size: 18px; }
.empty-state span { color: var(--muted); font-size: 13px; }
.workspace-footer { min-height: 68px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; padding: 8px clamp(24px, 5vw, 76px); border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; letter-spacing: .15em; }
.workspace-footer > :last-child { justify-self: end; text-align: right; }
.site-registration--workspace { color: var(--muted); font-size: 10px; }

.toast { position: fixed; z-index: 30; right: 24px; bottom: 24px; max-width: min(380px, calc(100% - 48px)); padding: 14px 17px; border-radius: 12px; background: #121310; color: #f7f7f2; box-shadow: var(--shadow); font-size: 12px; }

@media (max-width: 760px) {
  .topbar { height: 74px; }
  .hero { padding-bottom: 104px; }
  .hero h1 { width: min-content; max-width: 90vw; white-space: normal; text-align: center; font-size: clamp(76px, 23vw, 118px); line-height: .82; }
  .public-footer { min-height: 82px; grid-template-columns: 1fr; gap: 0; padding-inline: 18px; }
  .public-footer__meta { display: none; }
  .site-registration { font-size: 10px; }
  .workspace-header { min-height: 76px; gap: 12px; padding-inline: 18px; }
  .account { gap: 6px; }
  .account-link, .logout-button { padding-inline: 11px; }
  .workspace-brand > span:last-child { display: none; }
  .account-copy { display: none; }
  .workspace-content { width: calc(100% - 36px); padding-top: 64px; }
  .app-grid { grid-template-columns: 1fr; margin-top: 52px; }
  .app-card { min-height: 190px; padding: 24px; }
  .workspace-footer { grid-template-columns: 1fr; justify-items: center; gap: 8px; padding-top: 14px; padding-bottom: 14px; text-align: center; }
  .workspace-footer > :last-child { justify-self: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

.connection-notice{position:fixed;z-index:25;left:50%;bottom:20px;transform:translateX(-50%);width:max-content;max-width:calc(100% - 32px);display:flex;align-items:center;gap:14px;padding:12px 16px;background:#fff8e6;border:1px solid #c9a64e;border-radius:10px;box-shadow:var(--shadow);font-size:13px}.connection-notice button{flex-shrink:0;border:1px solid currentColor;border-radius:6px;padding:8px 10px;background:transparent;cursor:pointer}
@media(max-width:760px){.account-copy{display:grid;flex-basis:100%;justify-items:end}.account-copy strong{max-width:230px;overflow-wrap:anywhere}.account-copy span{font-size:11px}.account-link,.logout-button{min-height:42px}.workspace-content{width:calc(100% - 36px);padding:28px 0 40px}.workspace-content>h1{font-size:42px}.eyebrow{margin-bottom:12px}.workspace-intro{margin-top:12px}.account-help{margin-top:14px}.app-grid{grid-template-columns:1fr;margin-top:24px}.app-card{min-height:110px;padding:16px 18px;flex-direction:row;align-items:center;gap:14px}.app-card__top{flex:0 0 36px}.app-card__arrow{display:none}.app-card>span:last-child{flex:1;min-width:0}.app-card h2{font-size:22px;margin-bottom:6px}.app-card p{font-size:13px;line-height:1.5}}
