article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
  display: block;
}
audio,
canvas,
video {
  display: inline-block;
}
audio:not([controls]) {
  display: none;
  height: 0;
}
[hidden] {
  display: none;
}
html {
  font-family: sans-serif;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
}
a:focus {
  outline: thin dotted;
}
a:active,
a:hover {
  outline: 0;
}
h1 {
  font-size: 2em;
  margin: 0.67em 0;
}
abbr[title] {
  border-bottom: 1px dotted;
}
b,
strong {
  font-weight: bold;
}
dfn {
  font-style: italic;
}
hr {
  -moz-box-sizing: content-box;
  box-sizing: content-box;
  height: 0;
}
mark {
  background: #ff0;
  color: #000;
}
code,
kbd,
pre,
samp {
  font-family: monospace, serif;
  font-size: 1em;
}
pre {
  white-space: pre-wrap;
}
q {
  quotes: "\201C""\201D""\2018""\2019";
}
small {
  font-size: 80%;
}
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sup {
  top: -0.5em;
}
sub {
  bottom: -0.25em;
}
img {
  border: 0;
}
svg:not(:root) {
  overflow: hidden;
}
figure {
  margin: 0;
}
fieldset {
  border: 1px solid #c0c0c0;
  margin: 0 2px;
  padding: 0.35em 0.625em 0.75em;
}
legend {
  border: 0;
  padding: 0;
}
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  margin: 0;
}
button,
input {
  line-height: normal;
}
button,
select {
  text-transform: none;
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
  -webkit-appearance: button;
  cursor: pointer;
}
button[disabled],
html input[disabled] {
  cursor: default;
}
input[type="checkbox"],
input[type="radio"] {
  box-sizing: border-box;
  padding: 0;
}
input[type="search"] {
  -webkit-appearance: textfield;
  -moz-box-sizing: content-box;
  -webkit-box-sizing: content-box;
  box-sizing: content-box;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
  border: 0;
  padding: 0;
}
textarea {
  overflow: auto;
  vertical-align: top;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}
*,
*::after,
*::before {
  box-sizing: border-box;
}

