/* Progressive enhancements layered on top of the main developer theme. */

.skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 1000;
  padding: .7rem 1rem;
  border: 1px solid var(--blue);
  background: var(--black);
  color: var(--white);
  font-family: var(--mono);
  font-size: .8rem;
  transform: translateY(-180%);
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }
.skip-link span { color: rgba(255,255,255,.7); }

#main-content:focus { outline: none; }
[data-page-section] { scroll-margin-top: 78px; }

/* Faster reveals: navigation targets become visible immediately in script.js. */
.reveal {
  transform: translateY(.7rem);
  transition-duration: .42s;
}

.nav-short { display: none; }

/* English is primary; Japanese is supporting context. */
.hero-primary {
  max-width: 34rem;
  margin: 1rem 0 .35rem;
  color: var(--white);
  font-family: var(--mono);
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -.025em;
}
.hero-jp,
.jp-sub,
.detail-jp {
  color: rgba(255,255,255,.58);
}
.hero-jp { font-size: clamp(.86rem, 1.2vw, 1rem); }
.jp-sub {
  margin-top: .8rem;
  font-size: max(.82rem, 13px) !important;
  line-height: 1.8;
}
.detail-jp {
  display: block;
  margin-top: .28rem;
  font-size: .78rem;
  line-height: 1.65;
}
.project-jp { max-width: 47rem; }

/* Keep utility text legible without losing the terminal look. */
.nav,
.github-mini,
.eyebrow,
.command-title,
.stack-path,
.repo-visibility,
.repo-footer,
.hero-statusbar,
.readme-head,
.footer,
.repo-tags span,
.about-links a,
.button {
  font-size: .75rem;
}

.nav a,
.github-mini {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: .35rem;
}

.nav a[aria-current="location"] { color: var(--white); }
.nav a[aria-current="location"]::before {
  content: "●";
  margin-right: .45rem;
  color: var(--blue);
  font-size: .68rem;
}

.terminal-body,
.editor-code,
.stack-card p,
.command-strip,
.contact-terminal,
.form-status {
  font-size: max(.75rem, 12px);
}

.about-text p,
.repo-description,
.project-details dd,
.contact-copy > p,
.form-row input,
.form-row textarea {
  font-size: max(.875rem, 14px);
}

.hero-statusbar,
.repo-visibility,
.repo-footer,
.readme-head,
.footer {
  color: rgba(255,255,255,.72);
}
.stack-card p,
.contact-output,
.placeholder,
.about-text p,
.repo-description {
  color: rgba(255,255,255,.68);
}

.editor-wrap {
  position: relative;
  min-width: 0;
}
.scroll-hint { display: none; }

.single-project { grid-template-columns: 1fr; }
.single-project .repo-card {
  min-height: 0;
  padding-bottom: 5rem;
}

.project-details {
  display: grid;
  gap: .65rem;
  margin: 1.7rem 0 0;
  padding: 1rem 0;
  border-top: 1px solid rgba(255,255,255,.12);
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.project-details div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1rem;
}
.project-details dt {
  color: var(--blue);
  font-family: var(--mono);
  font-size: .75rem;
}
.project-details dt span {
  display: block;
  margin-top: .12rem;
  color: rgba(255,255,255,.48);
  font-size: .68rem;
  font-weight: 400;
}
.project-details dd {
  margin: 0;
  color: rgba(255,255,255,.76);
}
.project-details code {
  color: var(--white);
  font-family: var(--mono);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0,.8fr) minmax(26rem,1.2fr);
  gap: clamp(2rem,6vw,6rem);
  align-items: start;
}
.contact-copy {
  position: sticky;
  top: 7rem;
}
.contact-kicker {
  margin: 0 0 1rem;
  color: var(--blue) !important;
  font-family: var(--mono);
  font-size: .75rem !important;
}
.contact-copy h3 {
  margin: 0 0 1.2rem;
  font-family: var(--mono);
  font-size: clamp(1.7rem,3.6vw,3.2rem);
  line-height: 1.15;
  letter-spacing: -.05em;
}
.contact-channel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 52px;
  margin-top: 2rem;
  padding: .8rem 1rem;
  border: 1px solid rgba(255,255,255,.18);
  font-family: var(--mono);
  font-size: .8rem;
  transition: border-color .2s ease, background .2s ease;
}
.contact-channel + .contact-channel { margin-top: .75rem; }
.contact-channel:hover,
.contact-channel:focus-visible {
  border-color: var(--blue);
  background: rgba(0,102,255,.1);
}
.contact-channel strong { color: var(--blue); font-weight: 700; }

