/* Double H add-on UI layered over the 3D experience.
   1 tokens · 2 overlay page (Start your project) · 3 engine-style panels (Projects, Contact)
   4 client scroller · 5 client page + feedback video · 6 contact form · 7 utilities, responsive, motion */

/* ---------------- 1. tokens ---------------- */
:root {
  --dh-mint: #3fe0c5; --dh-text: #e7fbf7; --dh-muted: #9cc4bd; --dh-dim: #5c8079; --dh-line: rgba(63, 224, 197, .18);
  --dh-e-title: #5f9c92; --dh-e-text: #a9d6cd; --dh-err: #ff9b8f; --dh-ink: #03201b; --dh-bg: #06110f;
  --dh-mono: 'IBM Plex Mono', ui-monospace, monospace;
}
@font-face { font-family: 'IBM Plex Mono'; src: url('/assets/IBMPlexMono-Medium-897c8c30.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/assets/IBMPlexMono-Regular-d3034935.woff2') format('woff2'); font-weight: 400; font-display: swap; }

/* ---------------- 2. overlay page: Start your project ---------------- */
#dh-layer { position: fixed; inset: 0; z-index: 900; overflow-y: auto; overscroll-behavior: contain; opacity: 0; visibility: hidden;
  background: radial-gradient(ellipse at 70% 30%, rgba(8, 40, 37, .62), rgba(3, 12, 11, .93) 75%);
  backdrop-filter: blur(16px) saturate(1.1); -webkit-backdrop-filter: blur(16px) saturate(1.1);
  transition: opacity .6s ease, visibility .6s; color: var(--dh-text); font-family: var(--dh-mono); }
#dh-layer.open { opacity: 1; visibility: visible; }
#dh-layer, .dh-proj-col { touch-action: pan-y pinch-zoom; -webkit-overflow-scrolling: touch; }
#dh-layer *, .dh-proj-col * { box-sizing: border-box; }
.dh-card, .dh-form, .dh-form label, .dh-two, .dh-contact > * { min-width: 0; }
#dh-layer::before { content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .5; background-size: 125px 125px;
  background-image: linear-gradient(rgba(63, 224, 197, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(63, 224, 197, .05) 1px, transparent 1px); }
#dh-layer :focus-visible { outline: 1px solid var(--dh-mint); outline-offset: 2px; }
.dh-page { display: none; position: relative; max-width: 1080px; margin: 0 auto; padding: 130px 40px 120px; }
.dh-page.on { display: block; animation: dhIn .7s ease both; }
@keyframes dhIn { from { opacity: 0; transform: translateY(16px); filter: blur(4px); } }
.dh-prompt { color: var(--dh-mint); font-size: 12px; letter-spacing: .1em; margin: 0 0 14px; }
.dh-page h1 { font: 500 clamp(30px, 4.6vw, 58px)/1.05 var(--dh-mono); margin: 0 0 18px; letter-spacing: -.02em; text-transform: uppercase; }
.dh-page h3 { font: 500 15px var(--dh-mono); margin: 0 0 6px; text-transform: uppercase; letter-spacing: .02em; }
.dh-lead { color: var(--dh-muted); font-size: 15px; line-height: 1.75; max-width: 640px; margin: 0 0 36px; }
.dh-card { position: relative; padding: 24px; background: rgba(5, 18, 17, .78); backdrop-filter: blur(8px); border: 1px solid var(--dh-line); border-radius: 4px;
  overflow: hidden; transition: border-color .3s, transform .3s; }