:root {
  font-size: clamp(12px, 2.5vw, 16px);

  /* Typography */
  --font-family: fieldwork-hum, system-ui, -apple-system, sans-serif;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;

  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.6s ease;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.25);
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  height: 100%;
  overflow: hidden;

  /* Color variables */
  --color-text: #f0f0f0;
  --color-bg: #1a1a1a;
  --color-link: #4a90e2;
  --color-link-hover: #6ab7ff;
  --color-menu-text: #ffffff;
  --color-bg-move: #222222;
  --color-secondary: #a0a0a0;
  --color-accent: #4a90e2;
  --color-accent-dark: #357abd;
  --color-card-bg: rgba(255, 255, 255, 0.12);
  --color-card-border: rgba(255, 255, 255, 0.18);
  --color-overlay: rgba(0, 0, 0, 0.6);

  /* Visual styles */
  color: var(--color-text);
  background-color: var(--color-bg);
  font-family: var(--font-family);
  font-weight: var(--font-weight-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;

  /* Performance optimizations */
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

main {
  width: 100%;
  height: 100%;
  position: relative;
  display: grid;
  grid-template: 1fr / 1fr;
  place-items: center;
  container-type: inline-size;
}

.js main {
  overflow: auto;
}

.cursor {
  display: none;
}

/* Page Loader */
.js .loading::before {
  content: "";
  position: fixed;
  z-index: 100000;
  inset: 0;
  background: var(--color-bg);
}

.js .loading::after {
  content: "";
  position: fixed;
  z-index: 100000;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  border-radius: 50%;
  opacity: 0.4;
  background: var(--color-link);
  animation: loaderAnim 0.7s linear infinite alternate forwards;
}

@keyframes loaderAnim {
  to {
    opacity: 1;
    transform: scale3d(0.5, 0.5, 1);
  }
}

a {
  text-decoration: none;
  color: var(--color-link);
}

a:hover,
a:focus {
  color: var(--color-link-hover);
  outline: 0;
}

.frame {
  padding: 1rem;
  text-align: center;
  position: relative;
  z-index: 1000;
  grid-area: 1 / 1 / 2 / 2;
  align-self: start;
}

.frame__title {
  font-size: 1rem;
  margin: 0 0 1rem;
}

.frame__links {
  display: inline;
}

.frame__github,
.frame__links a:not(:last-child),
.frame__demos a:not(:last-child) {
  margin-right: 1rem;
}

.frame__demos {
  margin: 1rem 0;
}

.frame__demo--current,
.frame__demo--current:hover {
  color: var(--color-text);
}

.content,
.content__move {
  width: 100%;
  height: 100vh;
  display: grid;
  grid-template: 1fr / 1fr;
  place-items: center;
  grid-area: 1 / 1;
  justify-self: center;
  position: relative;
  will-change: transform;
}

.content--first {
  position: fixed;
  top: 0;
  left: 0;
  overflow: hidden;
}

.content__move {
  background: var(--color-bg-move);
}

.columns {
  grid-area: 1 / 1;
  width: 100%;
  height: 100vh;
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 100%;
  gap: var(--space-md);
  padding-inline: min(8vw, var(--space-2xl));
}

.column {
  position: relative;
  align-self: start;
  will-change: transform;
  contain: layout style paint;
}

.column--bottom {
  align-self: end;
}

.column__img {
  width: 100%;
  display: block;
  opacity: 0.25;
  background-size: contain;
  background-position: 50% 50%;
  background-repeat: no-repeat;
  height: 12vw;
  filter: brightness(0.8) contrast(1.1);
}

.column__img:nth-child(odd) {
  height: 12vw;
}

.column__img:not(:last-child) {
  margin-bottom: var(--space-md);
}

.menu {
  grid-area: 1 / 1;
  width: 100vw;
  height: 100vh;
  padding-block: 15vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

.menu__item {
  display: flex;
  font-weight: var(--font-weight-extrabold);
  font-size: clamp(6.5rem, 16vw, 20rem);
  line-height: 1.1;
  cursor: pointer;
  padding-bottom: var(--space-sm);
  -webkit-text-stroke: 2px var(--color-menu-text);
  text-stroke: 2px var(--color-menu-text);
  -webkit-text-fill-color: transparent;
  text-fill-color: transparent;
  color: transparent;
  transition: var(--transition-normal);
}

.menu__item:hover {
  -webkit-text-fill-color: var(--color-menu-text);
  text-fill-color: var(--color-menu-text);
  color: var(--color-menu-text);
}

.item {
  position: relative;
}

.js .item {
  grid-area: 1 / 1;
  opacity: 0;
  pointer-events: none;
}

.js .item--current {
  opacity: 1;
  pointer-events: auto;
}

.item__img {
  height: 300px;
  width: 100%;
  flex: none;
  background-size: contain;
  background-position: 50% 50%;
  background-repeat: no-repeat;
  opacity: 0.3;
  filter: brightness(0.75) contrast(1.2);
}

.item__content {
  padding: var(--space-lg);
  max-width: 60ch;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.item__content-title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0;
  line-height: 1.2;
  pointer-events: none;
  font-weight: var(--font-weight-bold);
}

.menu__item span,
.item__content-title span {
  display: inline-block;
  white-space: pre;
  pointer-events: none;
  will-change: transform;
  transform-origin: center center;
  transform: translate3d(0, 0, 0) rotate(0deg);
}

.item__content-subtitle {
  font-weight: var(--font-weight-normal);
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
}

.item__content-text {
  margin: 5vh 0 var(--space-2xl) 0;
  position: relative;
  line-height: 1.6;
  max-height: none;
  overflow: visible;
}

.item__content-text::after {
  content: "";
  width: var(--space-lg);
  height: 2px;
  position: absolute;
  background: currentColor;
  top: calc(100% + var(--space-xl));
}

.item__content-back {
  cursor: pointer;
}

@container (min-width: 53em) {
  .js main {
    overflow: hidden;
  }
  .frame {
    position: fixed;
    text-align: left;
    z-index: 10000;
    top: 0;
    left: 0;
    display: grid;
    align-content: space-between;
    width: 100%;
    max-width: none;
    height: 100vh;
    padding: var(--space-xl) var(--space-2xl);
    pointer-events: none;
    grid-template-columns: 50% 50%;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "title ..."
      "... ..."
      "links links";
  }
  .frame__title-wrap {
    grid-area: title;
    display: flex;
  }
  .frame__title {
    margin: 0;
    font-weight: normal;
  }
  .frame__links {
    grid-area: links;
    padding: 0;
    justify-self: end;
  }
  .frame a {
    pointer-events: auto;
  }
  .menu__item {
    font-size: clamp(10rem, 13vh, 15rem);
  }
  .item {
    height: 100%;
    width: 100%;
    display: flex;
  }
  .item__img {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 45%;
    background-position: 50% 50%;
    background-size: 80%;
  }
  .item__content {
    padding: 15vh min(12vw, var(--space-2xl)) 0 min(8vw, var(--space-xl));
    max-width: 50vw;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow: visible;
  }
  .item__content-title {
    font-size: 5vw;
  }
  .item__content-subtitle {
    font-size: 2vw;
  }
  .item__content-text {
    margin-bottom: 0;
  }
}

@media (any-pointer: fine) {
  .cursor {
    display: block;
  }
  .cursor__inner {
    z-index: 9999;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    mix-blend-mode: difference;
    border-radius: 50%;
    will-change: transform;
    contain: layout style paint;
  }
  .cursor__inner--circle {
    width: 25px;
    height: 25px;
    border: 1px solid #4a90e2;
    box-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
  }
}

/* スキルグリッドレイアウト */
.item__content-text {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

/* ポートフォリオグリッドレイアウト */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.portfolio-card {
  background: var(--color-card-bg);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--color-card-border);
  backdrop-filter: blur(10px);
  transition: all 0.4s ease;
  position: relative;
}

.portfolio-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  background: rgba(255, 255, 255, 0.12);
}

.portfolio-card.featured {
  border: 2px solid var(--color-accent);
}

.portfolio-image {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
}

.portfolio-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.portfolio-card:hover .portfolio-image img {
  transform: scale(1.05);
}

.portfolio-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.placeholder-text {
  color: var(--color-text);
  font-weight: 600;
  font-size: 1.2rem;
}

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--color-overlay) 100%
  );
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.portfolio-card:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-tag {
  background: var(--color-text);
  color: #1a1a1a;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

.portfolio-content {
  padding: 1.5rem;
}

.portfolio-header {
  margin-bottom: 1rem;
}

.portfolio-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
}

