/*
 * Shift UI v2 — application layer.
 *
 * What the real site needs on top of the mock-up components of shift-v2.css:
 * sticky navbar with dropdowns and a mobile drawer, theme toggle, form fields,
 * flash messages, generic prose, tables and a few layout utilities.
 * Everything stays namespaced with "h-" and only uses the theme tokens.
 */

html{background:var(--bg)}
body{background:var(--bg);color:var(--text)}
.h-root{min-height:100vh;display:flex;flex-direction:column}
.h-root>main{flex:1}
.h-skip{position:absolute;left:-9999px;top:8px;z-index:200;padding:10px 16px;border-radius:var(--rb);background:var(--acc);color:var(--on)!important}
.h-skip:focus{left:16px}
:where(.h-root) a:focus-visible,:where(.h-root) button:focus-visible,:where(.h-root) select:focus-visible,:where(.h-root) input:focus-visible,:where(.h-root) textarea:focus-visible{outline:2px solid var(--sec);outline-offset:2px}

/* ---- navbar: sticky, dropdowns, mobile drawer ---- */
.h-navbar{position:sticky;top:0;z-index:100;background:color-mix(in srgb,var(--bg) 92%,transparent);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
.h-nav{flex-wrap:nowrap}
.h-links{align-items:center}
.h-link{background:none;border:0;font-family:var(--f-body);cursor:pointer;gap:6px}
.h-link:hover{color:var(--text)!important;background:var(--soft)}
.h-link svg{transition:transform .15s ease}
.h-drop{position:relative}
.h-drop-menu{position:absolute;top:calc(100% + 6px);left:0;min-width:220px;padding:6px;margin:0;list-style:none;border:1px solid var(--line);border-radius:var(--r);background:var(--surf);box-shadow:0 12px 32px rgb(0 0 0 / .12);display:none;z-index:110}
.h-drop-menu--end{left:auto;right:0}
.h-drop.is-open>.h-drop-menu{display:block}
.h-drop.is-open>.h-link svg,.h-drop.is-open>.h-icon svg{transform:rotate(180deg)}
.h-drop-item{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:8px 12px;box-sizing:border-box;border:0;border-radius:var(--rb);background:none;color:var(--text)!important;font:500 .93rem var(--f-body);text-decoration:none;text-align:left;cursor:pointer}
.h-drop-item:hover,.h-drop-item[aria-current=page]{background:var(--soft)}
.h-drop-item small{display:block;color:var(--muted);font-weight:400;font-size:.8rem}
.h-drop-sep{height:1px;margin:6px 4px;background:var(--line)}
.h-drop-k{margin:6px 12px 2px;font:500 .72rem var(--f-mono);letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.h-drop form{margin:0}
.h-icon:hover{background:var(--soft)}
.h-theme-sun{display:none}
[data-theme=dark] .h-theme-sun{display:block}
[data-theme=dark] .h-theme-moon{display:none}
.h-burger{display:none}
.h-lang-form{margin:0}

@media (max-width:960px){
  .h-burger{display:grid}
  .h-nav-cta{display:none}
  .h-links{position:fixed;inset:64px 0 auto 0;max-height:calc(100vh - 64px);overflow:auto;flex-direction:column;align-items:stretch;gap:2px;padding:12px 16px 20px;background:var(--bg);border-bottom:1px solid var(--line);display:none}
  .h-navbar.is-open .h-links{display:flex}
  .h-link{width:100%;justify-content:space-between}
  .h-drop-menu{position:static;box-shadow:none;border:0;padding:0 0 0 12px;background:transparent}
  .h-right{margin-left:auto}
}
@media (max-width:720px){
  .h-wrap{padding:0 16px}
  .h-lang{display:none}
}

/* ---- messages ---- */
.h-msgs{list-style:none;margin:16px auto 0;padding:0 32px;max-width:1200px;display:grid;gap:8px}
.h-msg{display:flex;gap:10px;align-items:flex-start;padding:12px 16px;border-radius:var(--rb);border:1px solid var(--line);background:var(--surf)}
.h-msg--success{border-color:color-mix(in srgb,#16a34a 40%,var(--line))}
.h-msg--error{border-color:color-mix(in srgb,#dc2626 50%,var(--line))}
.h-msg--warning{border-color:color-mix(in srgb,var(--acc) 50%,var(--line))}

/* ---- page layout helpers ---- */
.h-main-pad{padding-top:40px;padding-bottom:72px}
.h-narrow{max-width:760px}
.h-xnarrow{max-width:480px;margin:0 auto}
.h-stack{display:grid;gap:24px}
.h-grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.h-grid-auto{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:20px}
@media (max-width:720px){.h-grid2{grid-template-columns:1fr}}
.h-cover-img{width:100%;max-height:440px;object-fit:cover;border-radius:var(--r);border:1px solid var(--line);display:block}
.h-shot--img{background:var(--surf);overflow:hidden;display:block}
.h-shot--img img{width:100%;height:100%;object-fit:cover;display:block}
.h-photo--img{object-fit:cover;display:block}
.h-muted{color:var(--muted)}
.h-center{text-align:center}
.h-mt{margin-top:24px}
.h-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}

/* ---- generic prose (user content rendered with linebreaks) ---- */
.h-prose{max-width:68ch}
.h-prose img{max-width:100%;height:auto;border-radius:var(--rb)}
.h-prose a{color:var(--sec)}
.h-prose table{border-collapse:collapse;width:100%}

/* ---- forms ---- */
.h-form{display:grid;gap:18px}
.h-field{display:grid;gap:6px}
.h-label{font:600 .9rem var(--f-body)}
.h-req{color:var(--acc)}
.h-help{font-size:.82rem;color:var(--muted);margin:0}
.h-errors{margin:0;padding:0;list-style:none;color:#dc2626;font-size:.85rem}
[data-theme=dark] .h-errors{color:#f87171}
.h-root input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=submit]):not([type=file]),
.h-root select:not(.h-lang),
.h-root textarea{width:100%;box-sizing:border-box;min-height:44px;padding:10px 12px;border-radius:var(--rb);border:1px solid var(--line);background:var(--surf);color:var(--text);font:400 .95rem var(--f-body)}
.h-root textarea{min-height:140px;resize:vertical}
.h-root input[type=file]{font:400 .9rem var(--f-body);color:var(--muted)}
.h-root select[multiple]{min-height:140px}
.h-field--check{grid-template-columns:auto 1fr;align-items:center;column-gap:10px}
.h-field--check .h-help,.h-field--check .h-errors{grid-column:2}
.h-root input[type=checkbox],.h-root input[type=radio]{width:18px;height:18px;accent-color:var(--acc)}
.h-field--invalid input,.h-field--invalid select,.h-field--invalid textarea{border-color:#dc2626}
.h-form-foot{display:flex;gap:10px;flex-wrap:wrap;align-items:center;padding-top:8px}
.h-form-card{padding:28px}
.h-btn--danger{background:#dc2626;color:#fff!important}
.h-btn:disabled{opacity:.5;cursor:not-allowed}

/* ---- tables ---- */
.h-table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:var(--r);background:var(--surf)}
.h-table{width:100%;border-collapse:collapse;font-size:.92rem}
.h-table th,.h-table td{padding:10px 14px;text-align:left;border-bottom:1px solid var(--line);vertical-align:top}
.h-table th{font:500 .75rem var(--f-mono);text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.h-table tr:last-child td{border-bottom:0}

/* ---- error pages ---- */
.h-error{padding:96px 0;text-align:center}
.h-error-code{font:700 clamp(4rem,14vw,8rem)/1 var(--f-head);color:var(--acc);margin:0}

/* ---- home typewriter ---- */
/* Fixed-height box: typing never resizes the hero; arrows drive the scroll on overflow. */
.h-tw{display:grid;grid-template-columns:1fr auto;gap:10px;margin-top:16px;max-width:560px;border:1px solid var(--line);border-radius:var(--rb,10px);background:transparent;padding:10px 10px 10px 14px}
/* Space is reserved from the start (visibility, not display) so revealing the box or its arrows never shifts the layout. */
.h-tw[data-idle],.h-tw-nav[data-idle]{visibility:hidden}
.h-tw-view{--tw-lh:1.6;height:calc(3em * var(--tw-lh));overflow-y:auto;scrollbar-width:none;scroll-behavior:smooth;font:400 .9rem/var(--tw-lh) var(--f-mono);color:var(--muted)}
.h-tw-view::-webkit-scrollbar{display:none}
.h-tw-view:focus-visible{outline:2px solid var(--acc);outline-offset:4px}
.h-tw-text{margin:0;white-space:pre-wrap}
.h-tw-text::after{content:"▍";animation:h-blink 1s steps(1) infinite;color:var(--acc)}
.h-tw-nav{display:flex;flex-direction:column;justify-content:space-between;gap:6px}
.h-tw-btn{width:30px;height:30px;border-radius:50%;border:1px solid var(--line);background:var(--surf);color:var(--text);cursor:pointer;font-size:.85rem;line-height:1}
.h-tw-btn:hover:not(:disabled){border-color:var(--acc);color:var(--acc)}
.h-tw-btn:disabled{opacity:.35;cursor:default}
@keyframes h-blink{50%{opacity:0}}
@media (prefers-reduced-motion:reduce){.h-tw-text::after{animation:none}.h-tw-view{scroll-behavior:auto}}

/* ---- timeline details (one panel per step) ---- */
.h-detail[hidden]{display:none}

/* ---- PDF viewer ---- */
.h-viewer iframe{display:block;width:100%;height:min(80vh,900px);border:0;border-radius:var(--rb);background:var(--surf)}

/* ---- server-side list controls: chips and pager are links ---- */
a.h-chip,a.h-page,span.h-page{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;text-decoration:none}
a.h-chip[aria-current]{background:var(--text);color:var(--bg)!important;border-color:var(--text);box-shadow:3px 3px 0 var(--acc)}
span.h-page[aria-disabled=true]{opacity:.45;cursor:not-allowed}
.h-search-form{display:contents}

/* ---- `hidden` always wins over component display rules ---- */
.h-root [hidden]{display:none!important}

/* ---- project gallery: real images in the main shot and thumbnails ---- */
figure.h-hero-shot{margin:0}
.h-thumb.h-shot--img{overflow:hidden}
a.h-dev{text-decoration:none;color:inherit}

/* ---- /sites showcase: the browser frame is a link ---- */
a.h-browser{display:block;text-decoration:none;color:inherit}

/* search field: the generic input rule must not draw a second box */
.h-root .h-search input{border:0;background:transparent;min-height:42px;padding:0;box-shadow:none}
/* markdown prose */
.h-prose h1,.h-prose h2,.h-prose h3{font-family:var(--f-head);letter-spacing:-.02em;margin:1.6em 0 .5em}
.h-prose>:first-child{margin-top:0}
.h-prose code{font:400 .88em var(--f-mono);background:var(--soft);padding:1px 5px;border-radius:4px}
.h-prose pre{overflow-x:auto;padding:14px 16px;border:1px solid var(--line);border-radius:var(--rb);background:var(--surf)}
.h-prose pre code{background:none;padding:0}
.h-prose blockquote{margin:1em 0;padding-left:16px;border-left:3px solid var(--acc);color:var(--muted)}

/* ---- profile / contract entries ---- */
.h-actions--center{justify-content:center}
.h-photo--lg{width:88px;height:88px}
.h-entries{list-style:none;margin:0;padding:0;display:grid;gap:12px}
.h-entry{display:flex;gap:16px;align-items:flex-start;padding:18px}
.h-entry-logo{flex:none;width:48px;height:48px;border-radius:var(--rb);border:1px solid var(--line);background:var(--soft);color:var(--acc);display:grid;place-items:center;font:700 .8rem var(--f-mono);object-fit:contain}
.h-entry-logo .h-ico{border:0;background:none}
.h-entry-org{margin:2px 0 4px;font-weight:500}
.h-entry-org a{color:var(--sec)}
.h-iconlist{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:10px}
.h-iconlist li{width:48px;height:48px;display:grid;place-items:center;border:1px solid var(--line);border-radius:var(--rb);background:var(--bg)}
.h-iconlist img{max-width:32px;max-height:32px}
.h-iconlist--logos li{width:auto;min-width:64px;padding:0 10px}
.h-iconlist--logos img{max-width:96px}
.h-acc-ico{display:block}
[data-theme=dark] .h-acc-ico{filter:invert(1)}
.h-client-logo{max-height:64px;width:auto;border-radius:var(--rb)}
.h-reviews-head,.h-review-top{justify-content:space-between}
.h-reviews-head .h-h2s{margin:0}
.h-reviews-head{margin-bottom:16px}
/* star rating */
.h-stars{display:inline-flex;align-items:center;gap:8px;margin:0}
.h-stars-row{display:inline-flex;color:var(--acc)}
.h-stars-row svg{fill:currentColor}
.h-stars-val{font-weight:600}
ul.h-tags{list-style:none;margin:0;padding:0}
.h-iconlist--logos li:has(.h-tag){border:0;background:none;padding:0;min-width:0}
/* Project cover fallback: Shift logo, variant picked by theme. */
.h-shot--logo{display:flex;align-items:center;justify-content:center;background:var(--surf)}
.h-shot--logo img{width:min(30%,140px);height:auto;opacity:.85}
.h-shot--logo .h-logo-dark{display:none}
[data-theme=dark] .h-shot--logo .h-logo-light{display:none}
[data-theme=dark] .h-shot--logo .h-logo-dark{display:block}
