/* =========================================================
   Portfolio Front Page — portfolio-front.css
   Top-designer-level redesign. Mobile First.
   ========================================================= */

/* ---------------------------------------------------------
   Custom Properties
   --------------------------------------------------------- */
:root {
    --pf-bg:          #ECEAE4;   /* warm off-white (既存 #ecece7 に近い) */
    --pf-bg-2:        #F5F3EE;   /* lighter off-white */
    --pf-text:        #1C1A16;   /* near-black warm */
    --pf-mid:         #7A756D;   /* secondary text */
    --pf-light:       #B0AB9F;   /* tertiary text */
    --pf-accent:      #A28D69;   /* gold/caramel — 既存ヘッダーと統一 */
    --pf-accent-d:    #8A7455;   /* darker accent */
    --pf-border:      rgba(28, 26, 22, 0.1);
    --pf-dark:        #151411;   /* contact section bg */
    --pf-dark-2:      #1E1C18;   /* slightly lighter dark */

    --pf-font-display: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    --pf-font-ja:      'Noto Sans JP', sans-serif;

    --pf-ease:   cubic-bezier(0.16, 1, 0.3, 1);
    --pf-ease-out: cubic-bezier(0.25, 1, 0.35, 1);
    --pf-max-w:  1280px;
}

/* ---------------------------------------------------------
   Base (scoped to .pf-main)
   --------------------------------------------------------- */
.pf-main {
    font-family: var(--pf-font-ja);
    font-weight: 300;
    color: var(--pf-text);
    background: var(--pf-bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.pf-main * { box-sizing: border-box; }
.pf-main img { display: block; max-width: 100%; }

/* ---------------------------------------------------------
   Hero title — 1文字ずつ表示アニメーション
   --------------------------------------------------------- */
.pf-hero-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.55em);
    animation: pfHeroCharIn 0.55s var(--pf-ease) both;
}

@keyframes pfHeroCharIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------------------------------------------------------
   Reveal animation — mask slide-up (role / desc / btns 用)
   --------------------------------------------------------- */
.pf-reveal {
    display: block;
    overflow: hidden;
    line-height: 1.1;
}

.pf-reveal__inner {
    display: block;
    transform: translateY(108%);
    transition: transform 1s var(--pf-ease);
}

/* Delays for role */
.pf-reveal--d1 .pf-reveal__inner { transition-delay: 0.18s; }
.pf-reveal--d2 .pf-reveal__inner { transition-delay: 0.34s; }
.pf-reveal--d3 .pf-reveal__inner { transition-delay: 0.54s; }

/* Trigger: .pf-hero.is-loaded activates role/desc/btns */
.pf-hero.is-loaded .pf-reveal__inner { transform: translateY(0); }

/* Fade animation (for non-reveal elements) */
.pf-fade {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.9s ease, transform 0.9s var(--pf-ease);
}

.pf-fade--d3 { transition-delay: 0.7s; }
.pf-fade--d4 { transition-delay: 0.9s; }

.pf-hero.is-loaded .pf-fade { opacity: 1; transform: none; }

/* Section scroll-reveal */
.pf-reveal-block {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--pf-ease), transform 0.8s var(--pf-ease);
}

.pf-reveal-block.is-visible {
    opacity: 1;
    transform: none;
}

/* ---------------------------------------------------------
   Shared utilities
   --------------------------------------------------------- */
.pf-eyebrow {
    font-family: var(--pf-font-display);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--pf-accent);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.pf-eyebrow::before {
    content: '';
    display: block;
    width: 28px;
    height: 1px;
    background: currentColor;
    flex-shrink: 0;
}

.pf-eyebrow--light { color: rgba(255,255,255,0.5); }
.pf-eyebrow--light::before { background: rgba(255,255,255,0.35); }

.pf-link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--pf-font-ja);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--pf-text);
    border-bottom: 1px solid var(--pf-border);
    padding-bottom: 4px;
    transition: gap 0.35s ease, border-color 0.35s ease, color 0.3s ease;
    text-decoration: none;
}

.pf-link-arrow:hover {
    gap: 18px;
    border-color: var(--pf-accent);
    color: var(--pf-accent-d);
}

.pf-no-content {
    text-align: center;
    padding: 80px 20px;
    color: var(--pf-mid);
    font-size: 15px;
}

/* ---------------------------------------------------------
   HERO
   --------------------------------------------------------- */
.pf-hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(120px, 15vw, 160px) clamp(20px, 6vw, 80px) clamp(80px, 10vw, 120px);
    overflow: hidden;
}

