/* Start screen: an editorial workspace in warm paper, dark ink and orange.
   The document preview remains paper-white in both themes. */
#start {
    --start-surface: #F6F2EA;
    --paper-text: var(--text);
    --paper-text-2: var(--text-3);
    --paper-ink: var(--ink);
    --paper-line: var(--line);
    --paper-rule: var(--line-strong);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: min(860px, 100dvh);
    background: var(--start-surface);
    color: var(--text);
    font-family: var(--font-ui);
}
:root[data-theme="dark"] #start {
    --start-surface: var(--surface);
    --paper-text: var(--text-on-ink);
    --paper-text-2: color-mix(in oklab, var(--desk) 58%, var(--paper));
    --paper-ink: var(--text-on-ink);
    --paper-line: color-mix(in oklab, var(--paper) 88%, var(--desk));
    --paper-rule: color-mix(in oklab, var(--paper) 70%, var(--desk));
}
#start *, #start *::before, #start *::after { box-sizing: border-box; }
#start [hidden] { display: none !important; }

/* Brand and navigation */
.start-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    width: calc(100% - clamp(40px, 8vw, 96px));
    max-width: 1184px;
    margin: 0 auto;
    padding: 24px 0;
    border-bottom: 1px solid var(--line);
}
.start-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    text-decoration: none;
    user-select: none;
}
.start-wordmark {
    font: 800 29px/1 var(--font-display);
    letter-spacing: -0.045em;
    white-space: nowrap;
}
.start-wordmark-pdf { font-weight: 400; }
.start-nav { display: flex; align-items: center; gap: 34px; margin-left: auto; }
.start-nav a {
    padding: 6px 0;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-underline-offset: 6px;
}
.start-nav a:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); }
.start-bar-actions { display: flex; align-items: center; gap: 5px; padding-left: 24px; border-left: 1px solid var(--line-strong); }
#start .start-bar-actions .icon-btn { border-radius: 50%; }

/* Headline and file actions */
.start-main {
    flex: 1 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.14fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(32px, 5vw, 70px);
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 62px clamp(20px, 4vw, 48px) 54px;
}
.start-copy { min-width: 0; position: relative; z-index: 1; }
.start-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 26px;
    color: var(--text-2);
    font: 500 10.5px/1.5 var(--font-mono);
    letter-spacing: 0.115em;
    text-transform: uppercase;
}
.start-eyebrow::before {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--accent);
    transform: rotate(-12deg);
    box-shadow: 0 0 0 5px var(--accent-soft);
}
.start-title {
    margin: 0;
    color: var(--text);
    font: 700 clamp(64px, 6.2vw, 84px)/0.99 var(--font-display);
    letter-spacing: -0.057em;
}
.start-title-line { display: block; }
.start-mark { position: relative; display: inline-block; isolation: isolate; white-space: nowrap; }
.start-mark-word { position: relative; }
.start-mark-swipe {
    position: absolute;
    z-index: -1;
    left: -0.055em;
    top: 0.56em;
    width: calc(100% + 0.14em);
    height: 0.37em;
    overflow: visible;
    fill: var(--marker);
    transform: rotate(-1.8deg);
    transform-origin: 0 50%;
    pointer-events: none;
}
.start-mark-streak { mix-blend-mode: multiply; opacity: 0.15; }
:root[data-theme="dark"] .start-mark-swipe { opacity: 0.72; }
:root[data-theme="dark"] .start-mark-streak { opacity: 0; }
.start-sub {
    max-width: 27em;
    margin: 27px 0 28px;
    color: var(--text-2);
    font-size: 18px;
    line-height: 1.6;
    text-wrap: pretty;
}
.start-hint {
    margin: -10px 0 22px;
    padding: 10px 14px;
    border-left: 3px solid var(--accent-line);
    color: var(--text-2);
    background: var(--accent-soft);
}
.start-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 25px; }
#start .start-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 57px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--on-accent);
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -0.01em;
    box-shadow: 0 3px 0 color-mix(in oklab, var(--accent) 76%, var(--ink));
    transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
