/* Home page directions (prototype). Loaded after style.css */

/* Direction picker, only in this prototype */
.dir-switch { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px;
  background: rgba(20,20,22,.88); color: #fff; border-radius: 999px; font: 500 12px/1 var(--font-mono); box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.dir-switch span { margin-right: 6px; opacity: .7; }
.dir-switch a { color: #fff; text-decoration: none; border-radius: 999px; padding: 8px 12px; }
.dir-switch a[aria-current="page"] { background: #fff; color: #141416; }
.dir-switch a:not([aria-current]):hover { background: rgba(255,255,255,.14); }
.dir-switch a:focus-visible { outline: 2px solid #6cc4f0; outline-offset: 2px; }

/* Shared */
body.home-page .home { max-width: none; }
.home .hello { font-size: clamp(30px, min(4vw, 5.2vh), 64px); }
.home .intro { margin-left: 0; }

/* ======================= A · Index ======================= */
.home-a { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(0, 1.1fr); gap: clamp(28px, 4vw, 64px); align-items: stretch; }
.ha-left { display: flex; flex-direction: column; min-width: 0; }
.home-a .intro { font-size: 14.5px; line-height: 1.6; max-width: 520px; margin-bottom: clamp(20px, 3.5vh, 44px); }

/* Two tabs over the list: case studies and personal work. The chosen one is larger and fully opaque */
/* Both lists share one spot, so switching tabs never changes the height or moves the preview */
.wi-panels { display: grid; }
.wi-panels > .work-index { grid-area: 1 / 1; }
.wi-panels > .work-index[hidden] { display: block; visibility: hidden; }
.wi-tabs { display: flex; align-items: baseline; gap: clamp(12px, 1.3vw, 18px); margin: 0 0 clamp(8px, 1.4vh, 14px); }
.wi-tab { appearance: none; background: none; border: 0; padding: 4px 0; margin: 0; cursor: pointer; color: var(--text);
  display: inline-grid; justify-items: start; text-align: left;
  font: 700 15px/24px var(--font-body); opacity: .4; transition: opacity .2s ease; }
/* reserve the width of the larger size, so the tabs don't push each other around */
.wi-tab::after { content: attr(data-label); font-size: 20px; height: 0; overflow: hidden; visibility: hidden; }
.wi-tab[aria-selected="true"] { font-size: 20px; opacity: 1; }
.wi-tab:hover { opacity: .75; }
.wi-tab[aria-selected="true"]:hover { opacity: 1; }
.wi-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.work-index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.wi-row a { --ts: clamp(22px, min(2.5vw, 3.6vh), 38px);
  display: grid; grid-template-columns: 28px 1fr; grid-template-areas: "dot title" ". meta"; align-items: baseline; column-gap: 8px;
  padding: clamp(7px, 1.25vh, 14px) 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; position: relative;
  opacity: .38; transition: opacity .25s ease; }
/* a small upright bar that fills with the project's colour when you point at it */
.wi-dot { grid-area: dot; align-self: start; width: 9px; height: 20px; box-sizing: border-box; margin-top: calc(var(--ts) * .54 - 10px);
  border-radius: 4px; border: 1.5px solid var(--text-soft); background: transparent;
  transition: background-color .2s ease, border-color .2s ease, transform .3s cubic-bezier(.2,.7,.2,1); }
.wi-title { grid-area: title; font-weight: 400; font-size: var(--ts); line-height: 1.12; letter-spacing: -0.3px; transition: color .2s; }
.wi-meta { grid-area: meta; font: 400 12px/1.4 var(--font-mono); color: var(--text-soft); margin-top: 4px; }
.wi-img { display: none; }
/* the project on show is at full strength; the rest stay dimmed */
.wi-row a.on, .wi-row a:hover, .wi-row a:focus-visible { opacity: 1; }
.wi-row a:hover .wi-dot, .wi-row a:focus-visible .wi-dot { background-color: var(--c); border-color: var(--c); transform: scaleY(1.2); }
.wi-row a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* the preview sits a little smaller than the column, centred beside the list */
.ha-stage { position: relative; min-height: 0; display: flex; flex-direction: column; align-self: center; }
.st-frame { position: relative; flex: none; height: min(64vh, 580px); min-height: 320px; border-radius: 16px; overflow: hidden; background: #ddd; box-shadow: 0 18px 50px rgba(30, 28, 60, .16); }
.st-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 26% 100%; opacity: 0; transform: scale(1.04); transition: opacity .45s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.st-img.on { opacity: 1; transform: scale(1); }
.st-caps { position: relative; height: 22px; margin-top: 12px; }
.st-cap { position: absolute; inset: 0; margin: 0; display: flex; justify-content: space-between; font: 400 12px/1.6 var(--font-mono); color: var(--text-soft); opacity: 0; transition: opacity .3s; pointer-events: none; }
.st-cap.on { opacity: 1; pointer-events: auto; }
/* the picture and "View case study" both open the project on show */
a.st-frame { display: block; cursor: pointer; }
.st-go { color: var(--text); text-decoration: none; font-weight: 400; }
.st-go:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 1100px) and (min-width: 901px) { .home-a { grid-template-columns: minmax(320px, 1fr) minmax(0, 1fr); } }
@media (max-width: 900px) {
  .wi-panels > .work-index[hidden] { display: none; } /* phones have no preview to keep still */
  .home-a { display: block; }
  .ha-stage { display: none; }
  .wi-row a { grid-template-columns: 1fr; grid-template-areas: "img" "title" "meta"; padding: 18px 0; }
  .wi-dot { display: none; }
  .wi-row a { grid-template-columns: 1fr; opacity: 1; }
  .wi-img { grid-area: img; display: block; width: 100%; height: auto; border-radius: 12px; margin-bottom: 12px; }
  .wi-title { font-size: 26px; }
}

@media (max-width: 900px) {
  .wi-title { font-size: 22px; overflow-wrap: anywhere; }
  .dir-switch { white-space: nowrap; font-size: 11px; }
  .dir-switch span { display: none; }
}

/* Intro: the one bold idea is "I design tools people need to trust"; the project links stay regular weight, underlined */
.home .intro a { font-weight: 400; color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--text-soft); }
.home .intro a:hover { color: var(--accent); text-decoration-color: currentColor; }
