
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
}

body {
    background: #080808;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont,
        "SF Pro Display", "Segoe UI", Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100dvh;
    overflow: hidden;
}

button, input {
    font: inherit;
}

button {
    border: none;
    color: inherit;
    background: none;
    cursor: pointer;
}

button:disabled {
    opacity: 1;
    cursor: default;
}

img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

svg {
    display: block;
}

.svg-library {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* IPHONE FRAME */

.phone {
    position: relative;
    width: min(420px, calc(100vw - 24px), calc((100dvh - 24px) * 9 / 19.5));
    height: auto;
    flex-shrink: 0;
    aspect-ratio: 9 / 19.5;
    background: #000;
    border: 6px solid #181818;
    border-radius: 48px;
    overflow: hidden;
    isolation: isolate;
    container-type: inline-size;
    box-shadow:
        0 0 0 1px #383838,
        0 25px 80px #000a;
}

.screen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
    overflow: hidden;
    background: #000;
}

.screen.active {
    display: block;
}

/* STATUS BAR */

.status-bar {
    position: absolute;
    top: 2.8%;
    left: 8%;
    right: 8%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 4.1cqw;
    font-weight: 600;
    height: 5cqw;
    z-index: 20;
}

.status-left,
.status-right {
    display: flex;
    align-items: center;
    gap: 1.3cqw;
}

.status-left svg {
    width: 3.5cqw;
    height: 3.5cqw;
}

.status-right svg {
    width: 4.5cqw;
    height: 4.5cqw;
}

/* BATTERY */

.battery {
    position: relative;
    width: 6.8cqw;
    height: 3.6cqw;
    flex-shrink: 0;
    background: transparent;
    border: 1px solid #fff9;
    border-radius: 1.1cqw;
}

.battery-fill {
    position: absolute;
    top: 1.5px;
    bottom: 1.5px;
    left: 1.5px;
    width: calc((100% - 3px) * .28);
    background: #fff;
    border-radius: .5cqw;
}

.battery-number {
    display: none;
}

.battery::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -.85cqw;
    width: .5cqw;
    height: 1.6cqw;
    transform: translateY(-50%);
    background: #fff9;
    border-radius: .3cqw;
}

/* DYNAMIC ISLAND */

.dynamic-island {
    position: absolute;
    top: 1.5%;
    left: 50%;
    width: 30%;
    height: 4.1%;
    transform: translateX(-50%);
    background: #000;
    border-radius: 100px;
    z-index: 30;
}

/* HOME INDICATOR */

.home-indicator {
    position: absolute;
    bottom: 1%;
    left: 50%;
    width: 34%;
    height: 1.3cqw;
    transform: translateX(-50%);
    background: #ffffffe6;
    border-radius: 100px;
    z-index: 40;
    touch-action: none;
}

.home-indicator::before {
    content: "";
    position: absolute;
    inset: -12px -15px;
}

/* LOCK SCREEN */

.lock-screen {
    background-image: url("assets/lockscreen.jpg");
    background-size: cover;
    background-position: center;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.lock-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        #00000026,
        transparent 35%,
        transparent 70%,
        #0004
    );
    pointer-events: none;
}

.lock-date {
    position: absolute;
    top: 9.7%;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 5.1cqw;
    font-weight: 600;
    letter-spacing: -.12cqw;
    color: #ffffffe6;
}

/* NEW LIQUID GLASS CLOCK */

.lock-clock {
    position: absolute;
    top: 12.3%;
    left: 0;
    width: 100%;
    height: 25%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: visible;
    pointer-events: none;
}

.lock-clock span {
    display: block;
    font-family: Arial, sans-serif;
    font-size: 36cqw;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -2cqw;
    white-space: nowrap;
    transform: scaleX(.88) scaleY(1.65);
    transform-origin: top center;

    background: linear-gradient(
        180deg,
        rgba(255,255,255,.80),
        rgba(255,255,255,.25)
    );

    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: .5px rgba(255,255,255,.45);
}