.inquiry-form {
  padding: clamp(1.1rem,3vw,2rem);
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.84);
}
.form-row {
  display: grid;
  gap: .45rem;
  margin-bottom: 1rem;
}
.form-row label {
  color: rgba(255,255,255,.88);
  font-family: var(--mono);
  font-size: .8rem;
}
.form-row label span {
  display: block;
  margin-top: .1rem;
  color: rgba(255,255,255,.5);
  font-size: .72rem;
  font-weight: 400;
}
.form-row input,
.form-row textarea {
  width: 100%;
  min-height: 44px;
  padding: .75rem .85rem;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 0;
  outline: none;
  background: rgba(255,255,255,.035);
  color: var(--white);
  font-family: var(--mono);
  resize: vertical;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.form-row textarea { min-height: 9rem; }
.form-row input::placeholder,
.form-row textarea::placeholder { color: rgba(255,255,255,.48); }
.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(0,102,255,.18);
}
.form-actions {
  display: grid;
  gap: .75rem;
  margin-top: 1.25rem;
}
.form-actions .button {
  width: fit-content;
  cursor: pointer;
}
.form-status {
  margin: 0;
  color: rgba(255,255,255,.66);
  line-height: 1.55;
}
.form-status span { color: rgba(255,255,255,.5); }
.form-status.success { color: var(--white); }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  /* Keep navigation visible on tablets and phones. */
  .site-header {
    grid-template-columns: auto 1fr;
    gap: 1rem;
  }
  .nav {
    display: flex !important;
    justify-self: end;
    gap: clamp(.45rem, 2vw, 1rem);
  }
  .nav-long { display: none; }
  .nav-short { display: inline; }
  .nav a {
    padding-inline: .2rem;
    font-size: .68rem;
    letter-spacing: .03em;
  }
  .nav a[aria-current="location"]::before { display: none; }
  .nav a[aria-current="location"] { border-bottom: 2px solid var(--blue); }
  .github-mini { display: none; }

  .contact-grid { grid-template-columns: 1fr; }
  .contact-copy { position: static; }
}

@media (max-width: 680px) {
  [data-page-section] { scroll-margin-top: 72px; }

  .site-header {
    grid-template-columns: auto minmax(0, 1fr) !important;
    min-height: 62px !important;
    padding-inline: .75rem !important;
    gap: .55rem;
  }
  .brand { font-size: .82rem; }
  .nav {
    width: 100%;
    min-width: 0;
    justify-content: flex-end;
    gap: .2rem;
  }
  .nav a {
    flex: 0 1 auto;
    min-height: 40px;
    padding: 0 .28rem;
    font-size: clamp(.58rem, 2.65vw, .67rem);
  }

  .terminal-body {
    min-height: 24rem;
    padding: 1rem;
    font-size: 13px;
  }
  .code-output { font-size: 13px; }

  .editor-wrap::after {
    content: "";
    position: absolute;
    z-index: 3;
    top: 2.7rem;
    right: 0;
    bottom: 1.8rem;
    width: 2.2rem;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(0,102,255,.18));
  }
  .editor { overflow-x: auto; }
  .editor-code { min-width: 34rem; }
  .scroll-hint {
    display: flex;
    justify-content: flex-end;
    gap: .55rem;
    margin: .45rem 0 0;
    color: rgba(255,255,255,.5);
    font-family: var(--mono);
    font-size: .7rem;
  }
  .scroll-hint span { color: rgba(255,255,255,.38); }

  .project-details div { grid-template-columns: 1fr; gap: .25rem; }
  .project-details dt span { display: inline; margin-left: .35rem; }
  .detail-jp { font-size: .76rem; }

  /* Prevent iPhone Safari from zooming form controls on focus. */
  .form-row input,
  .form-row textarea { font-size: 16px; }
  .form-actions .button { width: 100%; }

  .contact-channel {
    align-items: flex-start;
    flex-direction: column;
    gap: .2rem;
  }

  .footer { font-size: .75rem; }
}

@media (max-width: 390px) {
  .brand .prompt-mark { display: none; }
  .nav a { padding-inline: .2rem; }
}