.dh-card:hover { border-color: rgba(63, 224, 197, .55); transform: translateY(-2px); }
.dh-card::after { content: ''; position: absolute; top: 0; inset-inline-start: 0; width: 18px; height: 18px; border-top: 1px solid var(--dh-mint); border-inline-start: 1px solid var(--dh-mint); }
.dh-card .n { color: var(--dh-mint); font-size: 11px; letter-spacing: .14em; display: block; margin-bottom: 12px; }
.dh-card p { color: var(--dh-muted); font-size: 13px; line-height: 1.7; margin: 0 0 14px; }
.dh-card .get { font-size: 10.5px; color: var(--dh-dim); letter-spacing: .14em; text-transform: uppercase; margin: 0 0 8px; }
.dh-btn { display: inline-flex; align-items: center; gap: 8px; font: 500 12px var(--dh-mono); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  padding: 12px 18px; border-radius: 4px; border: 1px solid var(--dh-mint); color: var(--dh-mint); background: transparent; transition: background .2s, color .2s, box-shadow .2s; }
.dh-btn:hover { background: var(--dh-mint); color: var(--dh-ink); box-shadow: 0 0 24px rgba(63, 224, 197, .45); }
.dh-btn.solid { background: var(--dh-mint); color: var(--dh-ink); }
.dh-close { position: fixed; z-index: 1001; background: rgba(4, 16, 15, .6); top: 76px; inset-inline-end: 28px; }
.dh-close[hidden] { display: none; }
.dh-contact { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.dh-mail { color: var(--dh-mint); font-size: 16px; text-decoration: none; word-break: break-all; }
.dh-foot { margin-top: 90px; padding-top: 24px; border-top: 1px solid var(--dh-line); color: var(--dh-dim); font-size: 11px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

.dh-tabs { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 18px; border: 1px solid var(--dh-line); border-radius: 6px; background: rgba(4, 16, 15, .55); }
.dh-tabs button { font: 500 12px var(--dh-mono); letter-spacing: .06em; text-transform: uppercase; padding: 10px 16px; border: 0; border-radius: 4px; background: transparent;
  color: var(--dh-muted); cursor: pointer; transition: background .2s, color .2s; }
.dh-tabs button:hover { color: var(--dh-text); }
.dh-tabs button.on { background: var(--dh-mint); color: var(--dh-ink); }

.dh-form { display: grid; gap: 16px; }
.dh-form[hidden], .dh-form [hidden] { display: none !important; }
.dh-form label { display: grid; gap: 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--dh-muted); }
.dh-form label > span::after { content: ' *'; color: var(--dh-mint); }
.dh-form label.opt > span::after { content: none; }
.dh-form label em { font-style: normal; color: var(--dh-dim); text-transform: none; letter-spacing: 0; }
.dh-form input, .dh-form textarea, .dh-form select { font: 14px var(--dh-mono); color: var(--dh-text); background: rgba(2, 10, 9, .6); border: 1px solid var(--dh-line); border-radius: 3px; padding: 12px; }
.dh-form input, .dh-form textarea, .dh-form select, .dh-cv-form input, .dh-cv-form textarea { min-width: 0; width: 100%; max-width: 100%; }
.dh-form textarea { resize: vertical; }
.dh-form input:focus, .dh-form textarea:focus, .dh-form select:focus { outline: none; border-color: var(--dh-mint); box-shadow: 0 0 0 3px rgba(63, 224, 197, .12); }
.dh-form select option { background: var(--dh-bg); }
.dh-form input[type="date"] { color-scheme: dark; }
.dh-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dh-msg { min-height: 1.2em; font-size: 12px; color: var(--dh-mint); margin: 0; }
.dh-msg.err { color: var(--dh-err); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }   /* honeypot field */

/* ---------------- 3. engine-style panels (Projects & Clients, Contact) ---------------- */
#dh-proj, #dh-cv { position: fixed; inset: 0; z-index: 790; pointer-events: none; opacity: 0; transition: opacity .6s ease; }
#dh-proj.show, #dh-cv.show { opacity: 1; }
#dh-proj[hidden], #dh-cv[hidden] { display: none; }
.dh-proj-col { pointer-events: auto; position: absolute; left: 50%; top: 0; bottom: 0; width: min(560px, calc(100vw - 40px)); transform: translateX(-50%);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: 120px 0 90px;
  display: flex; flex-direction: column; justify-content: safe center; gap: 25px;
  font: 500 16px/1.32 var(--dh-mono); -webkit-font-smoothing: antialiased; }
.dh-proj-col[hidden] { display: none !important; }
.dh-proj-col::-webkit-scrollbar { display: none; }
.dh-proj-col > * { margin: 0; }
.dh-e-title { color: var(--dh-e-title); white-space: pre-wrap; }
.dh-e-text { color: var(--dh-e-text); white-space: pre-wrap; text-shadow: 0 0 1px rgba(0, 0, 0, .4); }
.dh-back { font: 500 12px var(--dh-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dh-muted); background: none; border: 0; padding: 0; margin: 0 0 26px; cursor: pointer; }
.dh-back:hover, .dh-back:focus-visible { color: var(--dh-mint); outline: none; }
.dh-proj-col .dh-back { align-self: flex-start; margin: 0; color: var(--dh-e-text); font-size: 13px; }
.dh-proj-col .dh-back:hover, .dh-proj-col .dh-back:focus-visible { color: var(--dh-mint); }

/* ---------------- 4. client scroller (blocks are native WebGL; intro, rail and hint are HTML) ---------------- */
#dh-proj .dh-ps { position: fixed; inset: 0; pointer-events: none; touch-action: none; }
#dh-proj .dh-ps[hidden] { display: none; }
.dh-ps-stage { position: absolute; inset: 0; pointer-events: none; }
.dh-ps-intro { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(500px, calc(100vw - 64px)); display: grid; gap: 25px; font: 500 16px/1.32 var(--dh-mono); }
.dh-ps-intro p { margin: 0; }
.dh-ps-rail { position: absolute; right: max(2.6vw, 18px); top: 50%; transform: translateY(-50%); display: grid; max-height: 65vh; overflow-y: auto; scrollbar-width: none; pointer-events: auto; }
.dh-ps-rail button { width: 32px; height: 30px; padding: 10px; border: 0; background: transparent; cursor: pointer; }
.dh-ps-rail button::after { content: ''; display: block; width: 8px; height: 8px; border: 1px solid rgba(159, 255, 238, .6); border-radius: 50%; transition: background .3s, box-shadow .3s; }
.dh-ps-rail button:first-child::after { border-radius: 2px; }
.dh-ps-rail button.on::after { background: var(--dh-mint); border-color: var(--dh-mint); box-shadow: 0 0 10px rgba(63, 224, 197, .8); }
.dh-ps-rail button:focus-visible { outline: 1px solid var(--dh-mint); outline-offset: -3px; }
.dh-ps-hint { position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); margin: 0; font: 500 12px var(--dh-mono); color: var(--dh-e-text); letter-spacing: .06em; transition: opacity .5s; }
.dh-ps-hint::before { content: '\2193  '; color: var(--dh-mint); }
.dh-ps-hint.gone { opacity: 0; }
.dh-ps-hint[hidden] { display: none; }

