html {
  scroll-behavior: smooth;
}

#starCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#loading {
    transition: all 1s;
    background-color: #ddd;
    position: fixed;
    z-index: 9999;
    inset: 0;
    display: grid;
    place-items: center;
}

.loaded {
    opacity: 0;
    visibility: hidden;
}

.dots { display: flex; align-items: center; justify-content: center; }
.dots .dot {
    width: 8px; height: 8px;
    margin: 0 5px;
    background-color: #6c5ce7;
    border-radius: 50%;
    animation: dot-pulse 1.4s ease-in-out infinite;
}
.dots .dot:nth-child(1) { animation-delay: 0s; }
.dots .dot:nth-child(2) { animation-delay: 0.2s; }
.dots .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-pulse {
    0%, 100% { transform: scale(0.7); opacity: 0.7; }
    50% { transform: scale(1); opacity: 1; }
}

section {
  padding: 50px 0;
}

.about_me,
.thinking,
.Skills,
.experience,
.works,
.sites,
.vision,
.contact {
    width: min(88%, 1100px);
    margin: 0 auto;
}

p{
   font-size: 18px;
   line-height: 2;
   margin-bottom: 24px;
   color: #4a4444;
}

.about_me p,
.thinking p,
.experience p,
.vision p {
    max-width: 760px;
}

main {
  position: relative;
  z-index: 1;
  background: #f5f5f3;
  color: #2c2323;
}

.hero-content {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  text-align: center;
  transition: opacity .6s ease, transform .6s ease;
}

.hero-content.is-hidden {
  opacity: 0;
  transform: translateY(28px);
  pointer-events: none;
}

.hero-title {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.16em;
  color: var(--text);
}

.hero-subtitle {
  margin: 14px 0 0;
  font-size: clamp(0.72rem, 1.5vw, 0.9rem);
  font-weight: 300;
  letter-spacing: 0.36em;
  color: var(--muted);
}

.menubutton {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    background: black;
    cursor: pointer;
    z-index: 200;
}
.menubutton i {
    display: block;
    position: absolute;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 30px;
    height: 5px;
    background: white;
    transition: all .5s;
}
.menubutton i:first-child {
    top: 10px;
}
.menubutton i:nth-child(2) {
    top: 50%;
}
.menubutton i:last-child {
    top: 30px;
}
.menubutton.open i:first-child {
    top: 50%;
    transform: translate(-50%,-50%) rotate(45deg);
}
.menubutton.open i:nth-child(2) {
    opacity: 0;
}
.menubutton.open i:last-child {
    top: 50%;
    transform: translate(-50%,-50%) rotate(-45deg);
}

.menu {
    position: fixed;
    top: 0;
    left: -200px;
    width: 200px;
    height: 100vh;
    background: rgb(199, 196, 196);
    transition: all .5s;
    z-index: 150;
}
.menu ul {
    margin: 40px 0 0 0;
    padding: 0;
    list-style: none;
}
.menu li {
    padding: 5px 0;
    text-align: center;
    margin-left: -20px;
    opacity: 0;
    transition:
        margin-left .5s,
        opacity .5s,
        background-color .15s,
        color .15s;
}
.menu.open {
    left: 0;
}
.menu.open li {
    margin-left: 0;
    opacity: 1;
}
.menu.open li:hover {
    background-color: black;
    color: white;
}
.menu.open li:first-child {
    transition-delay: .5s, .5s, 0s, 0s;
}
.menu.open li:nth-child(2) {
    transition-delay: .7s, .7s, 0s, 0s;
}
.menu.open li:nth-child(3) {
    transition-delay: .9s, .9s, 0s, 0s;
}
.menu.open li:nth-child(4) {
    transition-delay: 1.1s, 1.1s, 0s, 0s;
}

.title{
    padding: 10px 14px;
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 0.12em;
}

#work {
    width: min(88%, 1100px);
    margin: 0 auto;
    padding: 30px 0;
    display: flex;
    flex-direction: column;
    gap: 120px;
}

.work-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
}

.work-item.reverse .work-text {
    order: 2;
}

.work-item.reverse .work-image {
    order: 1;
}

.work-text h2 {
    margin: 0 0 20px;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.2;
}

.work-text p {
    margin: 0 0 18px;
    font-size: 1.05rem;
    line-height: 1.9;
}

.work-text .tech {
    margin-top: 28px;
    font-weight: 600;
    color: #2c2323;
}

