/* ==========================================================================
   Minimal designer portfolio — single stylesheet
   Pure CSS3. Design tokens as custom properties; no hardcoded hex in rules.
   ========================================================================== */

:root {
  --background: #f1f1f1;
  --foreground: #000000;
  --muted-foreground: #595959;
  --input-bg: #fafafa;
  --border: #000000;
  --error: #b00020;

  --font: "Helvetica Neue", Arial, Helvetica, sans-serif;

  /* breakpoint-driven values, overridden in media queries below */
  --pad: 20px;
  --hero-size: 34px;
  --heading-size: 26px;
  --body-size: 16px;
  --nav-size: 13px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--body-size);
  line-height: 1.45;
  letter-spacing: 0.01em;
}

img {
  display: block;
  max-width: 100%;
  border: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
  font-weight: 400;
}

a {
  color: var(--foreground);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
  }
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--foreground);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 50;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  background: var(--background);
  color: var(--foreground);
  padding: 8px 16px;
  font-size: 16px;
}

/* ---------- container / gutter ---------- */

.gutter {
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
}

/* 44px tap targets without changing font size */
.tap {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-top: 12px;
  padding-bottom: 12px;
  margin-top: -12px;
  margin-bottom: -12px;
}

/* ---------- type roles ---------- */

.t-hero {
  font-size: var(--hero-size);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.t-heading {
  font-size: var(--heading-size);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.t-body {
  font-size: var(--body-size);
  line-height: 1.45;
  letter-spacing: 0.01em;
}

.t-nav {
  font-size: var(--nav-size);
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.t-caption {
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.muted {
  color: var(--muted-foreground);
}

/* ---------- header ---------- */

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 16px;
  padding-top: 24px;
  padding-bottom: 24px;
}

.wordmark {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-spacing: 0.35em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: baseline;
  gap: 4px 16px;
}

.site-nav a.is-active {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- footer ---------- */

/* ---------- footer ---------- */

.site-footer {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.footer-cols {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.footer-cols .col {
  min-width: 0;
}

.footer-lead {
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted-foreground);
  margin-bottom: 12px;
}

.footer-email {
  display: inline-block;
  font-size: 18px;
  line-height: 1.45;
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-word;
}

.footer-place {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted-foreground);
}

.footer-label {
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 12px;
}

.footer-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.footer-list a {
  font-size: 16px;
  line-height: 1.2;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-rule {
  margin-top: 32px;
  border-top: 1px solid var(--border);
}

.footer-bottom {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.footer-copy {
  color: var(--muted-foreground);
}

.footer-top {
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* ---------- scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 600ms ease-out,
    transform 600ms ease-out;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- home ---------- */

.hero {
  margin-top: 40px;
  width: 100%;
}

/* ---------- work grid ---------- */

.page {
  margin-top: 48px;
  padding-bottom: 48px;
  overflow-x: clip;
}

.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  column-gap: 16px;
  row-gap: 32px;
}

.work-card {
  min-width: 0;
  display: block;
}

.work-card .thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.work-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 300ms ease-out;
}

@media (hover: hover) and (pointer: fine) {
  .work-card:hover .thumb img {
    opacity: 0.85;
  }
}

.work-card .title {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.2;
  min-width: 0;
}

.work-card:hover {
  text-decoration: none;
}

/* hover-reveal overlay cards (home grid) */

.work-card--overlay .thumb {
  position: relative;
}

.thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  text-align: center;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease-out;
}

.thumb-overlay-title {
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.thumb-overlay-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@media (hover: hover) and (pointer: fine) {
  .work-card--overlay:hover .thumb img,
  .work-card--overlay:focus-visible .thumb img {
    opacity: 1;
  }

  .work-card--overlay:hover .thumb-overlay,
  .work-card--overlay:focus-visible .thumb-overlay {
    opacity: 1;
  }

  .work-card--overlay .title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (hover: none), (pointer: coarse) {
  .thumb-overlay {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thumb-overlay {
    transition: none;
  }
}


/* ---------- project detail ---------- */

.detail-meta {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.2;
  color: var(--muted-foreground);
}

.detail-intro {
  margin-top: 24px;
  max-width: 640px;
}

.detail-images {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-images img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

/* ---------- media groups (category pages) ---------- */

.home-grid {
  margin-top: 32px;
}

.media-group {
  margin-top: 56px;
}

.group-title {
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 20px;
}

.media-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 32px;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.media-item {
  margin: 0;
  min-width: 0;
  max-width: 100%;
}

.media-grid > * {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.media-grid > .reveal {
  overflow-wrap: anywhere;
}

.media-grid.is-images {
  display: block;
  column-gap: 16px;
}

.media-grid.is-images > * {
  break-inside: avoid;
  margin-bottom: 16px;
}

.media-image {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.video-embed {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: var(--foreground);
  overflow: hidden;
}

.video-embed-fallback {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
}

/* ---------- video lightbox ---------- */

.video-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  padding: calc(64px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-left))
    calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right));
  background: rgba(0, 0, 0, 0.92);
  overflow: hidden;
  overscroll-behavior: contain;
}

.video-lightbox-inner {
  position: relative;
  width: min(900px, calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  min-width: 0;
  max-width: calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right));
}

/* Keep the player fully on screen: never wider than the viewport, and never
   taller than the space left after the close button and the Drive link. */
.video-lightbox-frame {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  margin-inline: auto;
  background: #000;
}

.video-lightbox--vertical .video-lightbox-frame {
  aspect-ratio: 9 / 16;
}

@supports (height: 100dvh) {
  .video-lightbox-frame {
    width: min(100%, calc((100dvh - 180px) * 16 / 9));
  }

  .video-lightbox--vertical .video-lightbox-frame {
    width: min(100%, calc((100dvh - 180px) * 9 / 16));
  }
}

.video-lightbox-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-lightbox-close {
  position: absolute;
  top: -52px;
  right: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.video-lightbox-open {
  display: inline-block;
  margin-top: 12px;
  color: var(--background);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}




.video-embed iframe,
.video-play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-play {
  display: block;
  padding: 0;
  background: none;
  cursor: pointer;
}

.video-play img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 300ms ease-out;
}

.video-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: var(--background);
}

.video-play-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent var(--foreground);
}

@media (hover: hover) and (pointer: fine) {
  .video-play:hover img {
    opacity: 0.82;
  }
}

.media-caption {
  margin-top: 10px;
  min-width: 0;
  max-width: 100%;
  font-size: 14px;
  line-height: 1.35;
  color: var(--muted-foreground);
  overflow-wrap: anywhere;
}

.back-link {
  display: inline-flex;
  margin-top: 64px;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- about ---------- */

.about {
  margin-top: 48px;
  padding-bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.about .portrait {
  max-width: 320px;
  width: 100%;
}

.about .portrait img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
}

.about p + p {
  margin-top: 24px;
}

.about .body {
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--foreground);
  color: var(--background);
  font-family: var(--font);
  font-size: 13px;
  letter-spacing: 0.01em;
  padding: 14px 28px;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

/* ---------- contact ---------- */

.contact {
  margin-top: 48px;
  padding-bottom: 48px;
}

.contact-inner {
  max-width: 600px;
  margin: 0 auto;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  margin-top: 24px;
  flex: 1 1 0;
  min-width: 0;
}

.form-row .field {
  margin-top: 0;
}

.field label {
  display: block;
  font-size: 16px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.field .req {
  color: var(--muted-foreground);
}

.field input,
.field textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--foreground);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 12px 14px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted-foreground);
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.field .error {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--error);
}

.success {
  font-size: 18px;
  line-height: 1.45;
}

/* ---------- 404 ---------- */

.notfound {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.notfound a {
  margin-top: 24px;
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   Breakpoints — values match the spec table exactly
   ========================================================================== */

/* 320–374: small phone (base overrides) */
@media (max-width: 374px) {
  :root {
    --pad: 16px;
    --hero-size: 30px;
    --heading-size: 24px;
    --body-size: 15px;
    --nav-size: 12px;
  }
}

@supports (width: 100dvw) and (height: 100dvh) {
  .video-lightbox {
    width: 100dvw;
    height: 100dvh;
    max-width: 100dvw;
  }

  .video-lightbox-inner {
    width: min(900px, calc(100dvw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));
    max-width: calc(100dvw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right));
  }
}

/* 414–767: large phone */
@media (min-width: 414px) {
  :root {
    --hero-size: 38px;
  }
}

/* landscape phones: cap large vertical gaps */
@media (max-width: 900px) and (orientation: landscape) {
  
  .about {
    margin-top: 40px;
  }
  .footer-cols,
  .footer-rule {
    margin-top: 32px;
  }
}

/* 768–1023: tablet */
@media (min-width: 768px) {
  :root {
    --pad: 32px;
    --hero-size: 52px;
    --heading-size: 34px;
    --body-size: 17px;
    --nav-size: 14px;
  }

  .site-header {
    gap: 20px;
  }
  .site-nav {
    gap: 4px 20px;
  }

  .hero {
    margin-top: 52px;
    width: 96%;
  }
  .footer-cols {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .footer-cols .col-contact {
    grid-column: 1 / -1;
  }
  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .media-grid.is-vertical {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .media-grid.is-images {
    columns: 2;
  }
  .home-grid {
    margin-top: 40px;
  }
  .detail-images {
    gap: 32px;
  }
  .about .portrait {
    max-width: 380px;
  }
  .about {
    gap: 40px;
  }
  .form-row {
    flex-direction: row;
  }
}

/* >=1024: desktop */
@media (min-width: 1024px) {
  :root {
    --pad: 40px;
    --hero-size: 60px;
    --heading-size: 38px;
    --body-size: 18px;
    --nav-size: 16px;
  }

  .site-header {
    gap: 24px;
  }
  .site-nav {
    gap: 4px 24px;
  }

  .hero {
    margin-top: 60px;
    width: 92%;
  }
  .work-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 44px;
  }
  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 44px;
  }
  .media-grid.is-vertical {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .media-grid.is-images {
    columns: 3;
  }
  .home-grid {
    margin-top: 50px;
  }
  .media-group {
    margin-top: 72px;
  }
  .page {
    margin-top: 80px;
    padding-bottom: 64px;
  }
  .detail-images {
    margin-top: 64px;
    gap: 40px;
  }

  .about {
    margin-top: 72px;
    padding-bottom: 64px;
    flex-direction: row;
    gap: 60px;
  }
  .about .portrait {
    flex: 0 0 35%;
    max-width: 35%;
  }
  .about .content {
    flex: 0 0 55%;
    min-width: 0;
  }

  .contact {
    margin-top: 80px;
    padding-bottom: 64px;
  }

  .footer-cols {
    margin-top: 64px;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
  }
  .footer-cols .col-contact {
    grid-column: auto;
  }
  .footer-rule {
    margin-top: 48px;
  }
  .footer-bottom {
    margin-top: 20px;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    text-align: left;
  }
  .site-footer {
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }
}

/* 1280+ desktop */
@media (min-width: 1280px) {
  :root {
    --hero-size: 72px;
    --heading-size: 40px;
  }
}

/* >=1600 wide */
@media (min-width: 1600px) {
  :root {
    --pad: 64px;
  }
}
