/* Account page: the homepage's washi, sumi and vermilion, with the hero's foxfire kindle on the card's mark. */
:root { color-scheme: light; }
body { background: var(--washi); }

.account-main {
  max-width: 1120px; margin: 0 auto; padding: 88px 28px 96px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 27rem);
  grid-template-areas: "intro card" "details card"; column-gap: 72px; row-gap: 40px; align-items: start;
}
.account-intro { grid-area: intro; position: relative; isolation: isolate; }
.account-card { grid-area: card; }
.account-details { grid-area: details; }
.account-main p { margin: 0 0 16px; }
.account-main a { color: var(--vermilion-ink); text-underline-offset: 4px; }
.account-main a:hover { color: var(--vermilion-ink-hover); }

/* Heading */
.account-main .eyebrow { color: var(--vermilion-ink); font-size: .8rem; letter-spacing: .12em; font-weight: 700; margin-bottom: 0; }
.account-intro h1 {
  font-family: var(--font-display); font-weight: 650; font-size: clamp(2.3rem, 5.4vw, 3.75rem);
  line-height: 1.06; letter-spacing: -.035em; margin: 16px 0 20px; text-wrap: balance; max-width: 12ch;
}
.account-lede { font-size: 1.125rem; line-height: 1.6; color: var(--muted); max-width: 34rem; }

/* The mask, traced in vermilion line behind the heading: foxfire tracing what was hidden. */
.account-trace {
  position: absolute; z-index: -1; right: -8px; top: -40px; width: min(300px, 46%); height: auto;
  fill: none; stroke: var(--vermilion); stroke-width: .9; stroke-linejoin: round; stroke-linecap: round; opacity: .2;
}
.account-trace path { stroke-dasharray: 1; stroke-dashoffset: 0; animation: account-trace 2.6s var(--ease) .2s both; }
.account-trace path:nth-child(2) { animation-delay: 1.1s; }
.account-trace path:nth-child(3) { animation-delay: 1.3s; }
.account-trace path:nth-child(4) { animation-delay: 1.5s; }
@keyframes account-trace { from { stroke-dashoffset: 1; } }

/* Entrance: each block rises in turn. */
.reveal { animation: account-rise .4s var(--ease) both; }
.account-intro .reveal:nth-of-type(2) { animation-delay: .04s; }
.account-intro .reveal:nth-of-type(3) { animation-delay: .08s; }
.account-card.reveal { animation-delay: .04s; }
.perk:nth-child(2) { animation-delay: .04s; } .perk:nth-child(3) { animation-delay: .08s; } .perk:nth-child(4) { animation-delay: .12s; }
.account-steps li:nth-child(1) { animation-delay: .16s; } .account-steps li:nth-child(2) { animation-delay: .2s; }
.account-steps li:nth-child(3) { animation-delay: .24s; }
.account-details > p.reveal { animation-delay: .28s; }
@keyframes account-rise { from { opacity: 0; transform: translateY(14px); } }