#start .start-cta:hover { transform: translateY(-2px); box-shadow: 0 5px 0 color-mix(in oklab, var(--accent) 76%, var(--ink)); }
#start .start-cta:active { transform: translateY(1px); box-shadow: 0 1px 0 color-mix(in oklab, var(--accent) 76%, var(--ink)); }
.start-tour { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; font-weight: 500; text-decoration: none; }
.start-tour:hover { text-decoration: underline; text-underline-offset: 5px; }
.start-open-note { margin: 16px 0 27px; color: var(--text-3); font-size: 12px; }
.start-quick-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
#start .start-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 11px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: transparent;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: none;
}
#start .start-secondary svg { width: 15px; height: 15px; }
#start .start-secondary:hover { background: var(--surface); color: var(--text); border-color: var(--ink-line); }
.start-caps { display: flex; flex-wrap: wrap; gap: 12px 21px; margin: 27px 0 0; padding: 0; list-style: none; color: var(--text-3); font-size: 12px; }
.start-caps li { display: inline-flex; align-items: center; gap: 6px; }
.start-caps svg { width: 13px; height: 13px; color: var(--text-2); }

/* An editable-document vignette, also the large file drop target */
.start-stage { display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 18px 0 0; }
.start-sheet-wrap { position: relative; isolation: isolate; width: min(100%, 470px); padding: 24px 45px 28px 27px; }
.start-stage-orbit {
    position: absolute;
    z-index: -3;
    top: 17%;
    left: -7%;
    width: 112%;
    aspect-ratio: 1;
    border: 1px solid color-mix(in oklab, var(--accent) 18%, var(--line));
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, var(--accent-soft) 0 59%, transparent 59.3% 100%);
}
.start-stage-orbit::after {
    content: "";
    position: absolute;
    inset: 15%;
    border: 1px dashed color-mix(in oklab, var(--accent) 24%, var(--line));
    border-radius: 50%;
}
.start-paper-back { position: absolute; z-index: -1; inset: 25px 38px 30px 37px; transform: rotate(7deg); border: 1px solid var(--line); border-radius: 5px; background: var(--surface); box-shadow: var(--shadow-page); }
.start-sheet {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 485px;
    padding: 28px 27px 0;
    border: 1px solid var(--paper-line);
    border-radius: 5px;
    background: var(--paper);
    color: var(--paper-text);
    box-shadow: var(--shadow-page);
    transform: rotate(-5deg);
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
    cursor: pointer;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.start-sheet > * { position: relative; z-index: 1; }
.start-sheet:focus-visible { box-shadow: var(--shadow-page), 0 0 0 3px var(--start-surface), 0 0 0 6px var(--accent-line); }
@media (hover: hover) {
    .start-sheet:hover { transform: translateY(-5px) rotate(-3deg); box-shadow: var(--shadow-pop); }
}
.start-sheet::after { content: ""; position: absolute; inset: 10px; z-index: 0; border: 2px dashed var(--select); border-radius: 5px; background: var(--marker-soft); opacity: 0; transition: opacity var(--dur-fast) var(--ease); pointer-events: none; }
#start.is-dragging .start-sheet { transform: translateY(-10px) rotate(-1deg) scale(1.02); box-shadow: var(--shadow-pop); }
#start.is-dragging .start-sheet::after { opacity: 1; }
.start-document { flex: 1 1 auto; }
.start-doc-meta { display: flex; align-items: center; justify-content: space-between; color: var(--paper-text); font: 500 8px/1 var(--font-mono); letter-spacing: 0.1em; }
.start-doc-symbol { color: var(--accent); font: 600 28px/0.8 var(--font-display); }
.start-doc-kicker { margin-top: 15px; color: var(--paper-text-2); font: 500 7px/1.5 var(--font-mono); letter-spacing: 0.15em; }
.start-doc-heading { position: relative; margin: 8px -6px 0; padding: 4px 5px; border: 1px solid var(--select); color: var(--paper-text); font: 650 clamp(23px, 2.2vw, 30px)/1.05 var(--font-display); letter-spacing: -0.035em; }
.start-select-handle { position: absolute; width: 5px; height: 5px; border: 1px solid var(--select); background: var(--paper); }
.start-select-handle.is-tl { top: -3px; left: -3px; }
.start-select-handle.is-tr { top: -3px; right: -3px; }
.start-select-handle.is-bl { bottom: -3px; left: -3px; }
.start-select-handle.is-br { bottom: -3px; right: -3px; }
.start-doc-copy { margin: 12px 0 16px; color: var(--paper-text-2); font-size: 9px; line-height: 1.6; }
.start-doc-rule { height: 1px; background: var(--paper-line); }
.start-doc-row { display: flex; justify-content: space-between; gap: 8px; margin: 10px 0; color: var(--paper-text-2); font: 500 6px/1.3 var(--font-mono); letter-spacing: 0.05em; }
.start-sheet-lines { display: flex; flex-direction: column; gap: 6px; }
.start-line { display: block; height: 4px; border-radius: 2px; background: var(--paper-line); }
.start-line:nth-child(2) { width: 90%; }
.start-line.is-short { width: 61%; }
.start-sign { flex: none; height: 83px; margin: 10px 0 18px; }
.start-sign-x { position: absolute; left: 0; bottom: 17px; color: var(--select); font: 600 19px/1 var(--font-ui); }
.start-sign-rule { position: absolute; left: 8%; right: 0; bottom: 22px; height: 1px; background: var(--paper-rule); }
.start-sign-ink { position: absolute; left: 10%; bottom: 22px; width: 73%; height: auto; aspect-ratio: 252 / 96; overflow: visible; fill: var(--paper-ink); transform: translateY(12.5%); pointer-events: none; }
.start-sign-caption { position: absolute; left: 8%; bottom: 2px; color: var(--paper-text-2); font: 400 6px/1 var(--font-mono); letter-spacing: 0.025em; text-transform: uppercase; }
.start-sheet-drop { display: flex; flex: none; align-items: center; gap: 10px; margin: 0 -27px; padding: 15px 20px; border-top: 1px dashed var(--paper-rule); border-radius: 0 0 5px 5px; background: color-mix(in oklab, var(--paper) 95%, var(--accent)); }
.start-sheet-drop > svg { margin-left: auto; color: var(--paper-text); }
.start-sheet-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--accent); color: var(--on-accent); }
.start-sheet-title { margin: 0; color: var(--paper-text); font: 600 12px/1.4 var(--font-ui); }
.start-sheet-hint { margin: 2px 0 0; color: var(--paper-text-2); font-size: 9px; }
.start-preview-toolbar { position: absolute; z-index: 3; top: 1px; left: 20px; display: flex; gap: 3px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-pop); transform: rotate(-2deg); pointer-events: none; }
.start-preview-toolbar span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 6px; }
.start-preview-toolbar .is-active { color: var(--on-accent); background: var(--accent); }
.start-edit-label { position: absolute; top: 39%; right: -8px; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; color: var(--select); pointer-events: none; }
.start-edit-label > svg { transform: rotate(-24deg); fill: var(--accent); stroke: var(--on-accent); }
.start-edit-label > span { margin-left: 15px; padding: 7px 11px; border-radius: 0 6px 6px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 600; }
.start-signed-label { position: absolute; z-index: 2; right: -4px; bottom: 84px; display: flex; align-items: center; gap: 10px; padding: 14px 17px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); transform: rotate(3deg); pointer-events: none; }
.start-signed-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.start-signed-label strong { display: block; font: 650 13px/1.4 var(--font-display); }
.start-signed-label > span > span { display: block; color: var(--text-3); font-size: 9px; margin-top: 2px; }
.start-private { display: inline-flex; align-items: center; gap: 7px; margin: 21px 0 0; color: var(--text-3); font-size: 11px; text-decoration: none; }
.start-private:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.start-private svg { color: var(--text-2); flex: none; }