.portfolio-company {
  font-size: 0.8rem;
  color: var(--color-secondary);
  font-weight: 500;
}

.portfolio-description {
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(224, 224, 224, 0.8);
  margin: 0 0 1rem 0;
}

.portfolio-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.portfolio-role {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text);
}

.portfolio-period {
  font-size: 0.7rem;
  color: var(--color-secondary);
}

.portfolio-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: rgba(74, 144, 226, 0.15);
}

.portfolio-link:hover {
  background: rgba(74, 144, 226, 0.25);
  transform: translateX(2px);
}

.portfolio-link.disabled {
  color: var(--color-secondary);
  background: rgba(255, 255, 255, 0.05);
  cursor: default;
}

.portfolio-link.disabled:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.05);
}

.portfolio-link svg {
  transition: transform 0.3s ease;
}

.portfolio-link:hover svg {
  transform: translate(2px, -2px);
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
  .column__img {
    height: 20vw;
    background-size: contain;
    background-position: center;
    min-height: 60px;
  }

  .column__img:nth-child(odd) {
    height: 25vw;
    min-height: 80px;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .portfolio-image {
    height: 200px;
  }

  .portfolio-content {
    padding: 1rem;
  }

  .portfolio-details {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .item__img {
    display: block;
    width: 90%;
    height: 200px;
    margin: 0 auto;
    background-position: 50% 50%;
    background-size: contain;
  }

  .item__content-text {
    margin: var(--space-md) 0 var(--space-md) 0;
  }

  .item__content-text::after {
    top: calc(100% + var(--space-sm));
  }
}

@media screen and (min-width: 53em) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  .portfolio-image {
    height: 220px;
  }
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
}

.skills-column {
  background: var(--color-card-bg);
  border-radius: 12px;
  padding: 1.2rem;
  border: 1px solid var(--color-card-border);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.skills-column:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.skills-category {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  position: relative;
  padding-bottom: 0.5rem;
}

.skills-category::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 2px;
  background: linear-gradient(
    45deg,
    var(--color-accent) 0%,
    var(--color-accent-dark) 100%
  );
  border-radius: 1px;
}

.skill-item-compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0.8rem 0;
  padding: 0.8rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: all 0.3s ease;
  text-align: center;
}