/* ---------------- 5. client page + feedback video ---------------- */
.dh-proj-col.detail { width: min(500px, calc(100vw - 40px)); }   /* same column as the engine text, clear of the video */
.dh-proj-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 10px; }
.dh-video-frame { position: relative; padding: 10px; background: rgba(5, 18, 17, .72); border: 1px solid var(--dh-line); }
.dh-video-frame::before, .dh-video-frame::after { content: ''; position: absolute; width: 22px; height: 22px; border: 0 solid var(--dh-mint); pointer-events: none; }
.dh-video-frame::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.dh-video-frame::after { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }
#dh-vid { position: fixed; z-index: 800; top: 50%; right: 2.5vw; width: min(27vw, 440px); transform: translateY(-45%); opacity: 0;
  transition: opacity .7s ease, transform .7s ease; font-family: var(--dh-mono); }
#dh-vid.show { opacity: 1; transform: translateY(-50%); }
#dh-vid[hidden] { display: none; }
#dh-vid .dh-vid-box { margin: 0; position: relative; }
#dh-vid .dh-vid-box figcaption { margin-top: 10px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dh-muted); }
#dh-vid .dh-vid-box figcaption::before { content: '/// '; color: var(--dh-mint); }
#dh-vid .dh-video-frame video { display: block; width: 100%; max-height: 62vh; background: #000; }
.dh-vid-open, .dh-vid-x { display: none; }

/* ---------------- 6. contact form (engine text style) ---------------- */
.dh-cv-col { width: min(500px, calc(100vw - 40px)); gap: 20px; padding: 100px 0 60px; }
.dh-cv-form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.dh-cv-form label { display: flex; flex-direction: column; gap: 3px; color: var(--dh-e-title); font-size: 13px; }
.dh-cv-form input, .dh-cv-form textarea { font: inherit; font-size: 15px; color: var(--dh-text); background: rgba(6, 22, 21, .35); border: 0;
  border-bottom: 1px solid rgba(63, 224, 197, .28); border-radius: 0; padding: 6px 4px; outline: none; caret-color: var(--dh-mint);
  transition: border-color .2s ease, background .2s ease; }