/* LOCK SCREEN SHORTCUTS */

.lock-bottom {
    position: absolute;
    bottom: 6%;
    left: 8%;
    right: 8%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lock-shortcut {
    width: 13cqw;
    height: 13cqw;
    display: grid;
    place-items: center;
    background: #1e1e1e8c;
    border: 1px solid #ffffff29;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 50%;
}

.lock-shortcut svg {
    width: 6cqw;
    height: 6cqw;
}

.focus-mode {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2cqw;
    font-size: 3.3cqw;
    font-weight: 500;
}

.focus-mode svg {
    width: 3.5cqw;
    height: 3.5cqw;
}

.swipe-label {
    display: none;
}

/* VERSION 2 SWIPE ANIMATION */

.home-screen.unlock-preview {
    display: block;
    z-index: 1;
    pointer-events: none;
}

.lock-screen.active {
    z-index: 50;
    will-change: transform;
    transition: transform 480ms cubic-bezier(.22,1,.36,1);
}

.lock-screen.dragging {
    transition: none;
}

.swipe-fixed-island,
.swipe-fixed-indicator {
    display: none;
    pointer-events: none;
    z-index: 60;
}

.swipe-preview > .swipe-fixed-island,
.swipe-preview > .swipe-fixed-indicator {
    display: block;
}

.swipe-preview .screen .dynamic-island,
.swipe-preview .screen .home-indicator {
    opacity: 0;
}

/* HOME SCREEN */

.home-screen {
    background-image: url("assets/wallpaper.jpg");
    background-size: cover;
    background-position: center;
}

.home-content {
    position: absolute;
    top: 10.4%;
    left: 5.3%;
    right: 5.3%;
}

/* WIDGETS */

.widgets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5cqw;
    margin-bottom: 6cqw;
}

.widget {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 6.5cqw;
}

.photo-widget img {
    object-fit: cover;
    object-position: center;
}

.clock-widget {
    display: grid;
    place-items: center;
    background: #443039;
}

.clock-widget svg {
    width: 94%;
    height: 94%;
}

/* APP ICONS */

.app-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 5cqw;
    row-gap: 6cqw;
}