/* Subtle grid texture */
.pf-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(28,26,22,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(28,26,22,0.03) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
    z-index: 0;
}

.pf-hero__inner {
    position: relative;
    z-index: 1;
    max-width: var(--pf-max-w);
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
}

/* Role */
.pf-hero__role {
    font-family: var(--pf-font-ja);
    font-size: clamp(11px, 1.2vw, 13px);
    font-weight: 400;
    letter-spacing: 0.2em;
    color: var(--pf-mid);
    margin-bottom: clamp(20px, 3vw, 36px);
    overflow: hidden;
}

/* Name — 文字アニメーション対象 */
.pf-hero__name {
    font-family: var(--pf-font-display);
    font-size: clamp(58px, 9.5vw, 148px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 0.95;
    margin: 0 0 clamp(16px, 2vw, 28px);
    word-break: keep-all;
}

.pf-hero__name-rule {
    display: block;
    height: 1px;
    background: var(--pf-border);
    margin: clamp(10px, 1.5vw, 20px) 0;
    transform-origin: left;
    animation: ruleExpand 1s var(--pf-ease) 0.5s both;
}

@keyframes ruleExpand {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

/* Description */
.pf-hero__desc {
    font-family: var(--pf-font-ja);
    font-size: clamp(13px, 1.3vw, 15px);
    font-weight: 300;
    line-height: 2;
    letter-spacing: 0.08em;
    color: var(--pf-mid);
    margin-bottom: clamp(28px, 4vw, 48px);
}

/* Buttons */
.pf-hero__btns {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.pf-hero__btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--pf-font-ja);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.1em;
    padding: 14px 28px;
    border-radius: 100px;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.3s ease, color 0.3s ease;
}

.pf-hero__btn:hover { transform: translateY(-2px); }

.pf-hero__btn--primary {
    background: var(--pf-text);
    color: var(--pf-bg);
    box-shadow: 0 4px 24px rgba(28, 26, 22, 0.2);
}

.pf-hero__btn--primary:hover {
    background: var(--pf-accent-d);
    box-shadow: 0 8px 28px rgba(28, 26, 22, 0.25);
    color: #fff;
}

.pf-hero__btn--ghost {
    background: transparent;
    color: var(--pf-text);
    border: 1px solid var(--pf-border);
}

.pf-hero__btn--ghost:hover {
    border-color: var(--pf-accent);
    color: var(--pf-accent-d);
    background: rgba(162, 141, 105, 0.06);
}

/* Decorative side element */
.pf-hero__deco {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    opacity: 0;
    animation: fadeInRight 1.2s var(--pf-ease) 1s both;
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: none; }
}

.pf-hero__deco-num {
    font-family: var(--pf-font-display);
    font-size: clamp(56px, 7vw, 100px);
    font-weight: 300;
    font-style: italic;
    line-height: 1;
    color: var(--pf-border);
    letter-spacing: -0.03em;
}

.pf-hero__deco-label {
    font-family: var(--pf-font-display);
    font-size: 11px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--pf-light);
}

.pf-hero__deco-line {
    width: 1px;
    height: clamp(40px, 6vw, 80px);
    background: var(--pf-border);
    margin-top: 4px;
}

/* Scroll indicator */
.pf-hero__scroll {
    position: absolute;
    bottom: clamp(24px, 4vw, 48px);
    left: clamp(20px, 6vw, 80px);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 1;
    opacity: 0;
    animation: fadeInLeft 1s ease 1.3s both;
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 0.6; transform: none; }
}

.pf-hero__scroll-line {
    display: block;
    width: 40px;
    height: 1px;
    background: var(--pf-text);
    position: relative;
    overflow: hidden;
}

.pf-hero__scroll-line::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--pf-accent);
    transform: translateX(-100%);
    animation: lineSlide 2s ease-in-out 1.5s infinite;
}

@keyframes lineSlide {
    0%   { transform: translateX(-100%); }
    50%  { transform: translateX(0); }
    100% { transform: translateX(100%); }
}

.pf-hero__scroll-txt {
    font-family: var(--pf-font-display);
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--pf-mid);
}

/* ---------------------------------------------------------
   WORKS
   --------------------------------------------------------- */
.pf-works {
    padding: clamp(80px, 12vw, 140px) 0;
    background: var(--pf-bg);
}