.dh-cv-form input:focus, .dh-cv-form textarea:focus { border-bottom-color: var(--dh-mint); background: rgba(6, 22, 21, .6); }
.dh-cv-form textarea { min-height: 72px; resize: vertical; }
.dh-cv-send { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.dh-cv-col .dh-cv-send .dh-back { color: var(--dh-mint); font-size: 14px; }
.dh-cv-col .dh-cv-send .dh-back:hover, .dh-cv-col .dh-cv-send .dh-back:focus-visible { color: var(--dh-text); }
.dh-cv-col .dh-cv-send .dh-back:disabled { opacity: .5; cursor: progress; }
.dh-cv-msg { margin: 0; font-size: 13px; color: var(--dh-e-text); }
.dh-cv-msg.err { color: var(--dh-err); }
.dh-cv-details { display: flex; flex-direction: column; gap: 6px; }
.dh-cv-details > * { margin: 0; }
.dh-cv-mail { color: var(--dh-mint); text-decoration: none; border-bottom: 1px solid rgba(63, 224, 197, .35); }
.dh-cv-mail:hover, .dh-cv-mail:focus-visible { border-bottom-color: var(--dh-mint); outline: none; }
.dh-cv-foot { font-size: 12px; }

/* ---------------- 7. utilities, responsive, motion ---------------- */
.dh-dim { color: var(--dh-e-title) !important; }
.dh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 1439px) {   /* feedback video becomes a button that expands to a full-screen player */
  #dh-vid { top: auto; bottom: 22px; right: 18px; width: auto; transform: none; }
  #dh-vid.show { transform: none; }
  .dh-vid-open { display: inline-flex; font: 500 12px var(--dh-mono); letter-spacing: .08em; text-transform: uppercase; padding: 12px 16px; border: 1px solid var(--dh-mint);
    color: var(--dh-ink); background: var(--dh-mint); border-radius: 4px; cursor: pointer; box-shadow: 0 0 22px rgba(63, 224, 197, .45); }
  #dh-vid .dh-vid-box { display: none; }
  #dh-vid.expanded { inset: 0; display: grid; place-items: center; background: rgba(3, 12, 11, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  #dh-vid.expanded .dh-vid-open { display: none; }
  #dh-vid.expanded .dh-vid-box { display: block; width: min(92vw, 820px); }
  #dh-vid.expanded .dh-vid-x { display: block; position: absolute; top: -44px; right: 0; width: 36px; height: 36px; font-size: 22px; line-height: 1; color: var(--dh-text);
    background: rgba(4, 16, 15, .7); border: 1px solid var(--dh-line); border-radius: 4px; cursor: pointer; }
}
@media (max-width: 900px) {
  #dh-layer, #dh-cv, #dh-proj { top: var(--dh-panel-top, 0px); bottom: auto; height: var(--dh-panel-height, 100dvh); }
  #dh-layer { overflow: hidden; }
  .dh-page { height: calc(100% - 76px - env(safe-area-inset-top, 0px)); margin-top: calc(76px + env(safe-area-inset-top, 0px)); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y pinch-zoom; -webkit-overflow-scrolling: touch; box-sizing: border-box; padding: 20px max(18px, env(safe-area-inset-right, 0px)) calc(100px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); }
  .dh-contact, .dh-two { grid-template-columns: minmax(0, 1fr); }
  .dh-card { padding: 18px; }
  .dh-close { top: calc(var(--dh-panel-top, 0px) + 16px + env(safe-area-inset-top, 0px)); inset-inline-end: max(18px, env(safe-area-inset-right, 0px)); min-height: 44px; box-sizing: border-box; }
  .dh-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; box-sizing: border-box; }
  .dh-tabs button { min-height: 44px; padding: 10px 6px; font-size: 11px; }
  .dh-form input, .dh-form textarea, .dh-form select, .dh-cv-form input, .dh-cv-form textarea { font-size: 16px; }
  .dh-form input, .dh-form select, .dh-cv-form input { min-height: 44px; }
  .dh-btn, .dh-back { min-height: 44px; }
  .dh-proj-col { top: calc(76px + env(safe-area-inset-top, 0px)); bottom: calc(80px + env(safe-area-inset-bottom, 0px)); padding: 8px 0 24px; gap: 20px; font-size: 15px; }
  .dh-e-text, .dh-e-title, .dh-cv-mail { overflow-wrap: anywhere; }
  .dh-proj-nav { flex-wrap: wrap; }
  .dh-ps-intro { width: calc(100% - 88px); font-size: 15px; }
  .dh-ps-rail { right: max(8px, env(safe-area-inset-right, 0px)); }
  .dh-ps-rail button { width: 44px; height: 44px; padding: 18px; }
  .dh-ps-hint { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); width: max-content; max-width: calc(100% - 48px); text-align: center; }
  .dh-cv-col { justify-content: flex-start; }
  .dh-cv-col .dh-cv-send .dh-back { padding: 10px 0; }
  .dh-foot { margin-top: 40px; line-height: 1.7; }
  #dh-vid { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); right: max(18px, env(safe-area-inset-right, 0px)); }
  #dh-vid.expanded { top: var(--dh-panel-top, 0px); height: var(--dh-panel-height, 100dvh); bottom: auto; width: 100%; box-sizing: border-box; padding: 60px 16px; touch-action: pan-y pinch-zoom; }
  #dh-vid.expanded .dh-vid-box { width: 100%; }
  #dh-vid.expanded .dh-vid-x { width: 44px; height: 44px; top: -50px; }
  #dh-vid .dh-video-frame video { max-height: calc(var(--dh-panel-height, 100dvh) - 180px); }
}
@media (prefers-reduced-motion: reduce) {
  .dh-page.on { animation: none; }
  #dh-layer, #dh-proj, #dh-cv, #dh-vid, .dh-card, .dh-ps-hint { transition: none; }
}