.app-icon {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    background: transparent;
    border-radius: 5cqw;
    overflow: hidden;
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

button.app-icon:active {
    transform: scale(.93);
    transition: transform .1s;
}

/* PAGE INDICATORS */

.page-dots {
    position: absolute;
    bottom: 14.6%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1.6cqw;
}

.page-dots span {
    width: 1.5cqw;
    height: 1.5cqw;
    background: #ffffff59;
    border-radius: 50%;
}

.page-dots .selected {
    background: #fff;
}

/* DOCK */

.dock {
    position: absolute;
    bottom: 2.8%;
    left: 3.6%;
    right: 3.6%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4cqw;
    padding: 3.5cqw;
    background: #9696962b;
    border: 1px solid #ffffff1f;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 8cqw;
}

/* NOTES APP */

.notes-screen,
.note-detail {
    background: #000;
    color: #f2f2f7;
}

.notes-nav {
    position: absolute;
    top: 7.1%;
    left: 4%;
    right: 4%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

/* LIQUID GLASS BUTTONS */

.glass-button,
.glass-pill {
    height: 11cqw;
    background: #2d2d2fcc;
    border: 1px solid #ffffff21;
    box-shadow:
        inset 0 1px 1px #ffffff12,
        0 3px 10px #0004;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.glass-button {
    display: grid;
    place-items: center;
    width: 11cqw;
    flex-shrink: 0;
    border-radius: 50%;
}

.glass-button svg {
    width: 5.6cqw;
    height: 5.6cqw;
}

.glass-pill {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    border-radius: 100px;
}

.glass-pill button {
    display: grid;
    place-items: center;
    flex: 1;
    height: 100%;
}

.glass-pill svg {
    width: 5.4cqw;
    height: 5.4cqw;
}

.glass-button:active,
.glass-pill button:active {
    opacity: .65;
}

/* NOTES LIST */

.notes-content {
    position: absolute;
    top: 15%;
    left: 4%;
    right: 4%;
    bottom: 10%;
    overflow-y: auto;
    scrollbar-width: none;
}

.notes-heading {
    padding: 0 2cqw;
    margin-bottom: 7cqw;
}

.notes-heading h1 {
    font-size: 8.3cqw;
    font-weight: 750;
    letter-spacing: -.4cqw;
}

.notes-heading p {
    margin-top: .8cqw;
    font-size: 3.8cqw;
    color: #8e8e93;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3cqw;
    margin-bottom: 3cqw;
}

.section-heading h2 {
    font-size: 5cqw;
    font-weight: 700;
}

.section-heading button {
    color: #ffd60a;
    transition: transform .2s;
}

.section-heading svg {
    width: 5cqw;
    height: 5cqw;
}

.note-group {
    background: #1c1c1e;
    border-radius: 6.5cqw;
    overflow: hidden;
}

.note-row {
    display: block;
    width: 100%;
    padding: 4.5cqw;
    text-align: left;
}

.note-row strong {
    display: block;
    font-size: 4.2cqw;
    font-weight: 650;
    margin-bottom: 1.5cqw;
}

.note-preview {
    display: flex;
    align-items: center;
    gap: 2cqw;
    color: #8e8e93;
    font-size: 3.8cqw;
}

.preview-date {
    flex-shrink: 0;
    color: #b0b0b5;
}

.note-preview span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-row:active {
    background: #303033;
}

/* NOTES SEARCH BAR */

.notes-toolbar {
    position: absolute;
    bottom: 3.3%;
    left: 4%;
    right: 4%;
    display: flex;
    align-items: center;
    gap: 3cqw;
}

.search-pill {
    display: flex;
    align-items: center;
    gap: 2.5cqw;
    flex: 1;
    min-width: 0;
    height: 11cqw;
    padding: 0 4cqw;
    background: #2d2d2fd9;
    border: 1px solid #ffffff21;
    border-radius: 100px;
}

.search-pill svg {
    width: 4.7cqw;
    height: 4.7cqw;
    color: #a0a0a5;
    flex-shrink: 0;
}

.search-pill input {
    width: 100%;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    font-size: 4cqw;
    color: #fff;
}

.search-pill input::placeholder {
    color: #8e8e93;
}

/* INDIVIDUAL NOTE */

.top-actions {
    width: 25cqw;
}

.note-paper {
    position: absolute;
    top: 14.9%;
    left: 6.5%;
    right: 6.5%;
    bottom: 11%;
    overflow-y: auto;
    scrollbar-width: none;
    overflow-wrap: break-word;
}

.note-paper h1 {
    font-size: 6.8cqw;
    font-weight: 700;
    letter-spacing: -.2cqw;
    line-height: 1.2;
    margin-bottom: 5cqw;
    color: #f2f2f7;
}

.note-body {
    font-size: 4.25cqw;
    font-weight: 400;
    line-height: 1.5;
    color: #dedee3;
}

.note-body p {
    margin-bottom: 4.5cqw;
}

.detail-toolbar {
    position: absolute;
    bottom: 3.3%;
    left: 7%;
    right: 7%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.editing-tools {
    width: 42cqw;
}

/* HIDDEN SCROLLBARS */

.notes-content,
.note-paper {
    overflow-y: auto;
    scrollbar-width: none !important;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.notes-content::-webkit-scrollbar,
.note-paper::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* MOBILE RESPONSIVENESS */

@media (max-width: 500px) {
    html, body {
        overflow: hidden;
    }

    .phone {
        border: 5px solid #181818;
        border-radius: clamp(28px, 10vw, 44px);
        box-shadow:
            0 0 0 1px #383838,
            0 15px 40px #000a;
    }
}

.lock-screen,
.home-screen {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