/* Recent documents */
.start-recent { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px) 36px; }
.start-recent-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; padding-top: 28px; border-top: 1px solid var(--line); }
.start-recent-head h2 { margin: 0; color: var(--text); font: 600 17px/1.3 var(--font-display); }
.start-recent-note { margin: 0; color: var(--text-3); font: 10px/1.3 var(--font-mono); }
.start-recent-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 24px 18px; margin: 0; padding: 0; list-style: none; }
.start-card { position: relative; min-width: 0; }
.start-card-open { display: flex; flex-direction: column; width: 100%; padding: 0; border: 0; border-radius: var(--radius-s); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.start-card-open:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.start-card-thumb { display: grid; place-items: center; width: 100%; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--radius-s); background: var(--paper); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.start-card-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.start-card-blank { display: inline-flex; color: var(--paper-rule); }
@media (hover: hover) { .start-card-open:hover .start-card-thumb { transform: translateY(-2px); box-shadow: var(--shadow-page); } }
.start-card-name { max-width: 100%; margin-top: 10px; overflow: hidden; color: var(--text); font-size: 13.5px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.start-card-meta { max-width: 100%; margin-top: 3px; overflow: hidden; color: var(--text-3); font: 11px/1.4 var(--font-mono); white-space: nowrap; text-overflow: ellipsis; }
#start .start-card-remove { position: absolute; top: 6px; right: 6px; background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-1); opacity: 0; transition: opacity var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
#start .start-card-remove:hover { background: var(--red-soft); color: var(--red); }
.start-card:hover .start-card-remove, .start-card:focus-within .start-card-remove { opacity: 1; }
@media (hover: none) { #start .start-card-remove { opacity: 1; } }

/* Small utility footer; the full site footer lives beneath the home content. */
.start-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; width: calc(100% - clamp(40px, 8vw, 96px)); max-width: 1184px; margin: 0 auto; padding: 15px 0 18px; border-top: 1px solid var(--line); }
#start .start-foot-link { margin-left: -10px; color: var(--text-3); font-size: 11px; }
.start-foot-note { margin: 0; color: var(--text-3); font-size: 11px; }
.start-foot-rev { margin: 0; color: var(--text-3); font: 9px/1.5 var(--font-mono); }

/* One entrance, then only deliberate hover feedback. */
@media (prefers-reduced-motion: no-preference) {
    #start.is-intro .start-copy { animation: start-copy-in 650ms var(--ease) 40ms backwards; }
    #start.is-intro .start-sheet-wrap { animation: start-sheet-in 850ms var(--ease) 100ms backwards; }
    #start.is-intro .start-mark-swipe { animation: start-swipe 560ms var(--ease) 440ms backwards; }
}
@keyframes start-copy-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes start-sheet-in { from { opacity: 0; transform: translateY(25px) rotate(-3deg); } to { opacity: 1; transform: none; } }
@keyframes start-swipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@media (prefers-reduced-motion: reduce) { #start *, #start *::before, #start *::after { animation: none !important; transition: none !important; } }

/* Keep the preview generous without crowding the file actions. */
@media (max-width: 1099.98px) and (min-width: 800px) {
    .start-main { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 25px; }
    .start-title { font-size: clamp(58px, 6.5vw, 71px); }
    .start-sub { font-size: 16px; }
    .start-sheet-wrap { padding-left: 10px; padding-right: 27px; }
    .start-sheet { padding: 24px 21px 0; }
    .start-sheet-drop { margin: 0 -21px; padding: 13px 15px; }
    .start-doc-heading { font-size: 25px; }
    .start-preview-toolbar { left: 1px; }
    .start-preview-toolbar span { width: 32px; height: 32px; }
    .start-edit-label { right: -4px; }
    .start-signed-label { right: -6px; padding: 11px 12px; bottom: 88px; }
    .start-private { font-size: 10px; }
    .start-nav { gap: 22px; }
    .start-bar-actions { padding-left: 16px; }
}
@media (max-width: 799.98px) {
    #start { min-height: auto; }
    .start-bar { padding: 20px 0; gap: 18px; }
    .start-wordmark { font-size: 25px; }
    .start-nav { gap: 21px; }
    .start-nav a { font-size: 12px; }
    .start-nav a:last-child { display: none; }
    .start-bar-actions { padding-left: 0; border-left: 0; gap: 0; }
    .start-main { grid-template-columns: minmax(0, 1fr); gap: 37px; padding-top: 49px; padding-bottom: 39px; }
    .start-copy { width: min(100%, 580px); margin: 0 auto; }
    .start-title { font-size: clamp(62px, 10vw, 82px); }
    .start-eyebrow { margin-bottom: 21px; }
    .start-sub { max-width: 28em; }
    .start-stage { width: 100%; padding: 0; }
    .start-sheet-wrap { width: min(100%, 425px); }
    .start-doc-heading { font-size: 30px; }
    .start-private { margin-top: 16px; }
    .start-foot-rev { display: none; }
}
@media (max-width: 519.98px) {
    .start-bar { width: calc(100% - 40px); padding: 18px 0; }
    .start-brand { gap: 6px; }
    .start-brand > svg { width: 31px; height: 31px; }
    .start-wordmark { font-size: 25px; }
    .start-nav { margin-left: auto; }
    .start-nav a { display: none; }
    .start-nav a:first-child { display: inline; font-size: 12px; }
    .start-bar-actions { gap: 0; }
    #start .start-bar-actions .icon-btn { width: 30px; min-width: 30px; }
    .start-main { gap: 38px; padding: 41px 23px 32px; }
    .start-title { font-size: clamp(50px, 12.6vw, 65px); letter-spacing: -0.06em; }
    .start-eyebrow { font-size: 9px; letter-spacing: 0.08em; margin-bottom: 19px; }
    .start-sub { max-width: 26em; font-size: 16px; line-height: 1.6; margin: 23px 0 25px; }
    .start-actions { gap: 10px 19px; }
    #start .start-cta { min-height: 54px; padding: 0 17px; gap: 9px; font-size: 15px; }
    .start-tour { font-size: 12px; gap: 4px; }
    .start-open-note { font-size: 11px; line-height: 1.6; margin: 15px 0 21px; }
    .start-quick-actions { gap: 7px; }
    #start .start-secondary { padding: 0 9px; gap: 5px; min-height: 39px; font-size: 10.5px; }
    #start .start-secondary svg { width: 13px; height: 13px; }
    .start-caps { margin-top: 23px; gap: 12px 17px; font-size: 11px; }
    .start-sheet-wrap { width: min(100%, 357px); padding: 23px 25px 20px 14px; }
    .start-sheet { min-height: 440px; padding: 23px 23px 0; }
    .start-paper-back { inset: 25px 20px 20px 24px; }
    .start-stage-orbit { left: -2%; top: 16%; width: 104%; }
    .start-doc-heading { font-size: 27px; }
    .start-doc-kicker { margin-top: 14px; }
    .start-doc-copy { font-size: 8.5px; margin: 12px 0 14px; }
    .start-sign { height: 76px; }
    .start-sheet-drop { margin: 0 -23px; padding: 14px 16px; }
    .start-sheet-title { font-size: 11px; }
    .start-sheet-hint { font-size: 8px; }
    .start-preview-toolbar { left: 3px; padding: 5px; border-radius: 9px; }
    .start-preview-toolbar span { width: 31px; height: 31px; }
    .start-edit-label { right: -7px; top: 37%; }
    .start-edit-label > span { font-size: 9px; padding: 6px 9px; }
    .start-signed-label { right: -5px; bottom: 85px; padding: 11px 12px; gap: 7px; }
    .start-signed-label strong { font-size: 11px; }
    .start-signed-label > span > span { font-size: 8px; }
    .start-signed-icon { width: 27px; height: 27px; }
    .start-private { font-size: 10px; margin-top: 15px; }
    .start-recent-head { align-items: flex-start; flex-direction: column; gap: 6px; }
    .start-recent-list { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 20px 14px; }
    .start-foot { flex-direction: column; align-items: flex-start; gap: 5px; padding: 12px 0 18px; }
    .start-foot-note { font-size: 10px; }
}
@media (max-width: 359.98px) {
    .start-nav { display: none; }
    .start-title { font-size: 46px; }
    .start-main { padding-left: 20px; padding-right: 20px; }
    .start-actions { gap: 14px; }
    .start-tour { font-size: 11px; }
    .start-tour svg { display: none; }
    .start-doc-heading { font-size: 23px; }
    .start-sheet { padding-left: 19px; padding-right: 19px; }
    .start-sheet-drop { margin-left: -19px; margin-right: -19px; }
    .start-doc-row { font-size: 5px; }
}