.work-image img {
    width: 100%;
    display: block;
    border-radius: 18px;
    border: 1px solid rgba(44, 35, 35, 0.12);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    transition: transform .35s ease, box-shadow .35s ease;
}

.work-item:hover .work-image img {
    transform: scale(1.02);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.12);
}

@media (max-width: 900px) {
    .work-item,
    .work-item.reverse {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .work-item.reverse .work-text,
    .work-item.reverse .work-image {
        order: initial;
    }

    #work {
        gap: 72px;
    }
}

.contact {
    width: min(88%, 1100px);
    margin: 0 auto;
    padding: 100px 0;
}

.contact form {
    max-width: 720px;
}

.contact .title {
    margin-bottom: 40px;
}

/* ラベルのスタイル */
label {
    display: block;
    margin-top: 32px;
    font-size: 14px;
    color: #6b6565;
}

/* 入力欄のスタイル */
input, textarea {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.2);
    background: transparent;
    font-size: 16px;
    outline: none;
}

input:focus,
textarea:focus {
    border-bottom: 1px solid #2c2323;
}

/* テキストエリアの高さを調整 */
textarea {
    resize: vertical;
    height: 120px;
}

/* 送信ボタンのスタイル */
button {
    margin-top: 40px;
    padding: 12px 24px;
    background: transparent;
    border: 1px solid #2c2323;
    color: #2c2323;
    cursor: pointer;
    transition: all .2s;
}

/* ホバー時のボタンスタイル */
button:hover {
    background: #2c2323;
    color: white;
}

.hero-actions {
  margin-top: 32px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-link {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid #2c2323;
  color: #2c2323;
  text-decoration: none;
  transition: all .2s;
}

.hero-link:hover {
  background: #2c2323;
  color: white;
}

.hero-link.primary {
  background: #2c2323;
  color: white;
}

.hero-link.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  opacity: 0.92;
}

.contact-note {
    max-width: 720px;
    margin-bottom: 24px;
}

.contact-note p {
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.9;
}

.contact-privacy {
    color: #6b6565;
}

.contact-status {
    max-width: 720px;
    min-height: 24px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.6;
}

.contact-status.error {
    color: #b00020;
}

.contact-status.success {
    color: #166534;
}

select {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.2);
    background: transparent;
    font-size: 16px;
    outline: none;
}

select:focus {
    border-bottom: 1px solid #2c2323;
}

.contact-policy {
    margin-top: 28px;
    padding: 16px 18px;
    border: 1px solid rgba(44, 35, 35, 0.12);
    background: rgba(255, 255, 255, 0.55);
    max-width: 720px;
}

.contact-policy p {
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.contact-policy ul {
    margin: 0;
    padding-left: 20px;
    color: #4a4444;
}

.contact-policy li {
    margin-bottom: 6px;
    line-height: 1.8;
    font-size: 14px;
}

.consent-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 24px;
    cursor: pointer;
}

.consent-row input[type="checkbox"] {
    width: auto;
    margin-top: 4px;
}

.consent-row span {
    font-size: 14px;
    color: #4a4444;
    line-height: 1.8;
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.sites {
    padding: 100px 0;
}

.sites .title {
    margin-bottom: 40px;
}

.site-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 56px;
    align-items: stretch;
}

.site-card {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    transition: transform .35s ease;
}

.site-card:hover {
    transform: translateY(-4px);
}

.site-tag {
    display: inline-block;
    margin-bottom: 18px;
    font-size: 0.8rem;
    color: #6b6565;
    letter-spacing: 0.08em;
}

.site-card h3 {
    margin: 0 0 24px;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1.25;
    color: #2c2323;
}

.site-card p {
    margin: 0 0 18px;
    font-size: 1.05rem;
    line-height: 1.9;
    color: #4a4444;
}

.site-card a {
    display: inline-block;
    margin-top: 18px;
    color: #2c2323;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
}

.site-card a:hover {
    opacity: 0.65;
}

@media (max-width: 900px) {
    .site-list {
        grid-template-columns: 1fr;
        gap: 56px;
    }
}

/* ==============================
   Site image
============================== */

.site-card {
    overflow: hidden;
}

.site-image {
    display: block;
    width: 100%;
    margin-bottom: 26px;
    border-radius: 22px;
    overflow: hidden;
}

.site-image img {
    display: block;
    width: 100%;
    height: 260px;

    object-fit: cover;
    object-position: top;

    transition: transform .5s ease;
}

.site-card:hover .site-image img {
    transform: scale(1.03);
}