.pf-works__container {
    max-width: calc(var(--pf-max-w) + clamp(40px, 12vw, 160px));
    margin: 0 auto;
    padding: 0 clamp(20px, 6vw, 80px);
}

/* Section header */
.pf-section-head {
    margin-bottom: clamp(48px, 6vw, 80px);
}

.pf-section-title {
    display: flex;
    align-items: baseline;
    gap: clamp(12px, 2vw, 24px);
    margin: 0;
    flex-wrap: wrap;
}

/* "Works" 本体 — 大きなセリフイタリック */
.pf-section-title__main {
    font-family: var(--pf-font-display);
    font-size: clamp(52px, 7vw, 108px);
    font-weight: 300;
    font-style: italic;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--pf-text);
}

/* カウンター "04" */
.pf-section-title__counter {
    font-family: var(--pf-font-display);
    font-size: clamp(14px, 1.5vw, 18px);
    font-weight: 400;
    font-style: normal;
    letter-spacing: 0.25em;
    color: var(--pf-accent);
    padding-bottom: 6px;
}

/* Works grid — 最大3列、同じ高さの均等グリッド */
.pf-works__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(16px, 2.5vw, 32px);
    align-items: stretch;
}

/* Stagger delay via CSS custom prop */
.pf-work-card { --stagger: calc((var(--card-i, 1) - 1) * 0.1s); }
.pf-work-card.is-visible { transition-delay: var(--stagger); }

/* Card image wrapper — 全カード同じアスペクト比 */
.pf-work-card__img-wrap {
    overflow: hidden;
    position: relative;
    aspect-ratio: 4 / 3;
    background: rgba(28, 26, 22, 0.05);
}

.pf-work-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.9s var(--pf-ease);
}

/* Hover overlay */
.pf-work-card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(28, 26, 22, 0);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 24px;
    transition: background 0.5s ease;
}

.pf-work-card__view-btn {
    font-family: var(--pf-font-ja);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.6);
    padding: 8px 16px;
    border-radius: 100px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* DEMO badge */
.pf-work-card__demo-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    font-family: var(--pf-font-display);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: #fff;
    background: rgba(28, 26, 22, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 4px 10px;
    border-radius: 100px;
    pointer-events: none;
    user-select: none;
}

/* Card hover interactions */
.pf-work-card__link:hover .pf-work-card__img { transform: scale(1.06); }
.pf-work-card__link:hover .pf-work-card__overlay { background: rgba(28, 26, 22, 0.35); }
.pf-work-card__link:hover .pf-work-card__view-btn { opacity: 1; transform: none; }

/* Card info row */
.pf-work-card__info {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 16px 0 0;
    flex-wrap: wrap;
}

.pf-work-card__link { text-decoration: none; }

.pf-work-card__num {
    font-family: var(--pf-font-display);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.25em;
    color: var(--pf-accent);
    flex-shrink: 0;
}

.pf-work-card__title {
    font-family: var(--pf-font-display);
    font-size: clamp(18px, 1.8vw, 24px);
    font-weight: 400;
    font-style: italic;
    color: var(--pf-text);
    letter-spacing: 0.01em;
    line-height: 1.25;
    flex: 1;
    margin: 0;
    transition: color 0.3s ease;
}

.pf-work-card__link:hover .pf-work-card__title { color: var(--pf-accent-d); }

.pf-work-card__cat {
    font-family: var(--pf-font-display);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--pf-light);
    flex-shrink: 0;
}

/* "View All" link */
.pf-works__more {
    margin-top: clamp(48px, 6vw, 80px);
    display: flex;
    justify-content: flex-end;
}

/* ---------------------------------------------------------
   ABOUT
   --------------------------------------------------------- */
.pf-about {
    padding: clamp(80px, 12vw, 140px) 0 0;
    background: var(--pf-bg-2);
}

.pf-about__inner {
    max-width: var(--pf-max-w);
    margin: 0 auto;
    padding: 0 clamp(20px, 6vw, 80px) clamp(60px, 8vw, 100px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 6vw, 80px);
    align-items: center;
}

.pf-about__heading {
    font-family: var(--pf-font-display);
    font-size: clamp(36px, 5vw, 72px);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--pf-text);
    margin: 0 0 clamp(20px, 3vw, 32px);
}

.pf-about__heading em {
    font-style: italic;
    color: var(--pf-accent);
}

.pf-about__body {
    font-family: var(--pf-font-ja);
    font-size: clamp(13px, 1.3vw, 15px);
    font-weight: 300;
    line-height: 2.2;
    color: var(--pf-mid);
    letter-spacing: 0.06em;
    margin-bottom: clamp(24px, 3vw, 36px);
}