/* Card: a night header with the kindling mask over a light form body. */
.account-main .card {
  background: var(--card); border-radius: 18px; min-width: 0; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(28, 26, 23, .04), 0 24px 48px -24px rgba(28, 26, 23, .22);
}
.account-card-head {
  display: flex; align-items: center; gap: 14px; padding: 18px 22px;
  background: var(--night); color: var(--ink-dark);
}
.account-card-heading { flex: 1; min-width: 0; }
.account-card-title { margin: 0 !important; font-weight: 650; font-size: 1rem; letter-spacing: -.01em; }
.account-card-sub { margin: 2px 0 0 !important; font-size: .78rem; color: var(--muted-dark); }
#identity:empty { display: none; }
.account-mark {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px;
  background: var(--night-2); box-shadow: inset 0 0 0 1px rgba(241, 236, 228, .08);
  animation: account-pop .4s var(--ease) .1s both;
}
.account-mark svg { width: 30px; height: 30px; overflow: visible; }
.am-body { fill: var(--ink-dark); stroke: var(--ink-dark); stroke-width: 3; stroke-linejoin: round; }
.am-eye, .am-brow { fill: #3A3542; }
.am-brow { transform-box: fill-box; transform-origin: 50% 100%; animation: account-kindle .9s var(--ease) .35s both; }
.am-eye { animation: account-ignite 1.1s var(--ease) .7s both; }
@keyframes account-pop { from { opacity: 0; transform: scale(.85); } }
@keyframes account-kindle {
  0% { fill: #3A3542; transform: scaleY(.3); filter: none; }
  45% { fill: #FFB088; transform: scaleY(1.08); filter: drop-shadow(0 0 6px rgba(255, 122, 69, .9)); }
  100% { fill: var(--foxfire); transform: none; filter: drop-shadow(0 0 3px rgba(255, 122, 69, .55)); }
}
@keyframes account-ignite {
  0% { fill: #3A3542; filter: none; }
  40% { fill: #FFB088; filter: drop-shadow(0 0 6px rgba(255, 122, 69, .9)); }
  100% { fill: var(--foxfire); filter: drop-shadow(0 0 3px rgba(255, 122, 69, .55)); }
}
.account-card-body { padding: 24px 22px 22px; }
.account-card-body h2 { font-size: 1.125rem; font-weight: 650; letter-spacing: -.01em; margin: 0 0 14px; }

/* Status line: a breathing foxfire dot while work is pending. */
#message { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .95rem; overflow-wrap: anywhere; }
#message:empty { display: none; }
#message[data-state="error"]:not(:empty) {
  padding: 12px 14px; border-radius: var(--control-radius);
  background: var(--washi); color: var(--sumi); border-inline-start: 3px solid var(--vermilion);
}
#message[data-busy="1"]::before {
  content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--vermilion);
  animation: account-breathe 1.4s ease-in-out infinite;
}
@keyframes account-breathe { 50% { opacity: .3; transform: scale(.75); } }

#signin { overflow-wrap: anywhere; animation: account-fade .5s var(--ease) both; }
#signin:empty { display: none; }
#signin .cl-rootBox, #signin .cl-cardBox, #signin .cl-card { width: 100%; max-width: 100%; min-width: 0; }
#signin .cl-cardBox { box-shadow: none; }
#signin input:focus { box-shadow: none; }
#signin input:focus-visible { outline: 3px solid var(--vermilion-ink); outline-offset: 3px; }
#billing:not([hidden]), #activation-panel:not([hidden]) { animation: account-fade .2s var(--ease) both; }
@keyframes account-fade { from { opacity: 0; } }

/* Plans */
#plans { display: grid; gap: 10px; margin-bottom: 18px; }
#plans > p {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 14px 16px;
  border-radius: 12px; background: var(--washi); box-shadow: inset 0 0 0 1px var(--line); font-weight: 550; overflow-wrap: anywhere;
}
#plans > p[data-status]::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
#plans > p[data-status="active"]::before, #plans > p[data-status="trialing"]::before { background: var(--vermilion); box-shadow: 0 0 0 4px rgba(210, 63, 26, .14); }

/* Buttons */
.account-main :where(#copy, #manage, #replay, #plans > button), #tour button {
  background: var(--vermilion); color: #fff; border: 0; border-radius: var(--control-radius); padding: 14px 20px; min-height: var(--action-height);
  font: 600 1rem/1.3 var(--font); cursor: pointer; max-width: 100%;
  transition: background-color .15s var(--ease), transform .12s var(--ease), box-shadow .15s var(--ease);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
#manage, #plans > button { width: 100%; }
.account-main :where(#copy, #manage, #replay, #plans > button):active, #tour button:active { transform: scale(.97); }
.account-main :where(#copy, #manage, #replay, #plans > button):disabled { opacity: .6; cursor: wait; }
@media (hover: hover) {
  .account-main :where(#copy, #manage, #replay, #plans > button):hover, #tour button:hover { background: var(--vermilion-hover); }
  #manage:hover, .account-main .secondary:hover { background: var(--frame); }
}
#manage, .account-main .secondary { background: transparent; color: var(--vermilion-ink); box-shadow: inset 0 0 0 1px var(--line); }
.account-main .link-button { background: none; color: var(--vermilion-ink); padding: 0; min-height: 44px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
@media (hover: hover) { .account-main .link-button:hover { background: none; color: var(--vermilion-ink-hover); } }
.account-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; margin: 0 !important; }
.account-note { font-size: .875rem; color: var(--muted); margin-top: 10px !important; }

/* Activation code */
#activation-panel { margin: 0 0 18px; padding: 16px; border-radius: 12px; background: var(--washi); box-shadow: inset 0 0 0 1px var(--line); }
#activation-panel label { display: block; font-weight: 650; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.account-main textarea {
  display: block; width: 100%; max-width: 100%; box-sizing: border-box; overflow-wrap: anywhere; resize: vertical;
  font: 13px/1.5 var(--mono); color: var(--sumi); background: var(--card); border: 1px solid rgba(28, 26, 23, .3);
  border-radius: 8px; padding: 10px 12px;
}
.activation-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
#copy-status { font-size: .875rem; color: var(--muted); }

.account-privacy { font-size: .82rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 18px; margin: 22px 0 0 !important; }

/* Perks */
.perks { list-style: none; margin: 0 0 40px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.perk {
  display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 14px; background: var(--card);
  box-shadow: 0 0 0 1px var(--line);
}
.perk-value { font: 700 2.25rem/1 var(--font-display); letter-spacing: -.03em; color: var(--sumi); font-variant-numeric: tabular-nums; }
.perk-icon { width: 36px; height: 36px; fill: none; stroke: var(--vermilion-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.perk-label { color: var(--muted); font-size: .95rem; }

/* Steps */
.account-steps { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 0; }
.account-steps li { display: flex; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); line-height: 1.55; }
.account-steps li:last-child { border-bottom: 1px solid var(--line); }
.step-index { flex: none; color: var(--vermilion-ink); font: 600 .75rem/1.9 var(--mono); }
.account-fineprint { color: var(--muted); font-size: .9rem; }
.account-recovery { margin-top: 16px !important; padding-top: 16px; border-top: 1px solid var(--line); font-size: .875rem; }
.account-recover { font-weight: 600; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; min-height: 44px; }
.account-recover span { transition: transform .2s var(--ease); }
.account-recover:hover { text-decoration: underline; }
@media (hover: hover) and (pointer: fine) { .account-recover:hover span { transform: translateX(4px); } }

:focus-visible { outline: 3px solid var(--vermilion-ink); outline-offset: 4px; }

/* Guide */
#tour {
  background: var(--card); border: 0; border-radius: 16px; padding: 28px; color: var(--sumi);
  max-width: min(520px, calc(100% - 32px)); box-shadow: 0 0 0 1px var(--line), 0 30px 60px -20px rgba(20, 18, 26, .5);
}
#tour[open] { animation: account-dialog .35s var(--ease) both; }
#tour::backdrop { background: rgba(20, 18, 26, .55); }
#tour[open]::backdrop { animation: account-fade .3s var(--ease) both; }
#tour h2 { margin: 0 0 12px; font-size: 1.25rem; letter-spacing: -.01em; }
#tour p { margin: 0 0 20px; line-height: 1.6; }
.tour-kicker { color: var(--vermilion-ink); font: 600 .75rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px !important; }
@keyframes account-dialog { from { opacity: 0; transform: translateY(10px) scale(.97); } }

@media (max-width: 860px) {
  .account-main { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "card" "details"; padding: 40px 16px 64px; row-gap: 32px; }
  .account-intro h1 { max-width: none; }
  .account-trace { width: 160px; top: -24px; right: -4px; opacity: .16; }
}
@media (max-width: 480px) {
  .account-main { row-gap: 24px; }
  .account-intro h1 { margin: 12px 0; }
  .account-main .account-lede { margin-bottom: 0; }
  .account-card-head { padding: 16px; }
  .account-card-body { padding: 20px 16px 18px; }
  .account-card-sub { font-size: .74rem; }
  .perk { padding: 16px; }
  .perk-value { font-size: 1.9rem; }
  #tour { padding: 22px; }
  #tour button { width: 100%; }
}
/* Reduced motion keeps fades and colour, removes movement. */
@media (prefers-reduced-motion: reduce) {
  .reveal, #billing:not([hidden]), #activation-panel:not([hidden]), #tour[open], .account-mark { animation-name: account-fade; }
  .account-trace path { animation: none; }
  .am-brow, .am-eye { animation: none; fill: var(--foxfire); }
  #message[data-busy="1"]::before { animation: none; }
  .account-recover span, .account-main :where(#copy, #manage, #replay, #plans > button), #tour button { transition: none; }
  .account-recover:hover span { transform: none; }
  .account-main :where(#copy, #manage, #replay, #plans > button):active, #tour button:active { transform: none; }
}