.skill-item-compact:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.02);
}

.skill-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}

.skill-rating {
  display: flex;
  gap: 2px;
  margin-bottom: 0.4rem;
}

.star {
  font-size: 0.9rem;
  color: #2a2a2a;
  transition: all 0.2s ease;
}

.star.filled {
  color: #ffa500;
  text-shadow: 0 0 8px rgba(255, 165, 0, 0.7);
}

.star.half-filled {
  background: linear-gradient(90deg, #ffa500 50%, #2a2a2a 50%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

.skill-item-compact:hover .star.filled {
  color: #ffb500;
  text-shadow: 0 0 8px rgba(255, 165, 0, 0.8);
  transform: scale(1.1);
}

.skill-years {
  font-size: 0.7rem;
  color: var(--color-secondary);
  font-weight: 400;
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .skills-column {
    padding: 1rem 6rem;
  }

  .skill-item-compact {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 0.6rem 0.8rem;
  }

  .skill-name {
    margin-bottom: 0;
    flex: 1;
  }

  .skill-rating {
    margin-bottom: 0;
    margin-right: 0.5rem;
  }

  .skill-years {
    min-width: 40px;
    text-align: right;
  }

  .item {
    position: absolute;
    top: 0;
    padding-top: 4rem;
  }
}

@media screen and (min-width: 53em) {
  .skills-grid {
    gap: 2rem;
  }

  .skills-column {
    padding: 1.5rem;
  }

  .skill-name {
    font-size: 0.9rem;
  }

  .star {
    font-size: 1rem;
  }

  .skill-years {
    font-size: 0.75rem;
  }
}

/* プロフィール情報スタイル */
.profile-info {
  background: var(--color-card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 0 0 2rem 0;
  border: 1px solid var(--color-card-border);
  backdrop-filter: blur(10px);
}

.profile-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-item:last-child {
  border-bottom: none;
}

.profile-label {
  font-weight: 600;
  color: var(--color-secondary);
  font-size: 0.9rem;
  min-width: 80px;
}

.profile-value {
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.95rem;
  text-align: right;
  flex: 1;
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
  .profile-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .profile-value {
    text-align: left;
  }
}

/* About Me画像サイズ調整 */
.about-me-img {
  background-size: 55% !important;
}

/* About Me SVG animation */
.content__img--about {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.item--current .content__img--about {
  opacity: 1;
}

/* SNSリンク */
.social-links {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 1000;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.social-link svg {
  transition: transform 0.3s ease;
}

.social-link:hover svg {
  transform: scale(1.1);
}

/* メールリンクスタイル */
.email-link {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.email-link:hover {
  color: #e1e1e1;
  text-decoration-color: #fff;
}

/* レスポンシブ対応 - SNSリンク */
@media screen and (max-width: 768px) {
  .social-links {
    bottom: 1rem;
    right: 1rem;
    gap: 0.75rem;
  }

  .social-link {
    width: 45px;
    height: 45px;
  }

  .social-link svg {
    width: 18px;
    height: 18px;
  }
}