/* About image */
.pf-about__visual { position: relative; }

.pf-about__img-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.pf-about__img-wrap::before {
    content: '';
    position: absolute;
    inset: -12px -12px auto auto;
    width: 60%;
    height: 60%;
    border-top: 1px solid var(--pf-accent);
    border-right: 1px solid var(--pf-accent);
    opacity: 0.4;
    pointer-events: none;
    z-index: 1;
}

.pf-about__img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.8s var(--pf-ease);
}

.pf-about__img-wrap:hover .pf-about__img { transform: scale(1.04); }

/* Skills marquee */
.pf-skills-marquee {
    overflow: hidden;
    padding: clamp(24px, 3vw, 36px) 0;
    border-top: 1px solid var(--pf-border);
    background: var(--pf-bg-2);
}

.pf-skills-marquee__track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    animation: marqueeScroll 24s linear infinite;
    will-change: transform;
}

.pf-skills-marquee__track:hover { animation-play-state: paused; }

.pf-skills-marquee__item {
    font-family: var(--pf-font-display);
    font-size: clamp(13px, 1.4vw, 16px);
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.1em;
    color: var(--pf-mid);
    padding: 0 clamp(24px, 3vw, 40px);
}

.pf-skills-marquee__sep {
    color: var(--pf-accent);
    font-size: 10px;
    opacity: 0.6;
}

@keyframes marqueeScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ---------------------------------------------------------
   CONTACT
   --------------------------------------------------------- */
.pf-contact {
    position: relative;
    background: var(--pf-dark);
    padding: clamp(80px, 12vw, 140px) clamp(20px, 6vw, 80px);
    overflow: hidden;
}

/* Decorative large background text */
.pf-contact__deco {
    position: absolute;
    right: -2%;
    bottom: -5%;
    font-family: var(--pf-font-display);
    font-size: clamp(80px, 15vw, 200px);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: rgba(255,255,255,0.025);
    pointer-events: none;
    user-select: none;
    line-height: 1;
}

.pf-contact__inner {
    position: relative;
    z-index: 1;
    max-width: var(--pf-max-w);
    margin: 0 auto;
}

.pf-contact__heading {
    font-family: var(--pf-font-display);
    font-size: clamp(40px, 6.5vw, 96px);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 12px 0 clamp(20px, 3vw, 32px);
}

.pf-contact__heading em {
    font-style: italic;
    color: var(--pf-accent);
}

.pf-contact__sub {
    font-family: var(--pf-font-ja);
    font-size: clamp(13px, 1.3vw, 15px);
    font-weight: 300;
    line-height: 2;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.08em;
    margin-bottom: clamp(36px, 5vw, 60px);
}

.pf-contact__btn {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-family: var(--pf-font-ja);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.12em;
    color: var(--pf-dark);
    background: #fff;
    padding: 18px 36px;
    border-radius: 100px;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.pf-contact__btn:hover {
    background: var(--pf-accent);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}

/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */

/* Tablet */
@media (max-width: 1023px) {

    /* Works: タブレットは2列 */
    .pf-works__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: clamp(12px, 2vw, 20px);
    }

    /* About: stack vertically */
    .pf-about__inner { grid-template-columns: 1fr; }
    .pf-about__img { aspect-ratio: 4/3; }
}

/* Mobile */
@media (max-width: 767px) {

    /* Hero */
    .pf-hero { padding: 100px 20px 60px; }

    .pf-hero__inner { flex-direction: column; align-items: flex-start; gap: 24px; }

    .pf-hero__deco {
        flex-direction: row;
        align-items: center;
        align-self: flex-end;
    }
    .pf-hero__deco-num { font-size: 40px; }
    .pf-hero__deco-line { display: none; }

    .pf-hero__btns { flex-direction: column; align-items: flex-start; }

    /* Works: スマホは1列 */
    .pf-works__grid { grid-template-columns: 1fr; gap: 36px; }

    /* About */
    .pf-about__inner { grid-template-columns: 1fr; gap: 32px; }
    .pf-about__visual { order: -1; }
    .pf-about__img { aspect-ratio: 4/3; }

    /* Skills marquee — slower on mobile */
    .pf-skills-marquee__track { animation-duration: 16s; }
}

@media (max-width: 480px) {
    .pf-contact__btn { padding: 16px 24px; font-size: 13px; }
    .pf-hero__scroll { display: none; }
}
